From 06d9d5232ea8ec9fc7e55acdbdd9a87f09d06755 Mon Sep 17 00:00:00 2001 From: joseph Date: Fri, 9 Mar 2012 23:15:08 +0000 Subject: Merge changes between r17457 and r17501 from /fsf/trunk. git-svn-id: svn://svn.eglibc.org/trunk@17502 7b3dc134-2b1b-0410-93df-9e9f96275f8d --- libc/configure.in | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'libc/configure.in') 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 <&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 <&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 -- cgit v1.2.3