changeset 59769:09c54ee458aa

8200738: Use --hash-style=gnu for gcc Reviewed-by: erikj
author ihse
date Fri, 12 Jun 2020 20:28:07 +0200
parents 791714b2315e
children 62b2b2dd04d4
files make/autoconf/flags-ldflags.m4 make/autoconf/spec.gmk.in make/autoconf/toolchain.m4
diffstat 3 files changed, 1 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/make/autoconf/flags-ldflags.m4	Fri Jun 12 16:48:27 2020 +0000
+++ b/make/autoconf/flags-ldflags.m4	Fri Jun 12 20:28:07 2020 +0200
@@ -62,17 +62,10 @@
 [
   # 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 @@
   # 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)
 ])
 
 ################################################################################
--- a/make/autoconf/spec.gmk.in	Fri Jun 12 16:48:27 2020 +0000
+++ b/make/autoconf/spec.gmk.in	Fri Jun 12 20:28:07 2020 +0200
@@ -489,9 +489,6 @@
 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@
--- a/make/autoconf/toolchain.m4	Fri Jun 12 16:48:27 2020 +0000
+++ b/make/autoconf/toolchain.m4	Fri Jun 12 20:28:07 2020 +0200
@@ -972,12 +972,6 @@
     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'`