From 7e20cf75f9583f58cd5f9e20675d450666e10526 Mon Sep 17 00:00:00 2001 From: Erik Joelsson Date: Thu, 20 Feb 2020 14:05:38 -0800 Subject: [PATCH] 8238960: linux-i586 builds are inconsistent as the newly build jdk is not able to reserve enough space for object heap Reviewed-by: ihse, tbell, ahgross, jwilhelm --- make/autoconf/flags-ldflags.m4 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/make/autoconf/flags-ldflags.m4 b/make/autoconf/flags-ldflags.m4 index 31eec346990..fc2529d0c26 100644 --- a/make/autoconf/flags-ldflags.m4 +++ b/make/autoconf/flags-ldflags.m4 @@ -151,7 +151,12 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER], # Setup LDFLAGS for linking executables if test "x$TOOLCHAIN_TYPE" = xgcc; then - EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined -pie" + EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -Wl,--allow-shlib-undefined" + # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous + # java heap. + if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then + EXECUTABLE_LDFLAGS="$EXECUTABLE_LDFLAGS -pie" + fi fi if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then