From 0fc844f8a771cddcad68c9e58b59e065db032cd3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 21 Nov 2012 07:50:58 -0800 Subject: Check if -z global works --- config.make.in | 1 + configure | 29 +++++++++++++++++++++++++++++ configure.in | 17 +++++++++++++++++ elf/Makefile | 5 ++++- 4 files changed, 51 insertions(+), 1 deletion(-) diff --git a/config.make.in b/config.make.in index 7f1bbb51d5..b282f1cef2 100644 --- a/config.make.in +++ b/config.make.in @@ -51,6 +51,7 @@ all-warnings = @all_warnings@ have-z-combreloc = @libc_cv_z_combreloc@ have-z-execstack = @libc_cv_z_execstack@ +have-z-global = @libc_cv_z_global@ have-Bgroup = @libc_cv_Bgroup@ with-fp = @with_fp@ old-glibc-headers = @old_glibc_headers@ diff --git a/configure b/configure index ff2d34ca9c..4b23722b56 100755 --- a/configure +++ b/configure @@ -613,6 +613,7 @@ fno_unit_at_a_time libc_cv_output_format libc_cv_hashstyle libc_cv_fpie +libc_cv_z_global libc_cv_z_execstack libc_cv_z_combreloc ASFLAGS_config @@ -6559,6 +6560,34 @@ fi $as_echo "$libc_linker_feature" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z global" >&5 +$as_echo_n "checking for -z global... " >&6; } +if ${libc_cv_z_global+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then + libc_cv_z_global=yes +else + libc_cv_z_global=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_global" >&5 +$as_echo "$libc_cv_z_global" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fpie" >&5 $as_echo_n "checking for -fpie... " >&6; } if ${libc_cv_fpie+:} false; then : diff --git a/configure.in b/configure.in index a7f7198818..2ec07b1e43 100644 --- a/configure.in +++ b/configure.in @@ -1561,6 +1561,23 @@ LIBC_LINKER_FEATURE([-z execstack], [-Wl,-z,execstack], [libc_cv_z_execstack=yes], [libc_cv_z_execstack=no]) AC_SUBST(libc_cv_z_execstack) +AC_CACHE_CHECK(for -z global, + libc_cv_z_global, [dnl +cat > conftest.c <&AS_MESSAGE_LOG_FD]) +then + libc_cv_z_global=yes +else + libc_cv_z_global=no +fi +rm -f conftest*]) +AC_SUBST(libc_cv_z_global) + AC_CACHE_CHECK(for -fpie, libc_cv_fpie, [dnl LIBC_TRY_CC_OPTION([-fpie], [libc_cv_fpie=yes], [libc_cv_fpie=no]) ]) diff --git a/elf/Makefile b/elf/Makefile index a70b836d57..fa7b6c3e6a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -145,8 +145,11 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ tst-audit1 tst-audit2 tst-audit8 \ tst-stackguard1 tst-addr1 tst-thrlock \ tst-unique1 tst-unique2 tst-unique3 tst-unique4 \ - tst-initorder tst-initorder2 tst-relsort1 reldep10 + tst-initorder tst-initorder2 tst-relsort1 # reldep9 +ifeq (yes,$(have-z-global)) +tests += reldep10 +endif test-srcs = tst-pathopt selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) ifneq ($(selinux-enabled),1) -- cgit 1.4.1