make/autoconf/flags-ldflags.m4
branchihse-cflags-rewrite-branch
changeset 56177 2fbe3b84ee3d
parent 56176 b3e3a12dcb33
child 56182 42c84b4c2918
equal deleted inserted replaced
56176:b3e3a12dcb33 56177:2fbe3b84ee3d
    26 ################################################################################
    26 ################################################################################
    27 #
    27 #
    28 
    28 
    29 AC_DEFUN([FLAGS_SETUP_LDFLAGS],
    29 AC_DEFUN([FLAGS_SETUP_LDFLAGS],
    30 [
    30 [
    31   FLAGS_SETUP_LINKER_FLAGS_FOR_JDK_HELPER
    31   FLAGS_SETUP_LDFLAGS_HELPER
    32 
    32 
    33   # Setup the target toolchain
    33   # Setup the target toolchain
    34 
    34 
    35   # On some platforms (mac) the linker warns about non existing -L dirs.
    35   # On some platforms (mac) the linker warns about non existing -L dirs.
    36   # For any of the variants server, client or minimal, the dir matches the
    36   # For any of the variants server, client or minimal, the dir matches the
    40       || HOTSPOT_CHECK_JVM_VARIANT(minimal); then
    40       || HOTSPOT_CHECK_JVM_VARIANT(minimal); then
    41     TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
    41     TARGET_JVM_VARIANT_PATH=$JVM_VARIANT_MAIN
    42   else
    42   else
    43     TARGET_JVM_VARIANT_PATH=server
    43     TARGET_JVM_VARIANT_PATH=server
    44   fi
    44   fi
    45   FLAGS_SETUP_LINKER_FLAGS_FOR_JDK_CPU_DEP([TARGET])
    45   FLAGS_SETUP_LDFLAGS_CPU_DEP([TARGET])
    46 
    46 
    47   # Setup the build toolchain
    47   # Setup the build toolchain
    48 
    48 
    49   # When building a buildjdk, it's always only the server variant
    49   # When building a buildjdk, it's always only the server variant
    50   BUILD_JVM_VARIANT_PATH=server
    50   BUILD_JVM_VARIANT_PATH=server
    51 
    51 
    52   FLAGS_SETUP_LINKER_FLAGS_FOR_JDK_CPU_DEP([BUILD], [OPENJDK_BUILD_])
    52   FLAGS_SETUP_LDFLAGS_CPU_DEP([BUILD], [OPENJDK_BUILD_])
    53 
    53 
    54   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
    54   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
    55   LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE ${TARGET_LDFLAGS_JDK_LIBPATH}"
    55   LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE ${TARGET_LDFLAGS_JDK_LIBPATH}"
    56   AC_SUBST(LDFLAGS_TESTLIB)
    56   AC_SUBST(LDFLAGS_TESTLIB)
    57   AC_SUBST(LDFLAGS_TESTEXE)
    57   AC_SUBST(LDFLAGS_TESTEXE)
    58 ])
    58 ])
    59 
    59 
    60 ################################################################################
    60 ################################################################################
    61 
    61 
    62 # CPU independent LDFLAGS setup, used for both target and build toolchain.
    62 # CPU independent LDFLAGS setup, used for both target and build toolchain.
    63 AC_DEFUN([FLAGS_SETUP_LINKER_FLAGS_FOR_JDK_HELPER],
    63 AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
    64 [
    64 [
    65   # Setup basic LDFLAGS
    65   # Setup basic LDFLAGS
    66   if test "x$TOOLCHAIN_TYPE" = xgcc; then
    66   if test "x$TOOLCHAIN_TYPE" = xgcc; then
    67     # "-z relro" supported in GNU binutils 2.17 and later
    67     # "-z relro" supported in GNU binutils 2.17 and later
    68     LINKER_RELRO_FLAG="-Wl,-z,relro"
    68     LINKER_RELRO_FLAG="-Wl,-z,relro"
   172 
   172 
   173 ################################################################################
   173 ################################################################################
   174 # $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
   174 # $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
   175 #      conditionals against.
   175 #      conditionals against.
   176 # $2 - Optional prefix for each variable defined.
   176 # $2 - Optional prefix for each variable defined.
   177 AC_DEFUN([FLAGS_SETUP_LINKER_FLAGS_FOR_JDK_CPU_DEP],
   177 AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
   178 [
   178 [
   179   # Setup CPU-dependent basic LDFLAGS. These can differ between the target and
   179   # Setup CPU-dependent basic LDFLAGS. These can differ between the target and
   180   # build toolchain.
   180   # build toolchain.
   181   if test "x$TOOLCHAIN_TYPE" = xgcc; then
   181   if test "x$TOOLCHAIN_TYPE" = xgcc; then
   182     if test "x${OPENJDK_$1_CPU}" = xx86; then
   182     if test "x${OPENJDK_$1_CPU}" = xx86; then