# HG changeset patch
# Parent eab812ef23d92c2aea25c912aef933f4c8cd0d27
Use i386-cpuinfo.c on all i386 targets
@@ -27699,7 +27699,7 @@ ix86_init_mmx_sse_builtins (void)
}
/* This builds the processor_model struct type defined in
- libgcc/config/i386/i386-cpuinfo.c */
+ libgcc/config/i386/cpuinfo.c */
static tree
build_processor_model_struct (void)
@@ -27759,7 +27759,7 @@ make_var_decl (tree type, const char *na
}
/* FNDECL is a __builtin_cpu_is or a __builtin_cpu_supports call that is folded
- into an integer defined in libgcc/config/i386/i386-cpuinfo.c */
+ into an integer defined in libgcc/config/i386/cpuinfo.c */
static tree
fold_builtin_cpu (tree fndecl, tree *args)
@@ -27769,8 +27769,7 @@ fold_builtin_cpu (tree fndecl, tree *arg
DECL_FUNCTION_CODE (fndecl);
tree param_string_cst = NULL;
- /* This is the order of bit-fields in __processor_features in
- i386-cpuinfo.c */
+ /* This is the order of bit-fields in __processor_features in cpuinfo.c */
enum processor_features
{
F_CMOV = 0,
@@ -27788,7 +27787,7 @@ fold_builtin_cpu (tree fndecl, tree *arg
};
/* These are the values for vendor types and cpu types and subtypes
- in i386-cpuinfo.c. Cpu types and subtypes should be subtracted by
+ in cpuinfo.c. Cpu types and subtypes should be subtracted by
the corresponding start value. */
enum processor_model
{
@@ -121,7 +121,7 @@ installcheck:
.PHONY: all clean
clean:
- -rm -f config.h libgcc_tm.h stamp-h stmp-ldirs libgcc.map
+ -rm -f auto-target.h libgcc_tm.h stamp-h stmp-ldirs libgcc.map
-rm -f *$(objext)
-rm -f *.dep
-rm -f *.a
@@ -139,9 +139,9 @@ Makefile: $(srcdir)/Makefile.in config.s
# Depending on Makefile makes sure that config.status has been re-run
# if needed. This prevents problems with parallel builds.
-config.h: stamp-h ; @true
+auto-target.h: stamp-h ; @true
stamp-h: $(srcdir)/config.in config.status Makefile
- CONFIG_FILES= CONFIG_HEADERS=config.h:$(srcdir)/config.in $(SHELL) ./config.status
+ CONFIG_FILES= CONFIG_HEADERS=auto-target.h:$(srcdir)/config.in $(SHELL) ./config.status
config.status: $(srcdir)/configure $(srcdir)/config.host
$(SHELL) ./config.status --recheck
@@ -1124,11 +1124,17 @@ mep*-*-*)
esac
case ${host} in
+i[34567]86-*-* | x86_64-*-*)
+ tmake_file="${tmake_file} i386/t-cpuinfo"
+ ;;
+esac
+
+case ${host} in
i[34567]86-*-linux* | x86_64-*-linux* | \
i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \
i[34567]86-*-knetbsd*-gnu | \
i[34567]86-*-gnu*)
- tmake_file="${tmake_file} t-tls i386/t-linux i386/t-cpuinfo"
+ tmake_file="${tmake_file} t-tls i386/t-linux"
if test "$libgcc_cv_cfi" = "yes"; then
tmake_file="${tmake_file} t-stack i386/t-stack-i386"
fi
rename from libgcc/config/i386/i386-cpuinfo.c
rename to libgcc/config/i386/cpuinfo.c
@@ -20,8 +20,16 @@ along with GCC; see the file COPYING3.
#include "cpuid.h"
#include "tsystem.h"
+#include "auto-target.h"
-int __cpu_indicator_init (void) __attribute__ ((constructor (101)));
+#ifdef HAVE_INIT_PRIORITY
+#define CONSTRUCTOR_PRIORITY (101)
+#else
+#define CONSTRUCTOR_PRIORITY
+#endif
+
+int __cpu_indicator_init (void)
+ __attribute__ ((constructor CONSTRUCTOR_PRIORITY));
enum vendor_signatures
{
@@ -253,7 +261,7 @@ __get_cpuid_output (unsigned int __level
the priority set. However, it still runs after ifunc initializers and
needs to be called explicitly there. */
-int __attribute__ ((constructor (101)))
+int __attribute__ ((constructor CONSTRUCTOR_PRIORITY))
__cpu_indicator_init (void)
{
unsigned int eax, ebx, ecx, edx;
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -106,3 +106,7 @@ GCC_4.6.0 {
__trunctfxf2
__unordtf2
}
+
+GCC_4.8.0 {
+ __cpu_model
+}
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Free Software Foundation, Inc.
+# Copyright (C) 2010, 2012 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
@@ -106,3 +106,7 @@ GCC_4.5.0 {
__trunctfxf2
__unordtf2
}
+
+GCC_4.8.0 {
+ __cpu_model
+}
@@ -1,1 +1,1 @@
-LIB2ADD += $(srcdir)/config/i386/i386-cpuinfo.c
+LIB2ADD += $(srcdir)/config/i386/cpuinfo.c
@@ -39,6 +39,7 @@ else
fi
AC_SUBST(libgcc_topdir)
AC_CONFIG_AUX_DIR($libgcc_topdir)
+AC_CONFIG_HEADER(auto-target.h:config.in)
AC_ARG_ENABLE(shared,
[ --disable-shared don't provide a shared libgcc],
@@ -327,6 +328,15 @@ if test "$enable_tls $gcc_cv_use_emutls"
fi
AC_SUBST(set_use_emutls)
+AC_CACHE_CHECK(for init priority support, libgcc_cv_init_priority, [
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
+ [[void ip (void) __attribute__ ((constructor (1)));]])],
+ [libgcc_cv_init_priority=yes],[libgcc_cv_init_priority=no])])
+if test $libgcc_cv_init_priority = yes; then
+ AC_DEFINE(HAVE_INIT_PRIORITY, 1,
+ [Define if the compiler supports init priority.])
+fi
+
# Conditionalize the sfp-machine.h header for this target machine.
if test -z "${sfp_machine_header}"; then
sfp_machine_header=$cpu_type/sfp-machine.h