driver-sparc.c: New file.

gcc:
	* 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.

	gcc/cp:
	* Make-lang.in (g++$(exeext)): Add $(EXTRA_GCC_LIBS).

	gcc/fortran:
	* Make-lang.in (gfortran$(exeext)): Add $(EXTRA_GCC_LIBS).

	gcc/go:
	* Make-lang.in (gccgo$(exeext)): Add $(EXTRA_GCC_LIBS).

	gcc/java:
	* Make-lang.in ($(XGCJ)$(exeext)): Add $(EXTRA_GCC_LIBS).

From-SVN: r177559
This commit is contained in:
Rainer Orth 2011-08-08 12:08:31 +00:00 committed by Rainer Orth
parent ce6bfa50fa
commit e3b3fa45a4
18 changed files with 166 additions and 10 deletions

View File

@ -1,3 +1,26 @@
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,

View File

@ -714,6 +714,9 @@ EXTRA_OBJS = @extra_objs@
# 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@
@ -1808,7 +1811,8 @@ libcommon.a: $(OBJS-libcommon)
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
@ -1816,7 +1820,8 @@ xgcc$(exeext): $(GCC_OBJS) gccspec.o libcommon-target.a $(LIBDEPS) \
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)

View File

@ -157,6 +157,14 @@ case ${host} in
;;
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.

View File

@ -157,6 +157,22 @@ along with GCC; see the file COPYING3. If not see
%{!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 "\

View File

@ -41,7 +41,8 @@ enum processor_type {
PROCESSOR_ULTRASPARC,
PROCESSOR_ULTRASPARC3,
PROCESSOR_NIAGARA,
PROCESSOR_NIAGARA2
PROCESSOR_NIAGARA2,
PROCESSOR_NATIVE
};
#endif

View File

@ -911,6 +911,8 @@ sparc_option_override (void)
case PROCESSOR_NIAGARA2:
sparc_costs = &niagara2_costs;
break;
case PROCESSOR_NATIVE:
gcc_unreachable ();
};
#ifdef TARGET_DEFAULT_LONG_DOUBLE_128

View File

@ -100,6 +100,9 @@ Schedule code for given CPU
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)

68
gcc/configure vendored
View File

@ -735,6 +735,7 @@ LIBICONV_DEP
LTLIBICONV
LIBICONV
LDEXP_LIB
EXTRA_GCC_LIBS
GNAT_LIBEXC
COLLECT2_LIBS
CXXCPP
@ -8744,6 +8745,69 @@ GNAT_LIBEXC="$LIBS"
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"
@ -17763,7 +17827,7 @@ else
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
@ -17869,7 +17933,7 @@ else
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

View File

@ -974,6 +974,14 @@ GNAT_LIBEXC="$LIBS"
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"

View File

@ -1,3 +1,7 @@
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

View File

@ -63,7 +63,8 @@ g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
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)

View File

@ -17263,6 +17263,11 @@ for machine type @var{cpu_type}. Supported values for @var{cpu_type} are
@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}.
@ -17327,7 +17332,8 @@ The same values for @option{-mcpu=@var{cpu_type}} can be used for
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

View File

@ -1,3 +1,7 @@
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>

View File

@ -88,7 +88,8 @@ GFORTRAN_D_OBJS = $(GCC_OBJS) gfortranspec.o
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)

View File

@ -1,3 +1,7 @@
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.

View File

@ -39,7 +39,8 @@ gospec.o: $(srcdir)/go/gospec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
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)

View File

@ -1,3 +1,7 @@
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.

View File

@ -66,7 +66,8 @@ jvspec.o: $(srcdir)/java/jvspec.c $(SYSTEM_H) coretypes.h $(TM_H) \
$(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)