summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2012-03-08 00:17:27 +0000
committerJoseph Myers <joseph@codesourcery.com>2012-03-08 00:17:27 +0000
commit07037eeb43ca1e0ac2802e3a1492cecf869c63c6 (patch)
tree83e74c69cd8497be987abe3e2e058fb3a62cb278 /aclocal.m4
parentaf6a1e37554a1245d468ffe44d2c981998a4e0eb (diff)
downloadglibc-07037eeb43ca1e0ac2802e3a1492cecf869c63c6.tar.gz
Fix .ctors/.dtors header configure test for bootstrapping.
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m414
1 files changed, 14 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index dafa97244d..02ff9bc359 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -113,3 +113,17 @@ AC_CACHE_CHECK(whether $LD is GNU ld, libc_cv_prog_ld_gnu,
[LIBC_PROG_FOO_GNU($LD, libc_cv_prog_ld_gnu=yes, libc_cv_prog_ld_gnu=no)])
gnu_ld=$libc_cv_prog_ld_gnu
])
+
+dnl Run a static link test with -nostdlib -nostartfiles.
+dnl LIBC_TRY_LINK_STATIC([code], [action-if-true], [action-if-false])
+AC_DEFUN([LIBC_TRY_LINK_STATIC],
+[cat > conftest.c <<EOF
+int _start (void) { return 0; }
+int __start (void) { return 0; }
+$1
+EOF
+AS_IF([AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS -o conftest
+ conftest.c -static -nostartfiles -nostdlib
+ 1>&AS_MESSAGE_LOG_FD])],
+ [$2], [$3])
+rm -f conftest*])