+2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * config/sparc/driver-sparc.c: New file.
+ * config/sparc/x-sparc: New file.
+ * config.host: Use driver-sparc.o, sparc/x-sparc on
+ sparc*-*-solaris2*.
+ * config/sparc/sparc.opt (native): New value for enum
+ processor_type.
+ * config/sparc/sparc-opts.h (PROCESSOR_NATIVE): Declare.
+ * config/sparc/sparc.c (sparc_option_override): Abort if
+ PROCESSOR_NATIVE gets here.
+ * config/sparc/sol2.h [__sparc__] (host_detect_local_cpu): Declare.
+ (EXTRA_SPEC_FUNCTIONS, MCPU_MTUNE_NATIVE_SPECS,
+ DRIVER_SELF_SPECS): Define.
+ * doc/invoke.texi (SPARC Options, -mcpu): Document native.
+ (SPARC Options, -mtune): Likewise.
+ * configure.ac (EXTRA_GCC_LIBS): Check for libkstat.
+ Substitute result.
+ * configure: Regenerate.
+ * Makefile.in (EXTRA_GCC_LIBS): Set.
+ (xgcc$(exeext)): Add $(EXTRA_GCC_LIBS).
+ (cpp$(exeext)): Likewise.
+
2011-08-08 Richard Guenther <rguenther@suse.de>
* tree-vrp.c (extract_range_from_unary_expr_1): New function,
# the gcc driver.
EXTRA_GCC_OBJS =@extra_gcc_objs@
+# List of extra libraries that should be linked with the gcc driver.
+EXTRA_GCC_LIBS = @EXTRA_GCC_LIBS@
+
# List of additional header files to install.
EXTRA_HEADERS =@extra_headers_list@
xgcc$(exeext): $(GCC_OBJS) gccspec.o libcommon-target.a $(LIBDEPS) \
$(EXTRA_GCC_OBJS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
- gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ gccspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# cpp is to cpp0 as gcc is to cc1.
# The only difference from xgcc is that it's linked with cppspec.o
cpp$(exeext): $(GCC_OBJS) cppspec.o libcommon-target.a $(LIBDEPS) \
$(EXTRA_GCC_OBJS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
- cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ cppspec.o $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# Dump a specs file to make -B./ read these specs over installed ones.
$(SPECS): xgcc$(exeext)
;;
esac
;;
+ sparc*-*-solaris2*)
+ case ${target} in
+ sparc*-*-solaris2*)
+ host_extra_gcc_objs="driver-sparc.o"
+ host_xmake_file="${host_xmake_file} sparc/x-sparc"
+ ;;
+ esac
+ ;;
esac
# Machine-specific settings.
%{!m32:%{!m64:%(cpp_arch_default)}} \
"
+/* -mcpu=native handling only makes sense with compiler running on
+ a SPARC chip. */
+#if defined(__sparc__)
+extern const char *host_detect_local_cpu (int argc, const char **argv);
+# define EXTRA_SPEC_FUNCTIONS \
+ { "local_cpu_detect", host_detect_local_cpu },
+
+# define MCPU_MTUNE_NATIVE_SPECS \
+ " %{mcpu=native:%<mcpu=native %:local_cpu_detect(cpu)}" \
+ " %{mtune=native:%<mtune=native %:local_cpu_detect(tune)}"
+#else
+# define MCPU_MTUNE_NATIVE_SPECS ""
+#endif
+
+#define DRIVER_SELF_SPECS MCPU_MTUNE_NATIVE_SPECS
+
#undef CC1_SPEC
#if DEFAULT_ARCH32_P
#define CC1_SPEC "\
PROCESSOR_ULTRASPARC,
PROCESSOR_ULTRASPARC3,
PROCESSOR_NIAGARA,
- PROCESSOR_NIAGARA2
+ PROCESSOR_NIAGARA2,
+ PROCESSOR_NATIVE
};
#endif
case PROCESSOR_NIAGARA2:
sparc_costs = &niagara2_costs;
break;
+ case PROCESSOR_NATIVE:
+ gcc_unreachable ();
};
#ifdef TARGET_DEFAULT_LONG_DOUBLE_128
Enum
Name(sparc_processor_type) Type(enum processor_type)
+EnumValue
+Enum(sparc_processor_type) String(native) Value(PROCESSOR_NATIVE) DriverOnly
+
EnumValue
Enum(sparc_processor_type) String(v7) Value(PROCESSOR_V7)
LTLIBICONV
LIBICONV
LDEXP_LIB
+EXTRA_GCC_LIBS
GNAT_LIBEXC
COLLECT2_LIBS
CXXCPP
LIBS="$save_LIBS"
+# To support -mcpu=native on Solaris/SPARC, we need libkstat.
+save_LIBS="$LIBS"
+LIBS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing kstat_open" >&5
+$as_echo_n "checking for library containing kstat_open... " >&6; }
+if test "${ac_cv_search_kstat_open+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kstat_open ();
+int
+main ()
+{
+return kstat_open ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' kstat; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_kstat_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if test "${ac_cv_search_kstat_open+set}" = set; then :
+ break
+fi
+done
+if test "${ac_cv_search_kstat_open+set}" = set; then :
+
+else
+ ac_cv_search_kstat_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_kstat_open" >&5
+$as_echo "$ac_cv_search_kstat_open" >&6; }
+ac_res=$ac_cv_search_kstat_open
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+EXTRA_GCC_LIBS="$LIBS"
+LIBS="$save_LIBS"
+
+
# Some systems put ldexp and frexp in libm instead of libc; assume
# they're both in the same place. jcf-dump needs them.
save_LIBS="$LIBS"
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17766 "configure"
+#line 17830 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 17872 "configure"
+#line 17936 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
LIBS="$save_LIBS"
AC_SUBST(GNAT_LIBEXC)
+# To support -mcpu=native on Solaris/SPARC, we need libkstat.
+save_LIBS="$LIBS"
+LIBS=
+AC_SEARCH_LIBS(kstat_open, kstat)
+EXTRA_GCC_LIBS="$LIBS"
+LIBS="$save_LIBS"
+AC_SUBST(EXTRA_GCC_LIBS)
+
# Some systems put ldexp and frexp in libm instead of libc; assume
# they're both in the same place. jcf-dump needs them.
save_LIBS="$LIBS"
+2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (g++$(exeext)): Add $(EXTRA_GCC_LIBS).
+
2011-08-05 Jason Merrill <jason@redhat.com>
PR c++/48993
GXX_OBJS = $(GCC_OBJS) g++spec.o
g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
- $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# Create a version of the g++ driver which calls the cross-compiler.
g++-cross$(exeext): g++$(exeext)
@samp{sparclet}, @samp{tsc701}, @samp{v9}, @samp{ultrasparc},
@samp{ultrasparc3}, @samp{niagara} and @samp{niagara2}.
+Native Solaris toolchains also support the value @samp{native},
+which selects the best architecture option for the host processor.
+@option{-mcpu=native} has no effect if GCC does not recognize
+the processor.
+
Default instruction scheduling parameters are used for values that select
an architecture and not an implementation. These are @samp{v7}, @samp{v8},
@samp{sparclite}, @samp{sparclet}, @samp{v9}.
that select a particular CPU implementation. Those are @samp{cypress},
@samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{f930}, @samp{f934},
@samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc}, @samp{ultrasparc3},
-@samp{niagara}, and @samp{niagara2}.
+@samp{niagara}, and @samp{niagara2}. With native Solaris toolchains,
+@samp{native} can also be used.
@item -mv8plus
@itemx -mno-v8plus
+2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (gfortran$(exeext)): Add $(EXTRA_GCC_LIBS).
+
2011-08-07 Janus Weil <janus@gcc.gnu.org>
Thomas Koenig <tkoenig@gcc.gnu.org>
gfortran$(exeext): $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
$(LIBDEPS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
- $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ $(GFORTRAN_D_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# Create a version of the gfortran driver which calls the cross-compiler.
gfortran-cross$(exeext): gfortran$(exeext)
+2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in (gccgo$(exeext)): Add $(EXTRA_GCC_LIBS).
+
2011-08-02 Roberto Lublinerman <rluble@gmail.com>
* Make-lang.in (GO_OBJS): Add go/ast-dump.o.
GCCGO_OBJS = $(GCC_OBJS) gospec.o
gccgo$(exeext): $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
- $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ $(GCCGO_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# Use strict warnings.
go-warn = $(STRICT_WARN)
+2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
+
+ * Make-lang.in ($(XGCJ)$(exeext)): Add $(EXTRA_GCC_LIBS).
+
2011-07-19 Richard Guenther <rguenther@suse.de>
* builtins.c (static): Use fold_build_pointer_plus.
$(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o \
libcommon-target.a $(LIBDEPS) $(EXTRA_GCC_OBJS)
+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) \
- jvspec.o java/jcf-path.o $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBS)
+ jvspec.o java/jcf-path.o $(EXTRA_GCC_OBJS) libcommon-target.a \
+ $(EXTRA_GCC_LIBS) $(LIBS)
# Create a version of the $(XGCJ) driver which calls the cross-compiler.
$(XGCJ)-cross$(exeext): $(XGCJ)$(exeext)