8314554: Debian/Ubuntu should not link OpenJDK with --as-needed link option

Reviewed-by: erikj
This commit is contained in:
Vladimir Petko 2023-08-24 12:27:52 +00:00 committed by Erik Joelsson
parent 97b94cb1cd
commit e36620d80e

View File

@ -60,7 +60,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Add -z,defs, to forbid undefined symbols in object files. # Add -z,defs, to forbid undefined symbols in object files.
# add -z,relro (mark relocations read only) for all libs # 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) # add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now" # add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed"
# Linux : remove unused code+data in link step # Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then if test "x$OPENJDK_TARGET_CPU" = xs390x; then