Skip to content

Commit e36620d

Browse files
Vladimir Petkoerikj79
Vladimir Petko
authored andcommitted
8314554: Debian/Ubuntu should not link OpenJDK with --as-needed link option
Reviewed-by: erikj
1 parent 97b94cb commit e36620d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

make/autoconf/flags-ldflags.m4

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
6060
# Add -z,defs, to forbid undefined symbols in object files.
6161
# add -z,relro (mark relocations read only) for all libs
6262
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
63-
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
63+
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
64+
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed"
6465
# Linux : remove unused code+data in link step
6566
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
6667
if test "x$OPENJDK_TARGET_CPU" = xs390x; then

0 commit comments

Comments
 (0)