common/autoconf/flags.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk9-arm3264 Sdiff common/autoconf

common/autoconf/flags.m4

Print this page




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
































































































  26 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
  27 # corresponding configure arguments instead
  28 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
  29 [
  30   if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
  31     AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
  32   fi
  33 
  34   if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
  35     AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
  36   fi
  37 
  38   if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
  39     AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
  40   fi
  41 
  42   AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
  43       [extra flags to be used when compiling jdk c-files])])
  44 
  45   AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],


 334     # 'performance feature' because of improved code locality of the symbols used in a
 335     # compilation unit.
 336     PICFLAG="-qpic"
 337     JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
 338     C_FLAG_REORDER=''
 339     CXX_FLAG_REORDER=''
 340     SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
 341     SET_EXECUTABLE_ORIGIN=""
 342     SET_SHARED_LIBRARY_ORIGIN=''
 343     SET_SHARED_LIBRARY_NAME=''
 344     SET_SHARED_LIBRARY_MAPFILE=''
 345   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
 346     PICFLAG=""
 347     C_FLAG_REORDER=''
 348     CXX_FLAG_REORDER=''
 349     SHARED_LIBRARY_FLAGS="-dll"
 350     SET_EXECUTABLE_ORIGIN=''
 351     SET_SHARED_LIBRARY_ORIGIN=''
 352     SET_SHARED_LIBRARY_NAME=''
 353     SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'










 354   fi
 355 
 356   AC_SUBST(C_FLAG_REORDER)
 357   AC_SUBST(CXX_FLAG_REORDER)
 358   AC_SUBST(SET_EXECUTABLE_ORIGIN)
 359   AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
 360   AC_SUBST(SET_SHARED_LIBRARY_NAME)
 361   AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
 362   AC_SUBST(SHARED_LIBRARY_FLAGS)
 363 
 364   # The (cross) compiler is now configured, we can now test capabilities
 365   # of the target platform.
 366 ])
 367 
 368 # Documentation on common flags used for solstudio in HIGHEST.
 369 #
 370 # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
 371 #          done with care, there are some assumptions below that need to
 372 #          be understood about the use of pointers, and IEEE behavior.
 373 #




   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 ################################################################################
  27 #
  28 # Setup ABI profile (for arm)
  29 #
  30 AC_DEFUN([SETUP_ABI_PROFILE],
  31 [
  32   AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile],
  33       [specify ABI profile (for arm)])])
  34 
  35   if test "x$with_abi_profile" != x; then
  36     if test "x$OPENJDK_TARGET_CPU" != xarm && \
  37         test "x$OPENJDK_TARGET_CPU" != xaarch64; then
  38       AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64])
  39     fi
  40 
  41     OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile
  42     AC_MSG_CHECKING([for ABI profle])
  43     AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE])
  44 
  45     if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
  46       ARM_FLOAT_TYPE=vfp-sflt
  47       ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
  48     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
  49       ARM_FLOAT_TYPE=vfp-hflt
  50       ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
  51     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
  52       ARM_FLOAT_TYPE=sflt
  53       ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
  54     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
  55       ARM_FLOAT_TYPE=vfp-sflt
  56       ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
  57     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
  58       ARM_FLOAT_TYPE=vfp-hflt
  59       ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
  60     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
  61       # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
  62       ARM_FLOAT_TYPE=
  63       ARM_ARCH_TYPE_FLAGS=
  64     elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
  65       # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
  66       ARM_FLOAT_TYPE=
  67       ARM_ARCH_TYPE_FLAGS=
  68     else
  69       AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"])
  70     fi
  71 
  72     if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
  73       ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
  74     elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
  75       ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
  76     elif test "x$ARM_FLOAT_TYPE" = xsflt; then
  77       ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
  78     fi
  79     AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
  80     AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
  81 
  82     AC_MSG_CHECKING([for arch type flags])
  83     AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
  84 
  85     # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
  86     # autoconf target triplet.
  87     [ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ]
  88     # Sanity check that it is a known ABI.
  89     if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \
  90         test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi  && \
  91         test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then
  92           AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"])
  93     fi
  94     AC_MSG_CHECKING([for ABI property name])
  95     AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME])
  96     AC_SUBST(JDK_ARCH_ABI_PROP_NAME)
  97 
  98     # Pass these on to the open part of configure as if they were set using
  99     # --with-extra-c[xx]flags.
 100     with_extra_cflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_cflags"
 101     with_extra_cxxflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_cxxflags"
 102     # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
 103     # FIXME: This should not really be set using extra_cflags.
 104     if test "x$OPENJDK_TARGET_CPU" = xarm; then
 105         with_extra_cflags="-Wno-psabi $with_extra_cflags"
 106         with_extra_cxxflags="-Wno-psabi $with_extra_cxxflags"
 107     fi
 108     # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS.
 109     with_extra_cflags="-DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"' $with_extra_cflags"
 110     # And pass the architecture flags to the linker as well
 111     with_extra_ldflags="$ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS $with_extra_ldflags"
 112   fi
 113 
 114   # When building with an abi profile, the name of that profile is appended on the
 115   # bundle platform, which is used in bundle names.
 116   if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then
 117     OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE"
 118   fi
 119   AC_SUBST(OPENJDK_TARGET_ABI_PROFILE)
 120 ])
 121 
 122 # Reset the global CFLAGS/LDFLAGS variables and initialize them with the
 123 # corresponding configure arguments instead
 124 AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
 125 [
 126   if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
 127     AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
 128   fi
 129 
 130   if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
 131     AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
 132   fi
 133 
 134   if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
 135     AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
 136   fi
 137 
 138   AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
 139       [extra flags to be used when compiling jdk c-files])])
 140 
 141   AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],


 430     # 'performance feature' because of improved code locality of the symbols used in a
 431     # compilation unit.
 432     PICFLAG="-qpic"
 433     JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
 434     C_FLAG_REORDER=''
 435     CXX_FLAG_REORDER=''
 436     SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry"
 437     SET_EXECUTABLE_ORIGIN=""
 438     SET_SHARED_LIBRARY_ORIGIN=''
 439     SET_SHARED_LIBRARY_NAME=''
 440     SET_SHARED_LIBRARY_MAPFILE=''
 441   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
 442     PICFLAG=""
 443     C_FLAG_REORDER=''
 444     CXX_FLAG_REORDER=''
 445     SHARED_LIBRARY_FLAGS="-dll"
 446     SET_EXECUTABLE_ORIGIN=''
 447     SET_SHARED_LIBRARY_ORIGIN=''
 448     SET_SHARED_LIBRARY_NAME=''
 449     SET_SHARED_LIBRARY_MAPFILE='-def:[$]1'
 450   fi
 451 
 452   # arm specific settings 
 453   if test "x$OPENJDK_TARGET_CPU_ARCH" = "xarm"; then
 454     CXXFLAGS_JDKLIB="$CXXFLAGS_JDKLIB -fsigned-char"
 455     CFLAGS_JDKLIB="$CFLAGS_JDKLIB -fsigned-char"
 456     CXXFLAGS_JDKEXE="$CXXFLAGS_JDKEXE -fsigned-char"
 457     CFLAGS_JDKEXE="$CFLAGS_JDKEXE -fsigned-char"
 458     # '-Wl,-z,origin' isn't used on arm.
 459     SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
 460   fi
 461 
 462   AC_SUBST(C_FLAG_REORDER)
 463   AC_SUBST(CXX_FLAG_REORDER)
 464   AC_SUBST(SET_EXECUTABLE_ORIGIN)
 465   AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
 466   AC_SUBST(SET_SHARED_LIBRARY_NAME)
 467   AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
 468   AC_SUBST(SHARED_LIBRARY_FLAGS)
 469 
 470   # The (cross) compiler is now configured, we can now test capabilities
 471   # of the target platform.
 472 ])
 473 
 474 # Documentation on common flags used for solstudio in HIGHEST.
 475 #
 476 # WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
 477 #          done with care, there are some assumptions below that need to
 478 #          be understood about the use of pointers, and IEEE behavior.
 479 #


common/autoconf/flags.m4
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File