From 1a681a434f3f92023b1f7169dcd9c6dbcea2a02b Mon Sep 17 00:00:00 2001 From: Magnus Ihse Bursie Date: Fri, 12 Jun 2020 20:28:07 +0200 Subject: [PATCH] 8200738: Use --hash-style=gnu for gcc Reviewed-by: erikj --- make/autoconf/flags-ldflags.m4 | 11 +---------- make/autoconf/spec.gmk.in | 3 --- make/autoconf/toolchain.m4 | 6 ------ 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4 index a7c0f2fe799..a2a52f98ef7 100644 --- a/make/autoconf/flags-ldflags.m4 +++ b/make/autoconf/flags-ldflags.m4 @@ -62,17 +62,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], [ # Setup basic LDFLAGS if test "x$TOOLCHAIN_TYPE" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - # We have previously set HAS_GNU_HASH if this is the case - if test -n "$HAS_GNU_HASH"; then - BASIC_LDFLAGS="-Wl,--hash-style=both" - LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both" - fi - # Add -z,defs, to forbid undefined symbols in object files. # add -z,relro (mark relocations read only) for all libs # add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only) - BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro -Wl,-z,now" + BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now" # Linux : remove unused code+data in link step if test "x$ENABLE_LINKTIME_GC" = xtrue; then if test "x$OPENJDK_TARGET_CPU" = xs390x; then @@ -152,8 +145,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], # Export some intermediate variables for compatibility LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY" AC_SUBST(LDFLAGS_CXX_JDK) - AC_SUBST(LIBJSIG_HASHSTYLE_LDFLAGS) - AC_SUBST(LIBJSIG_NOEXECSTACK_LDFLAGS) ]) ################################################################################ diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in index 7b7cf98f157..380caeebd88 100644 --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in @@ -489,9 +489,6 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@ CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@ CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@ -LIBJSIG_HASHSTYLE_LDFLAGS := @LIBJSIG_HASHSTYLE_LDFLAGS@ -LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@ - FDLIBM_CFLAGS := @FDLIBM_CFLAGS@ JVM_CFLAGS := @JVM_CFLAGS@ JVM_LDFLAGS := @JVM_LDFLAGS@ diff --git a/make/autoconf/toolchain.m4 b/make/autoconf/toolchain.m4 index a51757cb2ac..c4ad9531be8 100644 --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -972,12 +972,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS], fi fi - if test "x$TOOLCHAIN_TYPE" = xgcc; then - # If this is a --hash-style=gnu system, use --hash-style=both, why? - HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'` - # This is later checked when setting flags. - fi - if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then # Check if linker has -z noexecstack. HAS_NOEXECSTACK=`$CC -Wl,--help 2>/dev/null | $GREP 'z noexecstack'`