From 9ffc530e0d34086e68c87306ca0410e5847812d6 Mon Sep 17 00:00:00 2001
Date: Wed, 21 Sep 2022 09:53:14 +0800
Subject: revert fPIC and security compilation flag on

---
 common/autoconf/flags.m4               | 6 +-----
 common/autoconf/generated-configure.sh | 6 +-----
 hotspot/make/pic.make                  | 2 +-
 3 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4
index 69bea78d..71703a15 100644
--- a/common/autoconf/flags.m4
+++ b/common/autoconf/flags.m4
@@ -807,11 +807,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
     fi
     if test "x$TOOLCHAIN_TYPE" = xgcc; then
-      # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
-      # java heap.
-      if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
-        LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
-      fi
+      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
     fi
   fi
   AC_SUBST(LDFLAGS_JDKLIB)
diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index f0e49f50..53e6cf18 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -43068,11 +43068,7 @@ $as_echo "$supports" >&6; }
       LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
     fi
     if test "x$TOOLCHAIN_TYPE" = xgcc; then
-      # Enabling pie on 32 bit builds prevents the JVM from allocating a continuous
-      # java heap.
-      if test "x$OPENJDK_TARGET_CPU_BITS" != "x32"; then
-        LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
-      fi
+      LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie"
     fi
   fi
 
diff --git a/hotspot/make/pic.make b/hotspot/make/pic.make
index 0e61ad93..3d85546c 100644
--- a/hotspot/make/pic.make
+++ b/hotspot/make/pic.make
@@ -30,7 +30,7 @@ include $(GAMMADIR)/make/scm.make
 
 ifneq ($(OSNAME), windows)
   ifndef LP64
-    PARTIAL_NONPIC=1
+    PARTIAL_NONPIC=0
   endif
   PIC_ARCH = ppc arm
   ifneq ("$(filter $(PIC_ARCH),$(BUILDARCH))","")
-- 
2.22.0

