[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r14703 - in /trunk/libc: ChangeLog.eglibc configure configure.in
- To: commits@xxxxxxxxxx
- Subject: [commits] r14703 - in /trunk/libc: ChangeLog.eglibc configure configure.in
- From: joseph@xxxxxxxxxx
- Date: Mon, 25 Jul 2011 15:36:08 -0000
Author: joseph
Date: Mon Jul 25 08:36:07 2011
New Revision: 14703
Log:
* configure.in (whether to use .ctors/.dtors header and trailer):
Avoid use of AC_TRY_LINK.
* configure: Regenerate.
Modified:
trunk/libc/ChangeLog.eglibc
trunk/libc/configure
trunk/libc/configure.in
Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Mon Jul 25 08:36:07 2011
@@ -1,3 +1,9 @@
+2011-07-25 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * configure.in (whether to use .ctors/.dtors header and trailer):
+ Avoid use of AC_TRY_LINK.
+ * configure: Regenerate.
+
2011-07-22 Denis Zaitceff <zaitceff@xxxxxxxxx>
* elf/dl-support.c, elf/rtld.c: Include <gnu/option-groups.h>.
Modified: trunk/libc/configure
==============================================================================
--- trunk/libc/configure (original)
+++ trunk/libc/configure Mon Jul 25 08:36:07 2011
@@ -6520,46 +6520,22 @@
$as_echo_n "(cached) " >&6
else
libc_cv_ctors_header=yes
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
+ 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"); }
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_link") 2>conftest.er1
+EOF
+ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
+ conftest.c -static -nostartfiles -nostdlib 1>&5'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
- }; then
- if $READELF -WS conftest$ac_exeext | $AWK '
+ (exit $ac_status); }; }
+ then
+ if $READELF -WS conftest$ac_exeext | $AWK '
{ gsub(/\[ */, "[") }
$2 == ".ctors" || $2 == ".dtors" {
size = strtonum("0x" $6)
@@ -6576,21 +6552,12 @@
libc_cv_ctors_header=no
fi
-
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- { { $as_echo "$as_me:$LINENO: error: missing __attribute__ ((constructor)) support??" >&5
+ else
+ { { $as_echo "$as_me:$LINENO: error: missing __attribute__ ((constructor)) support??" >&5
$as_echo "$as_me: error: missing __attribute__ ((constructor)) support??" >&2;}
{ (exit 1); exit 1; }; }
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
-
+ fi
+ rm -f conftest*
fi
{ $as_echo "$as_me:$LINENO: result: $libc_cv_ctors_header" >&5
$as_echo "$libc_cv_ctors_header" >&6; }
Modified: trunk/libc/configure.in
==============================================================================
--- trunk/libc/configure.in (original)
+++ trunk/libc/configure.in Mon Jul 25 08:36:07 2011
@@ -1524,11 +1524,16 @@
AC_CACHE_CHECK(whether to use .ctors/.dtors header and trailer,
libc_cv_ctors_header, [dnl
libc_cv_ctors_header=yes
- AC_TRY_LINK([], [
+ 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"); }
-],
- [dnl
+EOF
+ if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
+ conftest.c -static -nostartfiles -nostdlib 1>&AS_MESSAGE_LOG_FD])
+ then
AS_IF([$READELF -WS conftest$ac_exeext | $AWK '
{ gsub(/\@<:@ */, "@<:@") }
$2 == ".ctors" || $2 == ".dtors" {
@@ -1543,10 +1548,10 @@
exit ((ctors_ok && dtors_ok) ? 0 : 1)
}
'], [libc_cv_ctors_header=no])
- ], [dnl
+ else
AC_MSG_ERROR([missing __attribute__ ((constructor)) support??])
- ])
- ])
+ fi
+ rm -f conftest*])
if test $libc_cv_ctors_header = no; then
AC_DEFINE(NO_CTORS_DTORS_SECTIONS)
fi