--- a/make/autoconf/flags-ldflags.m4~ Mon Apr 13 13:55:05 2020 +++ b/make/autoconf/flags-ldflags.m4 Mon Apr 13 14:10:29 2020 @@ -47,10 +47,14 @@ # Setup basic LDFLAGS if test "x$TOOLCHAIN_TYPE" = xgcc; then # 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) - # 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 -Wl,--exclude-libs,ALL" + if test "x$OPENJDK_TARGET_OS" = xsolaris; then + BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs" + else + # 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 --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 -Wl,--exclude-libs,ALL" + fi # Linux : remove unused code+data in link step if test "x$ENABLE_LINKTIME_GC" = xtrue; then if test "x$OPENJDK_TARGET_CPU" = xs390x; then