Skip to content

Commit 1a681a4

Browse files
committedJun 12, 2020
8200738: Use --hash-style=gnu for gcc
Reviewed-by: erikj
1 parent 0e4829e commit 1a681a4

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed
 

‎make/autoconf/flags-ldflags.m4

+1-10
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,10 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
6262
[
6363
# Setup basic LDFLAGS
6464
if test "x$TOOLCHAIN_TYPE" = xgcc; then
65-
# If this is a --hash-style=gnu system, use --hash-style=both, why?
66-
# We have previously set HAS_GNU_HASH if this is the case
67-
if test -n "$HAS_GNU_HASH"; then
68-
BASIC_LDFLAGS="-Wl,--hash-style=both"
69-
LIBJSIG_HASHSTYLE_LDFLAGS="-Wl,--hash-style=both"
70-
fi
71-
7265
# Add -z,defs, to forbid undefined symbols in object files.
7366
# add -z,relro (mark relocations read only) for all libs
7467
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
75-
BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
68+
BASIC_LDFLAGS="-Wl,--hash-style=gnu -Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
7669
# Linux : remove unused code+data in link step
7770
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
7871
if test "x$OPENJDK_TARGET_CPU" = xs390x; then
@@ -152,8 +145,6 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
152145
# Export some intermediate variables for compatibility
153146
LDFLAGS_CXX_JDK="$BASIC_LDFLAGS_ONLYCXX $BASIC_LDFLAGS_ONLYCXX_JDK_ONLY $DEBUGLEVEL_LDFLAGS_JDK_ONLY"
154147
AC_SUBST(LDFLAGS_CXX_JDK)
155-
AC_SUBST(LIBJSIG_HASHSTYLE_LDFLAGS)
156-
AC_SUBST(LIBJSIG_NOEXECSTACK_LDFLAGS)
157148
])
158149

159150
################################################################################

‎make/autoconf/spec.gmk.in

-3
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,6 @@ CXXFLAGS_JDKLIB:=@CXXFLAGS_JDKLIB@
489489
CFLAGS_JDKEXE:=@CFLAGS_JDKEXE@
490490
CXXFLAGS_JDKEXE:=@CXXFLAGS_JDKEXE@
491491

492-
LIBJSIG_HASHSTYLE_LDFLAGS := @LIBJSIG_HASHSTYLE_LDFLAGS@
493-
LIBJSIG_NOEXECSTACK_LDFLAGS := @LIBJSIG_NOEXECSTACK_LDFLAGS@
494-
495492
FDLIBM_CFLAGS := @FDLIBM_CFLAGS@
496493
JVM_CFLAGS := @JVM_CFLAGS@
497494
JVM_LDFLAGS := @JVM_LDFLAGS@

‎make/autoconf/toolchain.m4

-6
Original file line numberDiff line numberDiff line change
@@ -972,12 +972,6 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
972972
fi
973973
fi
974974
975-
if test "x$TOOLCHAIN_TYPE" = xgcc; then
976-
# If this is a --hash-style=gnu system, use --hash-style=both, why?
977-
HAS_GNU_HASH=`$CC -dumpspecs 2>/dev/null | $GREP 'hash-style=gnu'`
978-
# This is later checked when setting flags.
979-
fi
980-
981975
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
982976
# Check if linker has -z noexecstack.
983977
HAS_NOEXECSTACK=`$CC -Wl,--help 2>/dev/null | $GREP 'z noexecstack'`

0 commit comments

Comments
 (0)
Please sign in to comment.