common/autoconf/flags.m4
changeset 36799 982e1880e05e
parent 36051 25fa80338f92
child 36506 17612cee3530
child 36531 ef4e1ca50af8
equal deleted inserted replaced
36798:a00bc4ff7b23 36799:982e1880e05e
   121 
   121 
   122 AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
   122 AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
   123 [
   123 [
   124   # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
   124   # COMPILER_TARGET_BITS_FLAG  : option for selecting 32- or 64-bit output
   125   # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
   125   # COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
       
   126   # COMPILER_BINDCMD_FILE_FLAG : option for specifying a file which saves the binder
       
   127   #                              commands produced by the link step (currently AIX only)
   126   if test "x$TOOLCHAIN_TYPE" = xxlc; then
   128   if test "x$TOOLCHAIN_TYPE" = xxlc; then
   127     COMPILER_TARGET_BITS_FLAG="-q"
   129     COMPILER_TARGET_BITS_FLAG="-q"
   128     COMPILER_COMMAND_FILE_FLAG="-f"
   130     COMPILER_COMMAND_FILE_FLAG="-f"
       
   131     COMPILER_BINDCMD_FILE_FLAG="-bloadmap:"
   129   else
   132   else
   130     COMPILER_TARGET_BITS_FLAG="-m"
   133     COMPILER_TARGET_BITS_FLAG="-m"
   131     COMPILER_COMMAND_FILE_FLAG="@"
   134     COMPILER_COMMAND_FILE_FLAG="@"
       
   135     COMPILER_BINDCMD_FILE_FLAG=""
   132 
   136 
   133     # The solstudio linker does not support @-files.
   137     # The solstudio linker does not support @-files.
   134     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
   138     if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
   135       COMPILER_COMMAND_FILE_FLAG=
   139       COMPILER_COMMAND_FILE_FLAG=
   136     fi
   140     fi
   150       rm -rf command.file
   154       rm -rf command.file
   151     fi
   155     fi
   152   fi
   156   fi
   153   AC_SUBST(COMPILER_TARGET_BITS_FLAG)
   157   AC_SUBST(COMPILER_TARGET_BITS_FLAG)
   154   AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
   158   AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
       
   159   AC_SUBST(COMPILER_BINDCMD_FILE_FLAG)
   155 
   160 
   156   # FIXME: figure out if we should select AR flags depending on OS or toolchain.
   161   # FIXME: figure out if we should select AR flags depending on OS or toolchain.
   157   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   162   if test "x$OPENJDK_TARGET_OS" = xmacosx; then
   158     ARFLAGS="-r"
   163     ARFLAGS="-r"
   159   elif test "x$OPENJDK_TARGET_OS" = xaix; then
   164   elif test "x$OPENJDK_TARGET_OS" = xaix; then
   292     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN[$]1'
   297     SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN[$]1'
   293     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
   298     SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
   294     SET_SHARED_LIBRARY_NAME='-h [$]1'
   299     SET_SHARED_LIBRARY_NAME='-h [$]1'
   295     SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
   300     SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
   296   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   301   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   297     PICFLAG="-qpic=large"
   302     # '-qpic' defaults to 'qpic=small'. This means that the compiler generates only
       
   303     # one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker
       
   304     # will have to patch this single instruction with a call to some out-of-order code which
       
   305     # does the load from the TOC. This is of course slow. But in that case we also would have
       
   306     # to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'.
       
   307     # With 'qpic=large' the compiler will by default generate a two-instruction sequence which
       
   308     # can be patched directly by the linker and does not require a jump to out-of-order code.
       
   309     # Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc'
       
   310     # instead. This creates a distinct TOC for every compilation unit (and thus requires two
       
   311     # loads for accessing a global variable). But there are rumors that this may be seen as a
       
   312     # 'performance feature' because of improved code locality of the symbols used in a
       
   313     # compilation unit.
       
   314     PICFLAG="-qpic"
       
   315     JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
   298     C_FLAG_REORDER=''
   316     C_FLAG_REORDER=''
   299     CXX_FLAG_REORDER=''
   317     CXX_FLAG_REORDER=''
   300     SHARED_LIBRARY_FLAGS="-qmkshrobj"
   318     SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
   301     SET_EXECUTABLE_ORIGIN=""
   319     SET_EXECUTABLE_ORIGIN=""
   302     SET_SHARED_LIBRARY_ORIGIN=''
   320     SET_SHARED_LIBRARY_ORIGIN=''
   303     SET_SHARED_LIBRARY_NAME=''
   321     SET_SHARED_LIBRARY_NAME=''
   304     SET_SHARED_LIBRARY_MAPFILE=''
   322     SET_SHARED_LIBRARY_MAPFILE=''
   305   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
   323   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
   833     LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
   851     LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
   834     LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
   852     LDFLAGS_JDK="$LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -xildoff -ztext"
   835     LDFLAGS_CXX_SOLSTUDIO="-norunpath"
   853     LDFLAGS_CXX_SOLSTUDIO="-norunpath"
   836     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
   854     LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
   837   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   855   elif test "x$TOOLCHAIN_TYPE" = xxlc; then
   838     LDFLAGS_XLC="-brtl -bnolibpath -bexpall -bernotok"
   856     LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok"
   839     LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC"
   857     LDFLAGS_JDK="${LDFLAGS_JDK} $LDFLAGS_XLC"
   840   fi
   858   fi
   841 
   859 
   842   # Customize LDFLAGS for executables
   860   # Customize LDFLAGS for executables
   843 
   861 
   889   AC_SUBST(LDFLAGS_JDKLIB)
   907   AC_SUBST(LDFLAGS_JDKLIB)
   890   AC_SUBST(LDFLAGS_JDKEXE)
   908   AC_SUBST(LDFLAGS_JDKEXE)
   891   AC_SUBST(JDKLIB_LIBS)
   909   AC_SUBST(JDKLIB_LIBS)
   892   AC_SUBST(JDKEXE_LIBS)
   910   AC_SUBST(JDKEXE_LIBS)
   893   AC_SUBST(LDFLAGS_CXX_JDK)
   911   AC_SUBST(LDFLAGS_CXX_JDK)
       
   912   AC_SUBST(LDFLAGS_HASH_STYLE)
   894 
   913 
   895   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
   914   LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
   896   LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
   915   LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE"
   897 
   916 
   898   AC_SUBST(LDFLAGS_TESTLIB)
   917   AC_SUBST(LDFLAGS_TESTLIB)