diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-03-08 00:17:27 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-03-08 00:17:27 +0000 |
commit | 07037eeb43ca1e0ac2802e3a1492cecf869c63c6 (patch) | |
tree | 83e74c69cd8497be987abe3e2e058fb3a62cb278 /configure | |
parent | af6a1e37554a1245d468ffe44d2c981998a4e0eb (diff) | |
download | glibc-07037eeb43ca1e0ac2802e3a1492cecf869c63c6.tar.gz |
Fix .ctors/.dtors header configure test for bootstrapping.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 41 |
1 files changed, 22 insertions, 19 deletions
@@ -5999,17 +5999,19 @@ else cat > conftest.c <<EOF int _start (void) { return 0; } int __start (void) { return 0; } + int foo (void) { return 1; } int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; + EOF -if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c - -static -nostartfiles -nostdlib 1>&5' +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest + conftest.c -static -nostartfiles -nostdlib + 1>&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 (eval $ac_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; } -then + test $ac_status = 0; }; }; then : if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then libc_cv_initfini_array=yes else @@ -6019,6 +6021,7 @@ else libc_cv_initfini_array=no fi rm -f conftest* + fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_initfini_array" >&5 $as_echo "$libc_cv_initfini_array" >&6; } @@ -6032,21 +6035,22 @@ if ${libc_cv_ctors_header+:} false; then : $as_echo_n "(cached) " >&6 else libc_cv_ctors_header=yes - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ + cat > conftest.c <<EOF +int _start (void) { return 0; } +int __start (void) { return 0; } -__attribute__ ((constructor)) void ctor (void) { puts("ctor"); } -__attribute__ ((destructor)) void dtor (void) { puts("dtor"); } +__attribute__ ((constructor)) void ctor (void) { asm (""); } +__attribute__ ((destructor)) void dtor (void) { asm (""); } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : +EOF +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest + conftest.c -static -nostartfiles -nostdlib + 1>&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : if $READELF -WS conftest$ac_exeext | $AWK ' { gsub(/\[ */, "[") } $2 == ".ctors" || $2 == ".dtors" { @@ -6068,8 +6072,7 @@ else as_fn_error $? "missing __attribute__ ((constructor)) support??" "$LINENO" 5 fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ctors_header" >&5 |