diff options
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 114 |
1 files changed, 111 insertions, 3 deletions
diff --git a/gcc/configure b/gcc/configure index cc4843188d8..10c24cc94c9 100755 --- a/gcc/configure +++ b/gcc/configure @@ -624,6 +624,8 @@ tm_defines tm_include_list tm_file_list thread_file +common_out_object_file +common_out_file out_object_file out_file objc_boehm_gc @@ -10457,16 +10459,114 @@ $as_echo_n "checking for .preinit_array/.init_array/.fini_array support... " >&6 if test "${gcc_cv_initfini_array+set}" = set; then : $as_echo_n "(cached) " >&6 else + if test "x${build}" = "x${target}" && test "x${build}" = "x${host}"; then if test "$cross_compiling" = yes; then : gcc_cv_initfini_array=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifdef __ia64__ +/* We turn on .preinit_array/.init_array/.fini_array support for ia64 + if it can be used. */ static int x = -1; int main (void) { return x; } int foo (void) { x = 0; } int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; +#else +extern void abort (); +static int count; + +static void +init1005 () +{ + if (count != 0) + abort (); + count = 1005; +} +void (*const init_array1005) () + __attribute__ ((section (".init_array.01005"), aligned (sizeof (void *)))) + = { init1005 }; +static void +fini1005 () +{ + if (count != 1005) + abort (); +} +void (*const fini_array1005) () + __attribute__ ((section (".fini_array.01005"), aligned (sizeof (void *)))) + = { fini1005 }; + +static void +ctor1007 () +{ + if (count != 1005) + abort (); + count = 1007; +} +void (*const ctors1007) () + __attribute__ ((section (".ctors.64528"), aligned (sizeof (void *)))) + = { ctor1007 }; +static void +dtor1007 () +{ + if (count != 1007) + abort (); + count = 1005; +} +void (*const dtors1007) () + __attribute__ ((section (".dtors.64528"), aligned (sizeof (void *)))) + = { dtor1007 }; + +static void +init65530 () +{ + if (count != 1007) + abort (); + count = 65530; +} +void (*const init_array65530) () + __attribute__ ((section (".init_array.65530"), aligned (sizeof (void *)))) + = { init65530 }; +static void +fini65530 () +{ + if (count != 65530) + abort (); + count = 1007; +} +void (*const fini_array65530) () + __attribute__ ((section (".fini_array.65530"), aligned (sizeof (void *)))) + = { fini65530 }; + +static void +ctor65535 () +{ + if (count != 65530) + abort (); + count = 65535; +} +void (*const ctors65535) () + __attribute__ ((section (".ctors"), aligned (sizeof (void *)))) + = { ctor65535 }; +static void +dtor65535 () +{ + if (count != 65535) + abort (); + count = 65530; +} +void (*const dtors65535) () + __attribute__ ((section (".dtors"), aligned (sizeof (void *)))) + = { dtor65535 }; + +int +main () +{ + return 0; +} +#endif + _ACEOF if ac_fn_c_try_run "$LINENO"; then : gcc_cv_initfini_array=yes @@ -10477,6 +10577,11 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking cross compile... guessing" >&5 +$as_echo_n "checking cross compile... guessing... " >&6; } + gcc_cv_initfini_array=no + fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_initfini_array" >&5 $as_echo "$gcc_cv_initfini_array" >&6; } @@ -11217,6 +11322,7 @@ done tmake_file="${tmake_file_}" out_object_file=`basename $out_file .c`.o +common_out_object_file=`basename $common_out_file .c`.o tm_file_list="options.h" tm_include_list="options.h insn-constants.h" @@ -17517,7 +17623,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17520 "configure" +#line 17626 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17623,7 +17729,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17626 "configure" +#line 17732 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -26394,6 +26500,8 @@ fi + + # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then @@ -27951,7 +28059,7 @@ case ${CONFIG_HEADERS} in echo > cstamp-h ;; esac # Make sure all the subdirs exist. -for d in $subdirs doc build c-family +for d in $subdirs doc build common c-family do test -d $d || mkdir $d done |