diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-03-09 23:15:08 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2012-03-09 23:15:08 +0000 |
commit | 06d9d5232ea8ec9fc7e55acdbdd9a87f09d06755 (patch) | |
tree | c770ee56ff6e05867d488acee6e10cc82eb47149 /libc/configure.in | |
parent | 66de1db7a3d01ae2686765cdad22f95a8fa0652d (diff) |
Merge changes between r17457 and r17501 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@17502 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/configure.in')
-rw-r--r-- | libc/configure.in | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/libc/configure.in b/libc/configure.in index 02ef76400..491c39e31 100644 --- a/libc/configure.in +++ b/libc/configure.in @@ -1386,24 +1386,17 @@ fi AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support, libc_cv_initfini_array, [dnl -cat > conftest.c <<EOF -int _start (void) { return 0; } -int __start (void) { return 0; } +LIBC_TRY_LINK_STATIC([ int foo (void) { return 1; } int (*fp) (void) __attribute__ ((section (".init_array"))) = foo; -EOF -if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest conftest.c - -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD]) -then - if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then +], + [if $READELF -S conftest | fgrep INIT_ARRAY > /dev/null; then libc_cv_initfini_array=yes else libc_cv_initfini_array=no - fi -else - libc_cv_initfini_array=no -fi -rm -f conftest*]) + fi], + [libc_cv_initfini_array=no]) +]) if test $libc_cv_initfini_array != yes; then AC_MSG_ERROR([Need linker with .init_array/.fini_array support.]) fi @@ -1411,16 +1404,11 @@ fi AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer, libc_cv_ctors_header, [dnl libc_cv_ctors_header=yes - cat > conftest.c <<EOF -int _start (void) { return 0; } -int __start (void) { return 0; } -int puts (const char *s) { return 0; } -__attribute__ ((constructor)) void ctor (void) { puts("ctor"); } -__attribute__ ((destructor)) void dtor (void) { puts("dtor"); } -EOF - if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest - conftest.c -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD]) - then + LIBC_TRY_LINK_STATIC([ +__attribute__ ((constructor)) void ctor (void) { asm (""); } +__attribute__ ((destructor)) void dtor (void) { asm (""); } +], + [dnl AS_IF([$READELF -WS conftest$ac_exeext | $AWK ' { gsub(/\@<:@ */, "@<:@") } $2 == ".ctors" || $2 == ".dtors" { @@ -1435,10 +1423,10 @@ EOF exit ((ctors_ok && dtors_ok) ? 0 : 1) } '], [libc_cv_ctors_header=no]) - else - AC_MSG_ERROR([missing __attribute__ ((constructor)) support??]) - fi - rm -f conftest*]) + ], [dnl + AC_MSG_ERROR([missing __attribute__ ((constructor)) support??]) + ]) +]) if test $libc_cv_ctors_header = no; then AC_DEFINE(NO_CTORS_DTORS_SECTIONS) fi |