diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index fe0d9a436d0ff7608b207e99a31c2da04f972a43..1f3b255e05c82a6963e24565c52e720610affa13 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -156,6 +156,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], if test "x$TOOLCHAIN_TYPE" = xgcc; then PICFLAG="-fPIC" + PIEFLAG="-fPIE" C_FLAG_REORDER='' CXX_FLAG_REORDER='' @@ -176,6 +177,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then PICFLAG="-KPIC" + PIEFLAG="" C_FLAG_REORDER='-xF' CXX_FLAG_REORDER='-xF' SHARED_LIBRARY_FLAGS="-G" @@ -185,6 +187,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], SET_SHARED_LIBRARY_MAPFILE='-M[$]1' elif test "x$TOOLCHAIN_TYPE" = xxlc; then PICFLAG="-qpic=large" + PIEFLAG="" C_FLAG_REORDER='' CXX_FLAG_REORDER='' SHARED_LIBRARY_FLAGS="-qmkshrobj" @@ -194,6 +197,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], SET_SHARED_LIBRARY_MAPFILE='' elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then PICFLAG="" + PIEFLAG="" C_FLAG_REORDER='' CXX_FLAG_REORDER='' SHARED_LIBRARY_FLAGS="-LD" @@ -658,8 +662,8 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " # Executable flags - CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" + CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK $PIEFLAG" + CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PIEFLAG" AC_SUBST(CFLAGS_JDKLIB) AC_SUBST(CFLAGS_JDKEXE) @@ -742,6 +746,9 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK], if test "x$OPENJDK_TARGET_OS" = xlinux; then LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" fi + if test "x$TOOLCHAIN_TYPE" = xgcc; then + LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie" + fi fi AC_SUBST(LDFLAGS_JDKLIB) AC_SUBST(LDFLAGS_JDKEXE) diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 33690e795094f6b56c51170f8afed54e6ecddd91..a743a5ba9ac63f2254233c98c045f60dddebf8cc 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -4379,7 +4379,7 @@ VS_SDK_PLATFORM_NAME_2017= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1580709484 +DATE_WHEN_GENERATED=1585090811 ############################################################################### # @@ -41236,6 +41236,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } if test "x$TOOLCHAIN_TYPE" = xgcc; then PICFLAG="-fPIC" + PIEFLAG="-fPIE" C_FLAG_REORDER='' CXX_FLAG_REORDER='' @@ -41256,6 +41257,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } fi elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then PICFLAG="-KPIC" + PIEFLAG="" C_FLAG_REORDER='-xF' CXX_FLAG_REORDER='-xF' SHARED_LIBRARY_FLAGS="-G" @@ -41265,6 +41267,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } SET_SHARED_LIBRARY_MAPFILE='-M$1' elif test "x$TOOLCHAIN_TYPE" = xxlc; then PICFLAG="-qpic=large" + PIEFLAG="" C_FLAG_REORDER='' CXX_FLAG_REORDER='' SHARED_LIBRARY_FLAGS="-qmkshrobj" @@ -41274,6 +41277,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } SET_SHARED_LIBRARY_MAPFILE='' elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then PICFLAG="" + PIEFLAG="" C_FLAG_REORDER='' CXX_FLAG_REORDER='' SHARED_LIBRARY_FLAGS="-LD" @@ -42088,8 +42092,8 @@ $as_echo "$supports" >&6; } CXXFLAGS_JDKLIB="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA " # Executable flags - CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK" - CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK" + CFLAGS_JDKEXE="$CCXXFLAGS_JDK $CFLAGS_JDK $PIEFLAG" + CXXFLAGS_JDKEXE="$CCXXFLAGS_JDK $CXXFLAGS_JDK $PIEFLAG" @@ -42172,6 +42176,9 @@ $as_echo "$supports" >&6; } if test "x$OPENJDK_TARGET_OS" = xlinux; then LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined" fi + if test "x$TOOLCHAIN_TYPE" = xgcc; then + LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -pie" + fi fi