make/autoconf/flags.m4
author ihse
Wed, 14 Feb 2018 14:03:10 +0100
branchihse-cflags-rewrite-branch
changeset 56124 b2b9dfdc39c8
parent 48854 345f41527dcc
child 56125 4e2422994c9e
permissions -rw-r--r--
Start breaking out stuff from flags.m4.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     1
#
48767
0c6ce8fdb50a 8080990: libdt_socket/socket_md.c(202) : warning C4996: 'gethostbyname': Use getaddrinfo() or GetAddrInfoW()
gadams
parents: 48751
diff changeset
     2
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     4
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    10
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    15
# accompanied this code).
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    16
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    20
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    23
# questions.
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    24
#
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
    25
42538
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    26
################################################################################
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    27
#
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    28
# Setup ABI profile (for arm)
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    29
#
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    30
AC_DEFUN([FLAGS_SETUP_ABI_PROFILE],
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    31
[
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    32
  AC_ARG_WITH(abi-profile, [AS_HELP_STRING([--with-abi-profile],
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    33
      [specify ABI profile for ARM builds (arm-vfp-sflt,arm-vfp-hflt,arm-sflt, armv5-vfp-sflt,armv6-vfp-hflt,arm64,aarch64) @<:@toolchain dependent@:>@ ])])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    34
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    35
  if test "x$with_abi_profile" != x; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    36
    if test "x$OPENJDK_TARGET_CPU" != xarm && \
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    37
        test "x$OPENJDK_TARGET_CPU" != xaarch64; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    38
      AC_MSG_ERROR([--with-abi-profile only available on arm/aarch64])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    39
    fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    40
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    41
    OPENJDK_TARGET_ABI_PROFILE=$with_abi_profile
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    42
    AC_MSG_CHECKING([for ABI profle])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    43
    AC_MSG_RESULT([$OPENJDK_TARGET_ABI_PROFILE])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    44
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    45
    if test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-sflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    46
      ARM_FLOAT_TYPE=vfp-sflt
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    47
      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    48
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-vfp-hflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    49
      ARM_FLOAT_TYPE=vfp-hflt
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    50
      ARM_ARCH_TYPE_FLAGS='-march=armv7-a -mthumb'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    51
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm-sflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    52
      ARM_FLOAT_TYPE=sflt
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    53
      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    54
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv5-vfp-sflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    55
      ARM_FLOAT_TYPE=vfp-sflt
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    56
      ARM_ARCH_TYPE_FLAGS='-march=armv5t -marm'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    57
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarmv6-vfp-hflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    58
      ARM_FLOAT_TYPE=vfp-hflt
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    59
      ARM_ARCH_TYPE_FLAGS='-march=armv6 -marm'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    60
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xarm64; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    61
      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    62
      ARM_FLOAT_TYPE=
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    63
      ARM_ARCH_TYPE_FLAGS=
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    64
    elif test "x$OPENJDK_TARGET_ABI_PROFILE" = xaarch64; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    65
      # No special flags, just need to trigger setting JDK_ARCH_ABI_PROP_NAME
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    66
      ARM_FLOAT_TYPE=
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    67
      ARM_ARCH_TYPE_FLAGS=
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    68
    else
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    69
      AC_MSG_ERROR([Invalid ABI profile: "$OPENJDK_TARGET_ABI_PROFILE"])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    70
    fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    71
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    72
    if test "x$ARM_FLOAT_TYPE" = xvfp-sflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    73
      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=softfp -mfpu=vfp -DFLOAT_ARCH=-vfp-sflt'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    74
    elif test "x$ARM_FLOAT_TYPE" = xvfp-hflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    75
      ARM_FLOAT_TYPE_FLAGS='-mfloat-abi=hard -mfpu=vfp -DFLOAT_ARCH=-vfp-hflt'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    76
    elif test "x$ARM_FLOAT_TYPE" = xsflt; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    77
      ARM_FLOAT_TYPE_FLAGS='-msoft-float -mfpu=vfp'
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    78
    fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    79
    AC_MSG_CHECKING([for $ARM_FLOAT_TYPE floating point flags])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    80
    AC_MSG_RESULT([$ARM_FLOAT_TYPE_FLAGS])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    81
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    82
    AC_MSG_CHECKING([for arch type flags])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    83
    AC_MSG_RESULT([$ARM_ARCH_TYPE_FLAGS])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    84
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    85
    # Now set JDK_ARCH_ABI_PROP_NAME. This is equivalent to the last part of the
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    86
    # autoconf target triplet.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    87
    [ JDK_ARCH_ABI_PROP_NAME=`$ECHO $OPENJDK_TARGET_AUTOCONF_NAME | $SED -e 's/.*-\([^-]*\)$/\1/'` ]
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    88
    # Sanity check that it is a known ABI.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    89
    if test "x$JDK_ARCH_ABI_PROP_NAME" != xgnu && \
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    90
        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabi  && \
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    91
        test "x$JDK_ARCH_ABI_PROP_NAME" != xgnueabihf; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    92
          AC_MSG_WARN([Unknown autoconf target triplet ABI: "$JDK_ARCH_ABI_PROP_NAME"])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    93
    fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    94
    AC_MSG_CHECKING([for ABI property name])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    95
    AC_MSG_RESULT([$JDK_ARCH_ABI_PROP_NAME])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    96
    AC_SUBST(JDK_ARCH_ABI_PROP_NAME)
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    97
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    98
    # Pass these on to the open part of configure as if they were set using
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
    99
    # --with-extra-c[xx]flags.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   100
    EXTRA_CFLAGS="$EXTRA_CFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   101
    EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   102
    # Get rid of annoying "note: the mangling of 'va_list' has changed in GCC 4.4"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   103
    # FIXME: This should not really be set using extra_cflags.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   104
    if test "x$OPENJDK_TARGET_CPU" = xarm; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   105
        EXTRA_CFLAGS="$EXTRA_CFLAGS -Wno-psabi"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   106
        EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -Wno-psabi"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   107
    fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   108
    # Also add JDK_ARCH_ABI_PROP_NAME define, but only to CFLAGS.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   109
    EXTRA_CFLAGS="$EXTRA_CFLAGS -DJDK_ARCH_ABI_PROP_NAME='\"\$(JDK_ARCH_ABI_PROP_NAME)\"'"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   110
    # And pass the architecture flags to the linker as well
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   111
    EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARM_ARCH_TYPE_FLAGS $ARM_FLOAT_TYPE_FLAGS"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   112
  fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   113
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   114
  # When building with an abi profile, the name of that profile is appended on the
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   115
  # bundle platform, which is used in bundle names.
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   116
  if test "x$OPENJDK_TARGET_ABI_PROFILE" != x; then
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   117
    OPENJDK_TARGET_BUNDLE_PLATFORM="$OPENJDK_TARGET_OS_BUNDLE-$OPENJDK_TARGET_ABI_PROFILE"
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   118
  fi
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   119
])
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   120
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   121
# Reset the global CFLAGS/LDFLAGS variables and initialize them with the
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   122
# corresponding configure arguments instead
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   123
AC_DEFUN_ONCE([FLAGS_SETUP_USER_SUPPLIED_FLAGS],
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   124
[
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   125
  if test "x$CFLAGS" != "x${ADDED_CFLAGS}"; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   126
    AC_MSG_WARN([Ignoring CFLAGS($CFLAGS) found in environment. Use --with-extra-cflags])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   127
  fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   128
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   129
  if test "x$CXXFLAGS" != "x${ADDED_CXXFLAGS}"; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   130
    AC_MSG_WARN([Ignoring CXXFLAGS($CXXFLAGS) found in environment. Use --with-extra-cxxflags])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   131
  fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   132
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   133
  if test "x$LDFLAGS" != "x${ADDED_LDFLAGS}"; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   134
    AC_MSG_WARN([Ignoring LDFLAGS($LDFLAGS) found in environment. Use --with-extra-ldflags])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   135
  fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   136
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   137
  AC_ARG_WITH(extra-cflags, [AS_HELP_STRING([--with-extra-cflags],
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   138
      [extra flags to be used when compiling jdk c-files])])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   139
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   140
  AC_ARG_WITH(extra-cxxflags, [AS_HELP_STRING([--with-extra-cxxflags],
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   141
      [extra flags to be used when compiling jdk c++-files])])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   142
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   143
  AC_ARG_WITH(extra-ldflags, [AS_HELP_STRING([--with-extra-ldflags],
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   144
      [extra flags to be used when linking jdk])])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   145
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   146
  EXTRA_CFLAGS="$with_extra_cflags"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   147
  EXTRA_CXXFLAGS="$with_extra_cxxflags"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   148
  EXTRA_LDFLAGS="$with_extra_ldflags"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   149
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   150
  AC_SUBST(EXTRA_CFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   151
  AC_SUBST(EXTRA_CXXFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   152
  AC_SUBST(EXTRA_LDFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   153
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   154
  # The global CFLAGS and LDLAGS variables are used by configure tests and
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   155
  # should include the extra parameters
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   156
  CFLAGS="$EXTRA_CFLAGS"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   157
  CXXFLAGS="$EXTRA_CXXFLAGS"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   158
  LDFLAGS="$EXTRA_LDFLAGS"
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   159
  CPPFLAGS=""
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   160
])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   161
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   162
# Setup the sysroot flags and add them to global CFLAGS and LDFLAGS so
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   163
# that configure can use them while detecting compilers.
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   164
# TOOLCHAIN_TYPE is available here.
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   165
# Param 1 - Optional prefix to all variables. (e.g BUILD_)
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   166
AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   167
[
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   168
  if test "x[$]$1SYSROOT" != "x"; then
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   169
    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   170
      if test "x$OPENJDK_TARGET_OS" = xsolaris; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   171
        # Solaris Studio does not have a concept of sysroot. Instead we must
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   172
        # make sure the default include and lib dirs are appended to each
35450
0124e2c9ef64 8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents: 35444
diff changeset
   173
        # compile and link command line. Must also add -I-xbuiltin to enable
0124e2c9ef64 8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents: 35444
diff changeset
   174
        # inlining of system functions and intrinsics.
0124e2c9ef64 8148929: Suboptimal code generated when setting sysroot include with Solaris Studio
erikj
parents: 35444
diff changeset
   175
        $1SYSROOT_CFLAGS="-I-xbuiltin -I[$]$1SYSROOT/usr/include"
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   176
        $1SYSROOT_LDFLAGS="-L[$]$1SYSROOT/usr/lib$OPENJDK_TARGET_CPU_ISADIR \
41040
7b919a4497ff 8165161: Solaris: /usr/ccs /opt/sfw and /opt/csw are dead, references should be expunged
alanbur
parents: 39940
diff changeset
   177
            -L[$]$1SYSROOT/lib$OPENJDK_TARGET_CPU_ISADIR"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   178
      fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   179
    elif test "x$TOOLCHAIN_TYPE" = xgcc; then
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   180
      $1SYSROOT_CFLAGS="--sysroot=[$]$1SYSROOT"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   181
      $1SYSROOT_LDFLAGS="--sysroot=[$]$1SYSROOT"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   182
    elif test "x$TOOLCHAIN_TYPE" = xclang; then
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   183
      $1SYSROOT_CFLAGS="-isysroot [$]$1SYSROOT"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   184
      $1SYSROOT_LDFLAGS="-isysroot [$]$1SYSROOT"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   185
    fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   186
    # The global CFLAGS and LDFLAGS variables need these for configure to function
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   187
    $1CFLAGS="[$]$1CFLAGS [$]$1SYSROOT_CFLAGS"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   188
    $1CPPFLAGS="[$]$1CPPFLAGS [$]$1SYSROOT_CFLAGS"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   189
    $1CXXFLAGS="[$]$1CXXFLAGS [$]$1SYSROOT_CFLAGS"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   190
    $1LDFLAGS="[$]$1LDFLAGS [$]$1SYSROOT_LDFLAGS"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   191
  fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   192
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   193
  if test "x$OPENJDK_TARGET_OS" = xmacosx; then
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   194
    # We also need -iframework<path>/System/Library/Frameworks
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   195
    $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   196
    $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -iframework [$]$1SYSROOT/System/Library/Frameworks"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   197
    # These always need to be set, or we can't find the frameworks embedded in JavaVM.framework
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   198
    # set this here so it doesn't have to be peppered throughout the forest
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   199
    $1SYSROOT_CFLAGS="[$]$1SYSROOT_CFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   200
    $1SYSROOT_LDFLAGS="[$]$1SYSROOT_LDFLAGS -F [$]$1SYSROOT/System/Library/Frameworks/JavaVM.framework/Frameworks"
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   201
  fi
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   202
33395
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   203
  AC_SUBST($1SYSROOT_CFLAGS)
5907d5b1287c 8140593: Add configure parameter for devkit for the build compiler
erikj
parents: 33394
diff changeset
   204
  AC_SUBST($1SYSROOT_LDFLAGS)
32810
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   205
])
8203e52cd373 8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents: 30856
diff changeset
   206
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   207
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   208
[
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   209
  FLAGS_SETUP_TOOLCHAIN_CONTROL
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   210
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   211
  FLAGS_SETUP_ARFLAGS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   212
  FLAGS_SETUP_STRIPFLAGS
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   213
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   214
  FLAGS_SETUP_RCFLAGS
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   215
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   216
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   217
    # silence copyright notice and other headers.
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   218
    COMMON_CCXXFLAGS="$COMMON_CCXXFLAGS -nologo"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   219
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   220
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   221
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   222
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   223
[
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   224
  FLAGS_SETUP_SHARED_LIBS
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   225
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   226
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
14111
2a82ecb35fc7 8000992: Update new build-infra makefiles
ohair
parents: 13697
diff changeset
   227
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   228
      if test "x$STATIC_BUILD" = xfalse; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   229
        JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
33562
c76b2fa11486 8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents: 32813
diff changeset
   230
      fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   231
    fi
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   232
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   233
    if test "x$OPENJDK_TARGET_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   234
      if test "x$STATIC_BUILD" = xfalse; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   235
        JVM_CFLAGS="$JVM_CFLAGS -fPIC"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   236
      fi
23161
85635b5bf0a6 8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents: 22730
diff changeset
   237
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   238
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
36051
25fa80338f92 8150197: Integrate AIX fixes from build-infra
simonis
parents: 36050
diff changeset
   239
    JVM_CFLAGS="$JVM_CFLAGS $PICFLAG"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   240
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   241
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   242
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   243
  # The (cross) compiler is now configured, we can now test capabilities
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   244
  # of the target platform.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   245
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   246
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   247
# Documentation on common flags used for solstudio in HIGHEST.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   248
#
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   249
# WARNING: Use of OPTIMIZATION_LEVEL=HIGHEST in your Makefile needs to be
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   250
#          done with care, there are some assumptions below that need to
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   251
#          be understood about the use of pointers, and IEEE behavior.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   252
#
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   253
# -fns: Use non-standard floating point mode (not IEEE 754)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   254
# -fsimple: Do some simplification of floating point arithmetic (not IEEE 754)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   255
# -fsingle: Use single precision floating point with 'float'
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   256
# -xalias_level=basic: Assume memory references via basic pointer types do not alias
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   257
#   (Source with excessing pointer casting and data access with mixed
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   258
#    pointer types are not recommended)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   259
# -xbuiltin=%all: Use intrinsic or inline versions for math/std functions
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   260
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   261
# -xdepend: Loop data dependency optimizations (need -xO3 or higher)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   262
# -xrestrict: Pointer parameters to functions do not overlap
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   263
#   (Similar to -xalias_level=basic usage, but less obvious sometimes.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   264
#    If you pass in multiple pointers to the same data, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   265
# -xlibmil: Inline some library routines
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   266
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   267
# -xlibmopt: Use optimized math routines (CURRENTLY DISABLED)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   268
#   (If you expect perfect errno behavior, do not use this)
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   269
#  Can cause undefined external on Solaris 8 X86 on __sincos, removing for now
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   270
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   271
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_OPTIMIZATION],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   272
[
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   273
  FLAGS_SETUP_DEBUG_SYMBOLS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   274
  FLAGS_SETUP_QUALITY_CHECKS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   275
  FLAGS_SETUP_OPTIMIZATION
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   276
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   277
  # Debug symbols for JVM_CFLAGS
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   278
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   279
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -xs"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   280
    if test "x$DEBUG_LEVEL" = xslowdebug; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   281
      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   282
    else
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   283
      # -g0 does not disable inlining, which -g does.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   284
      JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g0"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   285
    fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   286
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   287
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -Z7 -d2Zi+"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   288
  else
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   289
    JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS -g"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   290
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   291
  AC_SUBST(JVM_CFLAGS_SYMBOLS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   292
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   293
  # bounds, memory and behavior checking options
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   294
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   295
    case $DEBUG_LEVEL in
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   296
    slowdebug )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   297
      # FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   298
      # get's added conditionally on whether we produce debug symbols or not.
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   299
      # This is most likely not really correct.
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   300
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   301
      if test "x$STACK_PROTECTOR_CFLAG" != x; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   302
        JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   303
      fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   304
      ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   305
    esac
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   306
  fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   307
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   308
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   309
    if test "x$DEBUG_LEVEL" != xrelease; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   310
      if test "x$OPENJDK_TARGET_CPU" = xx86_64; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   311
        JVM_CFLAGS="$JVM_CFLAGS -homeparams"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   312
      fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   313
    fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   314
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   315
])
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   316
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   317
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   318
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   319
[
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   320
42538
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   321
  FLAGS_SETUP_ABI_PROFILE
46224
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   322
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   323
  # Optional POSIX functionality needed by the JVM
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   324
  #
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   325
  # Check if clock_gettime is available and in which library. This indicates
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   326
  # availability of CLOCK_MONOTONIC for hotspot. But we don't need to link, so
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   327
  # don't let it update LIBS.
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   328
  save_LIBS="$LIBS"
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   329
  AC_SEARCH_LIBS(clock_gettime, rt, [HAS_CLOCK_GETTIME=true], [])
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   330
  if test "x$LIBS" = "x-lrt "; then
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   331
    CLOCK_GETTIME_IN_LIBRT=true
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   332
  fi
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   333
  LIBS="$save_LIBS"
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   334
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   335
  FLAGS_OS=OPENJDK_TARGET_OS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   336
  FLAGS_OS_TYPE=OPENJDK_TARGET_OS_TYPE
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   337
  FLAGS_CPU=OPENJDK_TARGET_CPU
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   338
  FLAGS_CPU_ARCH=OPENJDK_TARGET_CPU_ARCH
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   339
  FLAGS_CPU_BITS=OPENJDK_TARGET_CPU_BITS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   340
  FLAGS_CPU_ENDIAN=OPENJDK_TARGET_CPU_ENDIAN
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   341
  FLAGS_CPU_LEGACY=OPENJDK_TARGET_CPU_LEGACY
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   342
  FLAGS_ADD_LP64=OPENJDK_TARGET_ADD_LP64
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   343
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   344
  FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([TARGET])
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   345
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   346
  FLAGS_OS=OPENJDK_BUILD_OS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   347
  FLAGS_OS_TYPE=OPENJDK_BUILD_OS_TYPE
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   348
  FLAGS_CPU=OPENJDK_BUILD_CPU
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   349
  FLAGS_CPU_ARCH=OPENJDK_BUILD_CPU_ARCH
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   350
  FLAGS_CPU_BITS=OPENJDK_BUILD_CPU_BITS
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   351
  FLAGS_CPU_ENDIAN=OPENJDK_BUILD_CPU_ENDIAN
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   352
  FLAGS_CPU_LEGACY=OPENJDK_BUILD_CPU_LEGACY
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   353
  FLAGS_ADD_LP64=OPENJDK_BUILD_ADD_LP64=
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   354
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   355
  FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER([BUILD], [OPENJDK_BUILD_])
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   356
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   357
  # Tests are only ever compiled for TARGET
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   358
  # Flags for compiling test libraries
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   359
  CFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK $PICFLAG $CFLAGS_JDKLIB_EXTRA"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   360
  CXXFLAGS_TESTLIB="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK $PICFLAG $CXXFLAGS_JDKLIB_EXTRA"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   361
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   362
  # Flags for compiling test executables
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   363
  CFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CFLAGS_JDK"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   364
  CXXFLAGS_TESTEXE="$COMMON_CCXXFLAGS_JDK $CXXFLAGS_JDK"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   365
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   366
  AC_SUBST(CFLAGS_TESTLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   367
  AC_SUBST(CFLAGS_TESTEXE)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   368
  AC_SUBST(CXXFLAGS_TESTLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   369
  AC_SUBST(CXXFLAGS_TESTEXE)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   370
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   371
  LDFLAGS_TESTLIB="$LDFLAGS_JDKLIB"
39938
8d5f6d6b8a24 8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents: 39936
diff changeset
   372
  LDFLAGS_TESTEXE="$LDFLAGS_JDKEXE $JAVA_BASE_LDFLAGS"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   373
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   374
  AC_SUBST(LDFLAGS_TESTLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   375
  AC_SUBST(LDFLAGS_TESTEXE)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   376
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   377
])
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   378
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   379
################################################################################
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   380
# $1 - Either BUILD or TARGET to pick the correct OS/CPU variables to check
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   381
#      conditionals against.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   382
# $2 - Optional prefix for each variable defined.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   383
AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK_HELPER],
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   384
[
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   385
  # Special extras...
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   386
  if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   387
    if test "x$FLAGS_CPU_ARCH" = "xsparc"; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   388
      $2CFLAGS_JDKLIB_EXTRA="${$2CFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   389
      $2CXXFLAGS_JDKLIB_EXTRA="${$2CXXFLAGS_JDKLIB_EXTRA} -xregs=no%appl"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   390
    fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   391
    $2CFLAGS_JDKLIB_EXTRA="${$2CFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   392
    $2CXXFLAGS_JDKLIB_EXTRA="${$2CXXFLAGS_JDKLIB_EXTRA} -errtags=yes -errfmt"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   393
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   394
    $2CFLAGS_JDK="${$2CFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   395
    $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -qchars=signed -qfullpath -qsaveopt"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   396
  elif test "x$TOOLCHAIN_TYPE" = xgcc; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   397
    $2CXXSTD_CXXFLAG="-std=gnu++98"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   398
    FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [[$]$2CXXSTD_CXXFLAG -Werror],
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   399
    						 IF_FALSE: [$2CXXSTD_CXXFLAG=""])
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   400
    $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2CXXSTD_CXXFLAG}"
39936
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
   401
    $2JVM_CFLAGS="${$2JVM_CFLAGS} ${$2CXXSTD_CXXFLAG}"
43383
5e74f3dd4656 8173107: Fix autoconf/spec.gmk mismatches
ihse
parents: 43057
diff changeset
   402
    AC_SUBST($2CXXSTD_CXXFLAG)
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   403
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   404
  if test "x$OPENJDK_TARGET_OS" = xsolaris; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   405
    $2CFLAGS_JDK="${$2CFLAGS_JDK} -D__solaris__"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   406
    $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} -D__solaris__"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   407
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   408
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   409
  $2CFLAGS_JDK="${$2CFLAGS_JDK} ${$2EXTRA_CFLAGS}"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   410
  $2CXXFLAGS_JDK="${$2CXXFLAGS_JDK} ${$2EXTRA_CXXFLAGS}"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   411
  $2LDFLAGS_JDK="${$2LDFLAGS_JDK} ${$2EXTRA_LDFLAGS}"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   412
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   413
  ###############################################################################
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   414
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   415
  # Now setup the CFLAGS and LDFLAGS for the JDK build.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   416
  # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   417
  #
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   418
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   419
  # Setup compiler/platform specific flags into
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   420
  #    $2CFLAGS_JDK    - C Compiler flags
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   421
  #    $2CXXFLAGS_JDK  - C++ Compiler flags
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   422
  #    $2COMMON_CCXXFLAGS_JDK - common to C and C++
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   423
  if test "x$TOOLCHAIN_TYPE" = xgcc; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   424
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   425
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   426
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -fcheck-new"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   427
    if test "x$FLAGS_CPU" = xx86; then
30418
aa3cd6848aa0 8039426: gcc can target wrong instruction set when building JDK native code
erikj
parents: 30415
diff changeset
   428
      # Force compatibility with i586 on 32 bit intel platforms.
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   429
      $2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   430
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586"
30418
aa3cd6848aa0 8039426: gcc can target wrong instruction set when building JDK native code
erikj
parents: 30415
diff changeset
   431
    fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   432
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   433
        -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   434
    case $FLAGS_CPU_ARCH in
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   435
      arm )
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   436
        # on arm we don't prevent gcc to omit frame pointer but do prevent strict aliasing
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   437
        $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
42538
973e43884dba 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 42530
diff changeset
   438
        $2COMMON_CCXXFLAGS_JDK="${$2COMMON_CCXXFLAGS_JDK} -fsigned-char"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   439
        ;;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   440
      ppc )
23981
6ae1260c5cab 8041141: JDK9 emb build failure on PPC platform
dholmes
parents: 23428
diff changeset
   441
        # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   442
        $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   443
        ;;
41646
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   444
      s390 )
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   445
        $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer -mbackchain -march=z10"
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   446
        $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   447
        ;;
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   448
      * )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   449
        $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   450
        $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   451
        ;;
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   452
    esac
39936
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
   453
    TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: 6, PREFIX: $2, IF_AT_LEAST: FLAGS_SETUP_GCC6_COMPILER_FLAGS($2))
34596
e8328ce5b64e 8142907: Integration of minor fixes from the build-infra project
ihse
parents: 34120
diff changeset
   454
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   455
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_GNU_SOURCE"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   456
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   457
    # Restrict the debug information created by Clang to avoid
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   458
    # too big object files and speed the build up a little bit
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   459
    # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   460
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -flimit-debug-info"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   461
    if test "x$FLAGS_OS" = xlinux; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   462
      if test "x$FLAGS_CPU" = xx86; then
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   463
        # Force compatibility with i586 on 32 bit intel platforms.
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   464
        $2COMMON_CCXXFLAGS="${$2COMMON_CCXXFLAGS} -march=i586"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   465
        $2JVM_CFLAGS="[$]$2JVM_CFLAGS -march=i586"
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   466
      fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   467
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-sometimes-uninitialized"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   468
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   469
          -pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   470
      case $FLAGS_CPU_ARCH in
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   471
        ppc )
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   472
          # on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   473
          $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   474
          ;;
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   475
        * )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   476
          $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   477
          $2CFLAGS_JDK="${$2CFLAGS_JDK} -fno-strict-aliasing"
35444
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   478
          ;;
4d323e794486 8148655: LOG=cmdlines and other build-infra fixes
ihse
parents: 35032
diff changeset
   479
      esac
34596
e8328ce5b64e 8142907: Integration of minor fixes from the build-infra project
ihse
parents: 34120
diff changeset
   480
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   481
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   482
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSPARC_WORKS"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   483
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   484
    if test "x$FLAGS_CPU_ARCH" = xx86; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   485
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DcpuIntel -Di586 -D$FLAGS_CPU_LEGACY_LIB"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   486
    fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   487
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   488
    $2CFLAGS_JDK="[$]$2CFLAGS_JDK -xc99=%none -xCC -errshort=tags -Xa -v -mt -W0,-noglobal"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   489
    $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -errtags=yes +w -mt -features=no%except -DCC_NOEX -norunpath -xnolib"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   490
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
46228
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   491
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_REENTRANT"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   492
    $2CFLAGS_JDK="[$]$2CFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   493
    $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE -DSTDC"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   494
  elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   495
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS [$]$2COMMON_CCXXFLAGS_JDK \
36531
ef4e1ca50af8 8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents: 36051
diff changeset
   496
        -MD -Zc:wchar_t- -W3 -wd4800 \
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   497
        -DWIN32_LEAN_AND_MEAN \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   498
        -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   499
        -DWIN32 -DIAL"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   500
    if test "x$FLAGS_CPU" = xx86_64; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   501
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_AMD64_ -Damd64"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   502
    else
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   503
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_X86_ -Dx86"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   504
    fi
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   505
    # If building with Visual Studio 2010, we can still use _STATIC_CPPLIB to
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   506
    # avoid bundling msvcpNNN.dll. Doesn't work with newer versions of visual
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   507
    # studio.
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   508
    if test "x$TOOLCHAIN_VERSION" = "x2010"; then
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   509
      STATIC_CPPLIB_FLAGS="-D_STATIC_CPPLIB -D_DISABLE_DEPRECATE_STATIC_CPPLIB"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   510
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK $STATIC_CPPLIB_FLAGS"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   511
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS $STATIC_CPPLIB_FLAGS"
28901
5acc0ec03d06 8042707: Source changes needed to build JDK 9 with Visual Studio 2013 (VS2013)
erikj
parents: 27602
diff changeset
   512
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   513
  fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   514
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   515
  ###############################################################################
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   516
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   517
  # Adjust flags according to debug level.
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   518
  case $DEBUG_LEVEL in
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   519
    fastdebug | slowdebug )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   520
      $2CFLAGS_JDK="[$]$2CFLAGS_JDK $CFLAGS_DEBUG_SYMBOLS $CFLAGS_DEBUG_OPTIONS"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   521
      $2CXXFLAGS_JDK="[$]$2CXXFLAGS_JDK $CXXFLAGS_DEBUG_SYMBOLS $CXXFLAGS_DEBUG_OPTIONS"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   522
      ;;
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   523
    release )
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   524
      ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   525
    * )
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   526
      AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   527
      ;;
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   528
  esac
18020
eade0d9836bf 8014404: Debug flag not added to jdk native compile when --enable-debug is set
erikj
parents: 17664
diff changeset
   529
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   530
  # Set some common defines. These works for all compilers, but assume
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   531
  # -D is universally accepted.
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   532
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   533
  # Setup endianness
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   534
  if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   535
    # The macro _LITTLE_ENDIAN needs to be defined the same to avoid the
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   536
    #   Sun C compiler warning message: warning: macro redefined: _LITTLE_ENDIAN
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   537
    #   (The Solaris X86 system defines this in file /usr/include/sys/isa_defs.h).
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   538
    #   Note: -Dmacro         is the same as    #define macro 1
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   539
    #         -Dmacro=        is the same as    #define macro
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   540
    if test "x$FLAGS_OS" = xsolaris; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   541
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN="
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   542
    else
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   543
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_LITTLE_ENDIAN"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   544
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   545
  else
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23423
diff changeset
   546
    # Same goes for _BIG_ENDIAN. Do we really need to set *ENDIAN on Solaris if they
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23423
diff changeset
   547
    # are defined in the system?
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   548
    if test "x$FLAGS_OS" = xsolaris; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   549
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN="
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23423
diff changeset
   550
    else
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   551
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_BIG_ENDIAN"
23428
3c8a05bf4656 8038340: Cleanup and fix sysroot and devkit handling on Linux and Solaris
erikj
parents: 23423
diff changeset
   552
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   553
  fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   554
46228
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   555
  # Always enable optional macros for VM.
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   556
  $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_FORMAT_MACROS"
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   557
  $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_LIMIT_MACROS"
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   558
  $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D__STDC_CONSTANT_MACROS"
598ed802ee70 8086005: Define __STDC_xxx_MACROS config macros globally via build system
kbarrett
parents: 46224
diff changeset
   559
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   560
  # Setup target OS define. Use OS target name but in upper case.
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   561
  FLAGS_OS_UPPERCASE=`$ECHO $FLAGS_OS | $TR 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   562
  $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D$FLAGS_OS_UPPERCASE"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   563
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   564
  # Setup target CPU
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   565
  $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   566
      $FLAGS_ADD_LP64 \
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   567
      -DARCH='\"$FLAGS_CPU_LEGACY\"' -D$FLAGS_CPU_LEGACY"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   568
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   569
  # Setup debug/release defines
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   570
  if test "x$DEBUG_LEVEL" = xrelease; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   571
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DNDEBUG"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   572
    if test "x$FLAGS_OS" = xsolaris; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   573
      $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DTRIMMED"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   574
    fi
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   575
  else
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   576
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -DDEBUG"
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   577
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   578
46224
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   579
  # Optional POSIX functionality needed by the VM
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   580
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   581
  if test "x$HAS_CLOCK_GETTIME" = "xtrue"; then
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   582
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSUPPORTS_CLOCK_MONOTONIC"
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   583
    if test "x$CLOCK_GETTIME_IN_LIBRT" = "xtrue"; then
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   584
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DNEEDS_LIBRT"
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   585
    fi
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   586
  fi
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   587
b1ce24ef8897 8174231: Factor out and share PlatformEvent and Parker code for POSIX systems
dholmes
parents: 44398
diff changeset
   588
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   589
  # Set some additional per-OS defines.
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   590
  if test "x$FLAGS_OS" = xlinux; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   591
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DLINUX"
42141
06c697759688 7164925: Change -KPIC to -xcode=pic32 on sparc
ihse
parents: 42140
diff changeset
   592
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -pipe $PICFLAG -fno-rtti -fno-exceptions \
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   593
        -fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   594
  elif test "x$FLAGS_OS" = xsolaris; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   595
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DSOLARIS"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   596
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -template=no%extdef -features=no%split_init \
46229
883d65fcea6b 8181318: Allow C++ library headers on Solaris Studio
eosterlund
parents: 46228
diff changeset
   597
        -D_Crun_inline_placement -library=stlport4 $PICFLAG -mt -features=no%except"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   598
  elif test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   599
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE -D_DARWIN_UNLIMITED_SELECT"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   600
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_ALLBSD_SOURCE"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   601
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_DARWIN_C_SOURCE -D_XOPEN_SOURCE"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   602
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -fno-rtti -fno-exceptions -fvisibility=hidden \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   603
        -mno-omit-leaf-frame-pointer -mstack-alignment=16 -pipe -fno-strict-aliasing \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   604
        -fno-omit-frame-pointer"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   605
  elif test "x$FLAGS_OS" = xaix; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   606
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DAIX"
39191
08671ca5c778 8158938: AIX: some more new hotspot build fixes
simonis
parents: 37864
diff changeset
   607
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qtune=balanced \
08671ca5c778 8158938: AIX: some more new hotspot build fixes
simonis
parents: 37864
diff changeset
   608
        -qalias=noansi -qstrict -qtls=default -qlanglvl=c99vla \
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   609
        -qlanglvl=noredefmac -qnortti -qnoeh -qignerrno"
45878
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   610
    # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
48854
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   611
    # Hotspot now overflows its 64K TOC (currently only for debug),
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   612
    # so for debug we build with '-qpic=large -bbigtoc'.
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   613
    if test "x$DEBUG_LEVEL" = xslowdebug || test "x$DEBUG_LEVEL" = xfastdebug; then
45878
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   614
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qpic=large"
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   615
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   616
  elif test "x$FLAGS_OS" = xbsd; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   617
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK -D_ALLBSD_SOURCE"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   618
  elif test "x$FLAGS_OS" = xwindows; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   619
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_WINDOWS -DWIN32 -D_JNI_IMPLEMENTATION_"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   620
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -nologo -W3 -MD -MP"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   621
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   622
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   623
  # Set some additional per-CPU defines.
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   624
  if test "x$FLAGS_OS-$FLAGS_CPU" = xwindows-x86; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   625
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -arch:IA32"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   626
  elif test "x$FLAGS_OS-$FLAGS_CPU" = xsolaris-sparcv9; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   627
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -xarch=sparc"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   628
  elif test "x$FLAGS_CPU" = xppc64; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   629
    if test "x$FLAGS_OS" = xlinux; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   630
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string"
37404
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   631
      # fixes `relocation truncated to fit' error for gcc 4.1.
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   632
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -mminimal-toc"
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   633
      # Use ppc64 instructions, but schedule for power5
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   634
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=powerpc64 -mtune=power5"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   635
    elif test "x$FLAGS_OS" = xaix; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   636
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -qarch=ppc64"
37404
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   637
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   638
  elif test "x$FLAGS_CPU" = xppc64le; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   639
    if test "x$FLAGS_OS" = xlinux; then
37404
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   640
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -minsert-sched-nops=regroup_exact -mno-multiple -mno-string"
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   641
      # Little endian machine uses ELFv2 ABI.
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   642
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DABI_ELFv2"
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   643
      # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
41948
fd44a71c1be4 8169630: Fix wrong cpu build flag for Linux/ppc64le build
simonis
parents: 41875
diff changeset
   644
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -mcpu=power8 -mtune=power8"
37404
1ab1c5c6cd5a 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37402
diff changeset
   645
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   646
  elif test "x$FLAGS_CPU" = xs390x; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   647
    if test "x$FLAGS_OS" = xlinux; then
41646
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   648
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -mbackchain -march=z10"
0342650c5a78 8166800: [s390] Top-level build changes required for Linux/s390x
simonis
parents: 41040
diff changeset
   649
    fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   650
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   651
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   652
  if test "x$FLAGS_CPU_ENDIAN" = xlittle; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   653
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -DVM_LITTLE_ENDIAN"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   654
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   655
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   656
  if test "x$FLAGS_CPU_BITS" = x64; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   657
    if test "x$FLAGS_OS" != xsolaris && test "x$FLAGS_OS" != xaix; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   658
      # Solaris does not have _LP64=1 in the old build.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   659
      # xlc on AIX defines _LP64=1 by default and issues a warning if we redefine it.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   660
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -D_LP64=1"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   661
    fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   662
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   663
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   664
  # Set $2JVM_CFLAGS warning handling
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   665
  if test "x$FLAGS_OS" = xlinux; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   666
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wpointer-arith -Wsign-compare -Wunused-function \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   667
        -Wunused-value -Woverloaded-virtual"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   668
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   669
    if test "x$TOOLCHAIN_TYPE" = xgcc; then
37864
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
   670
      TOOLCHAIN_CHECK_COMPILER_VERSION(VERSION: [4.8], PREFIX: $2,
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   671
          IF_AT_LEAST: [
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   672
            # These flags either do not work or give spurious warnings prior to gcc 4.8.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   673
            $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-format-zero-length -Wtype-limits -Wuninitialized"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   674
          ]
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   675
      )
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   676
    fi
47687
fb290fd1f9d4 8171853: Remove Shark compiler
rkennke
parents: 47358
diff changeset
   677
    if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   678
      # Non-zero builds have stricter warnings
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   679
      $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wreturn-type -Wundef -Wformat=2"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   680
    else
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   681
      if test "x$TOOLCHAIN_TYPE" = xclang; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   682
        # Some versions of llvm do not like -Wundef
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   683
        $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-undef"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   684
      fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   685
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   686
  elif test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   687
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS -Wno-deprecated -Wpointer-arith \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   688
        -Wsign-compare -Wundef -Wunused-function -Wformat=2"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   689
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   690
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   691
  # Additional macosx handling
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   692
  if test "x$FLAGS_OS" = xmacosx; then
48751
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   693
    # MACOSX_VERSION_MIN specifies the lowest version of Macosx that the built
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   694
    # binaries should be compatible with, even if compiled on a newer version
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   695
    # of the OS. It currently has a hard coded value. Setting this also limits
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   696
    # exposure to API changes in header files. Bumping this is likely to
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   697
    # require code changes to build.
25034
d9ca34c227b8 8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents: 24911
diff changeset
   698
    MACOSX_VERSION_MIN=10.7.0
d9ca34c227b8 8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents: 24911
diff changeset
   699
    AC_SUBST(MACOSX_VERSION_MIN)
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   700
45875
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   701
    # Setting --with-macosx-version-max=<version> makes it an error to build or
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   702
    # link to macosx APIs that are newer than the given OS version. The expected
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   703
    # format for <version> is either nn.n.n or nn.nn.nn. See /usr/include/AvailabilityMacros.h.
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   704
    AC_ARG_WITH([macosx-version-max], [AS_HELP_STRING([--with-macosx-version-max],
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   705
        [error on use of newer functionality. @<:@macosx@:>@])],
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   706
        [
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   707
          if echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]]\.[[0-9]]\$"; then
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   708
              MACOSX_VERSION_MAX=$with_macosx_version_max
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   709
          elif echo "$with_macosx_version_max" | $GREP -q "^[[0-9]][[0-9]]\.[[0-9]][[0-9]]\.[[0-9]][[0-9]]\$"; then
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   710
              MACOSX_VERSION_MAX=$with_macosx_version_max
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   711
          elif test "x$with_macosx_version_max" = "xno"; then
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   712
              # Use build system default
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   713
              MACOSX_VERSION_MAX=
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   714
          else
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   715
              AC_MSG_ERROR([osx version format must be nn.n.n or nn.nn.nn])
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   716
          fi
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   717
        ],
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   718
        [MACOSX_VERSION_MAX=]
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   719
    )
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   720
    AC_SUBST(MACOSX_VERSION_MAX)
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   721
25034
d9ca34c227b8 8043340: [macosx] Fix hard-wired paths to JavaVM.framework
ddehaven
parents: 24911
diff changeset
   722
    # Let the flags variables get resolved in make for easier override on make
45875
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   723
    # command line. AvailabilityMacros.h versions have no dots, ex: 1070.
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   724
    $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   725
        -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   726
        -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   727
    $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
45875
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   728
    $2JVM_CFLAGS="[$]$2JVM_CFLAGS \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   729
        -DMAC_OS_X_VERSION_MIN_REQUIRED=\$(subst .,,\$(MACOSX_VERSION_MIN)) \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   730
        -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
48751
54f355e65415 8196803: Fix build warnings in jdk libraries with Xcode 9
erikj
parents: 48355
diff changeset
   731
    $2ARFLAGS="$2$ARFLAGS -mmacosx-version-min=\$(MACOSX_VERSION_MIN)"
45875
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   732
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   733
    if test -n "$MACOSX_VERSION_MAX"; then
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   734
        $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   735
            -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   736
        $2JVM_CFLAGS="[$]$2JVM_CFLAGS \
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   737
            -DMAC_OS_X_VERSION_MAX_ALLOWED=\$(subst .,,\$(MACOSX_VERSION_MAX))"
5fa4efe2aca3 8184022: Build JDK 10 on OSX 10.12 and above
phh
parents: 44398
diff changeset
   738
    fi
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   739
  fi
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   740
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   741
  # Setup some hard coded includes
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   742
  $2COMMON_CCXXFLAGS_JDK="[$]$2COMMON_CCXXFLAGS_JDK \
41662
97e8b9b653f9 8063154: Checked in jvmti.h not in sync with generated jvmti.h
erikj
parents: 41650
diff changeset
   743
      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base \
48355
4944950606ef 8191913: Bump classfile version number to 55
psandoz
parents: 48327
diff changeset
   744
      -I\$(SUPPORT_OUTPUTDIR)/modules_include/java.base/\$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR) \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   745
      -I${TOPDIR}/src/java.base/share/native/libjava \
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   746
      -I${TOPDIR}/src/java.base/$FLAGS_OS_TYPE/native/libjava \
48300
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 47687
diff changeset
   747
      -I${TOPDIR}/src/hotspot/share/include \
8a5edac3d5a2 8190484: Move jvm.h, jmm.h et al to hotspot/*/include
ihse
parents: 47687
diff changeset
   748
      -I${TOPDIR}/src/hotspot/os/${HOTSPOT_$1_OS_TYPE}/include"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   749
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   750
  # The shared libraries are compiled using the picflag.
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   751
  $2CFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   752
      [$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK $PICFLAG [$]$2CFLAGS_JDKLIB_EXTRA"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   753
  $2CXXFLAGS_JDKLIB="[$]$2COMMON_CCXXFLAGS_JDK \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   754
      [$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK $PICFLAG [$]$2CXXFLAGS_JDKLIB_EXTRA"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   755
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   756
  # Executable flags
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   757
  $2CFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CFLAGS_JDK [$]$2EXTRA_CFLAGS_JDK"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   758
  $2CXXFLAGS_JDKEXE="[$]$2COMMON_CCXXFLAGS_JDK [$]$2CXXFLAGS_JDK [$]$2EXTRA_CXXFLAGS_JDK"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   759
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   760
  AC_SUBST($2CFLAGS_JDKLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   761
  AC_SUBST($2CFLAGS_JDKEXE)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   762
  AC_SUBST($2CXXFLAGS_JDKLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   763
  AC_SUBST($2CXXFLAGS_JDKEXE)
29305
4ddc6faf7842 8073021: add native code coverage target into makefiles
erikj
parents: 29304
diff changeset
   764
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   765
  # Setup LDFLAGS et al.
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   766
  #
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   767
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   768
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   769
    LDFLAGS_MICROSOFT="-nologo -opt:ref"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   770
    $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_MICROSOFT -incremental:no"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   771
    $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_MICROSOFT -opt:icf,8 -subsystem:windows -base:0x8000000"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   772
    if test "x$FLAGS_CPU_BITS" = "x32"; then
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   773
      LDFLAGS_SAFESH="-safeseh"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   774
      $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SAFESH"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   775
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SAFESH"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   776
      # NOTE: Old build added -machine. Probably not needed.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   777
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -machine:I386"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   778
    else
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   779
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -machine:AMD64"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   780
    fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   781
  elif test "x$TOOLCHAIN_TYPE" = xclang; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   782
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -mno-omit-leaf-frame-pointer -mstack-alignment=16 -stdlib=libstdc++ -fPIC"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   783
      if test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   784
        # FIXME: We should really generalize SET_SHARED_LIBRARY_ORIGIN instead.
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   785
        $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   786
    fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   787
  elif test "x$TOOLCHAIN_TYPE" = xgcc; then
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   788
    # If this is a --hash-style=gnu system, use --hash-style=both, why?
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   789
    # We have previously set HAS_GNU_HASH if this is the case
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   790
    if test -n "$HAS_GNU_HASH"; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   791
      $2LDFLAGS_HASH_STYLE="-Wl,--hash-style=both"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   792
      $2LDFLAGS_JDK="${$2LDFLAGS_JDK} [$]$2LDFLAGS_HASH_STYLE"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   793
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS [$]$2LDFLAGS_HASH_STYLE"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   794
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   795
      if test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   796
        $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-rpath,@loader_path/. -Wl,-rpath,@loader_path/.."
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   797
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   798
    if test "x$FLAGS_OS" = xlinux; then
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   799
      # And since we now know that the linker is gnu, then add -z defs, to forbid
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   800
      # undefined symbols in object files.
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   801
      LDFLAGS_NO_UNDEF_SYM="-Wl,-z,defs"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   802
      $2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_NO_UNDEF_SYM"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   803
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS  $LDFLAGS_NO_UNDEF_SYM"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   804
      LDFLAGS_NO_EXEC_STACK="-Wl,-z,noexecstack"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   805
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_NO_EXEC_STACK"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   806
      if test "x$FLAGS_CPU" = xx86; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   807
        $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -march=i586"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   808
      fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   809
      case $DEBUG_LEVEL in
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   810
        release )
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   811
          # tell linker to optimize libraries.
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   812
          # Should this be supplied to the OSS linker as well?
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   813
          LDFLAGS_DEBUGLEVEL_release="-Wl,-O1"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   814
          $2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_DEBUGLEVEL_release"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   815
          $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_DEBUGLEVEL_release"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   816
          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   817
            $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   818
          fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   819
          ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   820
        slowdebug )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   821
          # Hotspot always let the linker optimize
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   822
          $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-O1"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   823
          if test "x$HAS_LINKER_NOW" = "xtrue"; then
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   824
            # do relocations at load
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   825
            $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_NOW_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   826
            $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_NOW_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   827
            $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_NOW_FLAG"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   828
          fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   829
          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   830
            # mark relocations read only
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   831
            $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_RELRO_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   832
            $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   833
            $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   834
          fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   835
          ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   836
        fastdebug )
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   837
          # Hotspot always let the linker optimize
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   838
          $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -Wl,-O1"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   839
          if test "x$HAS_LINKER_RELRO" = "xtrue"; then
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   840
            # mark relocations read only
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   841
            $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LINKER_RELRO_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   842
            $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LINKER_RELRO_FLAG"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   843
            $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LINKER_RELRO_FLAG"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   844
          fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   845
          ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   846
        * )
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   847
          AC_MSG_ERROR([Unrecognized \$DEBUG_LEVEL: $DEBUG_LEVEL])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   848
          ;;
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   849
        esac
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   850
    fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   851
  elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   852
    LDFLAGS_SOLSTUDIO="-Wl,-z,defs"
39940
fa7ee03739d6 8161057: Solaris: deprecated/obsolete compiler flags should be removed
dcubed
parents: 39938
diff changeset
   853
    $2LDFLAGS_JDK="[$]$2LDFLAGS_JDK $LDFLAGS_SOLSTUDIO -ztext"
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
   854
    LDFLAGS_CXX_SOLSTUDIO="-norunpath"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   855
    $2LDFLAGS_CXX_JDK="[$]$2LDFLAGS_CXX_JDK $LDFLAGS_CXX_SOLSTUDIO -xnolib"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   856
    $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_SOLSTUDIO -library=%none -mt $LDFLAGS_CXX_SOLSTUDIO -z noversion"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   857
    if test "x$FLAGS_CPU_ARCH" = "xsparc"; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   858
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -xarch=sparc"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   859
    fi
29451
443fdcba9598 8075515: AIX: cleanup xlc options and use -bernotok to detect missing symbols at build time
simonis
parents: 29305
diff changeset
   860
  elif test "x$TOOLCHAIN_TYPE" = xxlc; then
47358
d07d5f7cab35 8187228: [aix] make data segment page size 64K by default
stuefe
parents: 47264
diff changeset
   861
    LDFLAGS_XLC="-b64 -brtl -bnolibpath -bexpall -bernotok -btextpsize:64K -bdatapsize:64K -bstackpsize:64K"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   862
    $2LDFLAGS_JDK="${$2LDFLAGS_JDK} $LDFLAGS_XLC"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   863
    $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS $LDFLAGS_XLC"
45878
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   864
    # We need '-qminimaltoc' or '-qpic=large -bbigtoc' if the TOC overflows.
48854
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   865
    # Hotspot now overflows its 64K TOC (currently only for debug),
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   866
    # so we build with '-qpic=large -bbigtoc'.
345f41527dcc 8196488: [aix] TOC overflow for libjvm.so in fastdebug build
stuefe
parents: 48767
diff changeset
   867
    if test "x$DEBUG_LEVEL" = xslowdebug || test "x$DEBUG_LEVEL" = xfastdebug; then
45878
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   868
      $2JVM_LDFLAGS="[$]$2JVM_LDFLAGS -bbigtoc"
988bb4888e09 8184344: [aix] libjvm.so TOC overflow for slowdebug
stuefe
parents: 45875
diff changeset
   869
    fi
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   870
  fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   871
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   872
  # Customize LDFLAGS for executables
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   873
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   874
  $2LDFLAGS_JDKEXE="${$2LDFLAGS_JDK}"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   875
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   876
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   877
    if test "x$FLAGS_CPU_BITS" = "x64"; then
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   878
      LDFLAGS_STACK_SIZE=1048576
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   879
    else
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   880
      LDFLAGS_STACK_SIZE=327680
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   881
    fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   882
    $2LDFLAGS_JDKEXE="${$2LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   883
  elif test "x$FLAGS_OS" = xlinux; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   884
    $2LDFLAGS_JDKEXE="[$]$2LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   885
  fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   886
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   887
  $2LDFLAGS_JDKEXE="${$2LDFLAGS_JDKEXE} ${$2EXTRA_LDFLAGS_JDK}"
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36051
diff changeset
   888
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   889
  # Customize LDFLAGS for libs
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   890
  $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDK}"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   891
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   892
  $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
47264
8b5ed0358b3a 8187045: [linux] Not all libraries in the VM are linked with -z,noexecstack
goetz
parents: 47253
diff changeset
   893
  $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${LDFLAGS_NO_EXEC_STACK}"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   894
  if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
39938
8d5f6d6b8a24 8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents: 39936
diff changeset
   895
    $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47217
diff changeset
   896
        -libpath:${OUTPUTDIR}/support/modules_libs/java.base"
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   897
    $2JDKLIB_LIBS=""
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   898
  else
39938
8d5f6d6b8a24 8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents: 39936
diff changeset
   899
    $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
42528
125bc97e7569 8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents: 42510
diff changeset
   900
        -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base"
13697
5262b00bc10c 7197849: Update new build-infra makefiles
ohair
parents: 13133
diff changeset
   901
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   902
    if test "x$1" = "xTARGET"; then
42510
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   903
      # On some platforms (mac) the linker warns about non existing -L dirs.
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   904
      # For any of the variants server, client or minimal, the dir matches the
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   905
      # variant name. The "main" variant should be used for linking. For the
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   906
      # rest, the dir is just server.
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   907
      if HOTSPOT_CHECK_JVM_VARIANT(server) || HOTSPOT_CHECK_JVM_VARIANT(client) \
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   908
          || HOTSPOT_CHECK_JVM_VARIANT(minimal); then
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   909
        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
42528
125bc97e7569 8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents: 42510
diff changeset
   910
            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/$JVM_VARIANT_MAIN"
42510
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   911
      else
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   912
        $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
42528
125bc97e7569 8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents: 42510
diff changeset
   913
            -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
42510
406dfb60de57 8170284: Move fine granular hotspot make targets to top level
erikj
parents: 41875
diff changeset
   914
      fi
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   915
    elif test "x$1" = "xBUILD"; then
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   916
      # When building a buildjdk, it's always only the server variant
39938
8d5f6d6b8a24 8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents: 39936
diff changeset
   917
      $2JAVA_BASE_LDFLAGS="${$2JAVA_BASE_LDFLAGS} \
42528
125bc97e7569 8066474: Remove the lib/ directory from Linux and Solaris images
erikj
parents: 42510
diff changeset
   918
          -L\$(SUPPORT_OUTPUTDIR)/modules_libs/java.base/server"
14465
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   919
    fi
d529faf5e36a 8001460: build-infra: Linker warnings on macosx
erikj
parents: 14464
diff changeset
   920
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   921
    $2JDKLIB_LIBS="-ljava -ljvm"
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
   922
    if test "x$TOOLCHAIN_TYPE" = xsolstudio; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   923
      $2JDKLIB_LIBS="[$]$2JDKLIB_LIBS -lc"
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   924
    fi
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36051
diff changeset
   925
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   926
  fi
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   927
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   928
  $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2JAVA_BASE_LDFLAGS}"
39938
8d5f6d6b8a24 8144278: [TESTBUG] hotspot/runtime/StackGuardPages/testme.sh should use native library build support
gthornbr
parents: 39936
diff changeset
   929
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   930
  # Set $2JVM_LIBS (per os)
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   931
  if test "x$FLAGS_OS" = xlinux; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   932
    $2JVM_LIBS="[$]$2JVM_LIBS -lm -ldl -lpthread"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   933
  elif test "x$FLAGS_OS" = xsolaris; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   934
    # FIXME: This hard-coded path is not really proper.
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   935
    if test "x$FLAGS_CPU" = xx86_64; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   936
      $2SOLARIS_LIBM_LIBS="/usr/lib/amd64/libm.so.1"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   937
    elif test "x$FLAGS_CPU" = xsparcv9; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   938
      $2SOLARIS_LIBM_LIBS="/usr/lib/sparcv9/libm.so.1"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   939
    fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   940
    $2JVM_LIBS="[$]$2JVM_LIBS -lsocket -lsched -ldl $SOLARIS_LIBM_LIBS -lCrun \
46936
b440e4b33965 8183119: Resolve 'libkstat' dependency between open and closed part of JDK
phedlin
parents: 46931
diff changeset
   941
        -lthread -ldoor -lc -ldemangle -lnsl -lrt"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   942
  elif test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   943
    $2JVM_LIBS="[$]$2JVM_LIBS -lm"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   944
  elif test "x$FLAGS_OS" = xaix; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   945
    $2JVM_LIBS="[$]$2JVM_LIBS -Wl,-lC_r -lm -ldl -lpthread"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   946
  elif test "x$FLAGS_OS" = xbsd; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   947
    $2JVM_LIBS="[$]$2JVM_LIBS -lm"
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   948
  elif test "x$FLAGS_OS" = xwindows; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   949
    $2JVM_LIBS="[$]$2JVM_LIBS kernel32.lib user32.lib gdi32.lib winspool.lib \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   950
        comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib \
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   951
        wsock32.lib winmm.lib version.lib psapi.lib"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   952
    fi
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36051
diff changeset
   953
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   954
  # Set $2JVM_ASFLAGS
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   955
  if test "x$FLAGS_OS" = xlinux; then
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   956
    if test "x$FLAGS_CPU" = xx86; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   957
      $2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -march=i586"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   958
    fi
56124
b2b9dfdc39c8 Start breaking out stuff from flags.m4.
ihse
parents: 48854
diff changeset
   959
  elif test "x$FLAGS_OS" = xmacosx; then
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   960
    $2JVM_ASFLAGS="[$]$2JVM_ASFLAGS -x assembler-with-cpp -mno-omit-leaf-frame-pointer -mstack-alignment=16"
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   961
  fi
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   962
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   963
  $2LDFLAGS_JDKLIB="${$2LDFLAGS_JDKLIB} ${$2EXTRA_LDFLAGS_JDK}"
29305
4ddc6faf7842 8073021: add native code coverage target into makefiles
erikj
parents: 29304
diff changeset
   964
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   965
  AC_SUBST($2LDFLAGS_JDKLIB)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   966
  AC_SUBST($2LDFLAGS_JDKEXE)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   967
  AC_SUBST($2JDKLIB_LIBS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   968
  AC_SUBST($2JDKEXE_LIBS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   969
  AC_SUBST($2LDFLAGS_CXX_JDK)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   970
  AC_SUBST($2LDFLAGS_HASH_STYLE)
47264
8b5ed0358b3a 8187045: [linux] Not all libraries in the VM are linked with -z,noexecstack
goetz
parents: 47253
diff changeset
   971
  AC_SUBST($2LDFLAGS_NO_EXEC_STACK)
29305
4ddc6faf7842 8073021: add native code coverage target into makefiles
erikj
parents: 29304
diff changeset
   972
37402
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   973
  AC_SUBST($2JVM_CFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   974
  AC_SUBST($2JVM_LDFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   975
  AC_SUBST($2JVM_ASFLAGS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   976
  AC_SUBST($2JVM_LIBS)
62b5f067032e 8152666: The new Hotspot Build System
erikj
parents: 36541
diff changeset
   977
13133
701e61c32ece 7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff changeset
   978
])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   979
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   980
# FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   981
#                                  IF_FALSE: [RUN-IF-FALSE])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   982
# ------------------------------------------------------------
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   983
# Check that the C compiler supports an argument
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   984
BASIC_DEFUN_NAMED([FLAGS_C_COMPILER_CHECK_ARGUMENTS],
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
   985
    [*ARGUMENT IF_TRUE IF_FALSE], [$@],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   986
[
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   987
  AC_MSG_CHECKING([if the C compiler supports "ARG_ARGUMENT"])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   988
  supports=yes
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   989
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   990
  saved_cflags="$CFLAGS"
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
   991
  CFLAGS="$CFLAGS ARG_ARGUMENT"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   992
  AC_LANG_PUSH([C])
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
   993
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
   994
      [supports=no])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   995
  AC_LANG_POP([C])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   996
  CFLAGS="$saved_cflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
   997
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   998
  AC_MSG_RESULT([$supports])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
   999
  if test "x$supports" = "xyes" ; then
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1000
    :
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1001
    ARG_IF_TRUE
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1002
  else
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1003
    :
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1004
    ARG_IF_FALSE
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1005
  fi
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1006
])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1007
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1008
# FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1009
#                                    IF_FALSE: [RUN-IF-FALSE])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1010
# ------------------------------------------------------------
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1011
# Check that the C++ compiler supports an argument
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1012
BASIC_DEFUN_NAMED([FLAGS_CXX_COMPILER_CHECK_ARGUMENTS],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1013
    [*ARGUMENT IF_TRUE IF_FALSE], [$@],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1014
[
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1015
  AC_MSG_CHECKING([if the C++ compiler supports "ARG_ARGUMENT"])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1016
  supports=yes
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1017
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1018
  saved_cxxflags="$CXXFLAGS"
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1019
  CXXFLAGS="$CXXFLAG ARG_ARGUMENT"
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1020
  AC_LANG_PUSH([C++])
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1021
  AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int i;]])], [],
20363
fa7663fc5d50 8001931: The new build system whitespace cleanup
ihse
parents: 20362
diff changeset
  1022
      [supports=no])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1023
  AC_LANG_POP([C++])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1024
  CXXFLAGS="$saved_cxxflags"
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1025
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1026
  AC_MSG_RESULT([$supports])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1027
  if test "x$supports" = "xyes" ; then
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1028
    :
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1029
    ARG_IF_TRUE
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1030
  else
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1031
    :
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1032
    ARG_IF_FALSE
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1033
  fi
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1034
])
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1035
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1036
# FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1037
#                                IF_FALSE: [RUN-IF-FALSE])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1038
# ------------------------------------------------------------
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1039
# Check that the C and C++ compilers support an argument
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1040
BASIC_DEFUN_NAMED([FLAGS_COMPILER_CHECK_ARGUMENTS],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1041
    [*ARGUMENT IF_TRUE IF_FALSE], [$@],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1042
[
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1043
  FLAGS_C_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1044
  					     IF_TRUE: [C_COMP_SUPPORTS="yes"],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1045
					     IF_FALSE: [C_COMP_SUPPORTS="no"])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1046
  FLAGS_CXX_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [ARG_ARGUMENT],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1047
  					       IF_TRUE: [CXX_COMP_SUPPORTS="yes"],
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1048
					       IF_FALSE: [CXX_COMP_SUPPORTS="no"])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1049
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1050
  AC_MSG_CHECKING([if both compilers support "ARG_ARGUMENT"])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1051
  supports=no
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1052
  if test "x$C_COMP_SUPPORTS" = "xyes" -a "x$CXX_COMP_SUPPORTS" = "xyes"; then supports=yes; fi
42141
06c697759688 7164925: Change -KPIC to -xcode=pic32 on sparc
ihse
parents: 42140
diff changeset
  1053
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1054
  AC_MSG_RESULT([$supports])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1055
  if test "x$supports" = "xyes" ; then
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1056
    :
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1057
    ARG_IF_TRUE
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1058
  else
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1059
    :
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1060
    ARG_IF_FALSE
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1061
  fi
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1062
])
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1063
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1064
# FLAGS_LINKER_CHECK_ARGUMENTS(ARGUMENT: [ARGUMENT], IF_TRUE: [RUN-IF-TRUE],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1065
#                                   IF_FALSE: [RUN-IF-FALSE])
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1066
# ------------------------------------------------------------
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1067
# Check that the linker support an argument
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1068
BASIC_DEFUN_NAMED([FLAGS_LINKER_CHECK_ARGUMENTS],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1069
    [*ARGUMENT IF_TRUE IF_FALSE], [$@],
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1070
[
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1071
  AC_MSG_CHECKING([if linker supports "ARG_ARGUMENT"])
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1072
  supports=yes
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1073
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1074
  saved_ldflags="$LDFLAGS"
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1075
  LDFLAGS="$LDFLAGS ARG_ARGUMENT"
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1076
  AC_LANG_PUSH([C])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1077
  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1078
      [], [supports=no])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1079
  AC_LANG_POP([C])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1080
  LDFLAGS="$saved_ldflags"
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1081
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1082
  AC_MSG_RESULT([$supports])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1083
  if test "x$supports" = "xyes" ; then
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1084
    :
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1085
    ARG_IF_TRUE
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1086
  else
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1087
    :
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1088
    ARG_IF_FALSE
24911
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1089
  fi
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1090
])
a039e17f8896 8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents: 23981
diff changeset
  1091
22721
63761da45392 8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents: 22715
diff changeset
  1092
AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_MISC],
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1093
[
22466
25aaf85d1ada 8024265: Enable new build on AIX
simonis
parents: 22465
diff changeset
  1094
  # Check that the compiler supports -mX (or -qX on AIX) flags
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1095
  # Set COMPILER_SUPPORTS_TARGET_BITS_FLAG to 'true' if it does
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1096
  FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${COMPILER_TARGET_BITS_FLAG}${OPENJDK_TARGET_CPU_BITS}],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1097
      IF_TRUE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=true],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1098
      IF_FALSE: [COMPILER_SUPPORTS_TARGET_BITS_FLAG=false])
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1099
  AC_SUBST(COMPILER_SUPPORTS_TARGET_BITS_FLAG)
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1100
30415
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1101
  AC_ARG_ENABLE([warnings-as-errors], [AS_HELP_STRING([--disable-warnings-as-errors],
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1102
      [do not consider native warnings to be an error @<:@enabled@:>@])])
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1103
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1104
  AC_MSG_CHECKING([if native warnings are errors])
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1105
  if test "x$enable_warnings_as_errors" = "xyes"; then
42300
218374d35efd 8039103: "explicitly" is misspelled as "explicitely" in configure scripts
ihse
parents: 42141
diff changeset
  1106
    AC_MSG_RESULT([yes (explicitly set)])
30415
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1107
    WARNINGS_AS_ERRORS=true
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1108
  elif test "x$enable_warnings_as_errors" = "xno"; then
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1109
    AC_MSG_RESULT([no])
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1110
    WARNINGS_AS_ERRORS=false
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1111
  elif test "x$enable_warnings_as_errors" = "x"; then
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1112
    AC_MSG_RESULT([yes (default)])
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1113
    WARNINGS_AS_ERRORS=true
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1114
  else
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1115
    AC_MSG_ERROR([--enable-warnings-as-errors accepts no argument])
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1116
  fi
33443
ea274e904321 8141543: Propagate --disable-warnings-as-errors to hotspot
ihse
parents: 33440
diff changeset
  1117
30415
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1118
  AC_SUBST(WARNINGS_AS_ERRORS)
c5629d65265d 8074859: Turn on warnings as error
ihse
parents: 30096
diff changeset
  1119
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1120
  case "${TOOLCHAIN_TYPE}" in
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1121
    microsoft)
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1122
      DISABLE_WARNING_PREFIX="-wd"
25882
bd4315f0084b 8022177: Windows/MSYS builds broken
erikj
parents: 25854
diff changeset
  1123
      CFLAGS_WARNINGS_ARE_ERRORS="-WX"
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1124
      ;;
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1125
    solstudio)
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1126
      DISABLE_WARNING_PREFIX="-erroff="
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1127
      CFLAGS_WARNINGS_ARE_ERRORS="-errtags -errwarn=%all"
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1128
      ;;
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1129
    gcc)
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1130
      # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1131
      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1132
          IF_TRUE: [GCC_CAN_DISABLE_WARNINGS=true],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1133
          IF_FALSE: [GCC_CAN_DISABLE_WARNINGS=false]
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1134
      )
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1135
      if test "x$GCC_CAN_DISABLE_WARNINGS" = "xtrue"; then
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1136
        DISABLE_WARNING_PREFIX="-Wno-"
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1137
      else
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1138
        DISABLE_WARNING_PREFIX=
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1139
      fi
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1140
      CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
37864
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1141
      # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1142
      # CFLAGS since any target specific flags will likely not work with the
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1143
      # build compiler
34102
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1144
      CC_OLD="$CC"
37864
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1145
      CXX_OLD="$CXX"
34102
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1146
      CC="$BUILD_CC"
37864
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1147
      CXX="$BUILD_CXX"
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1148
      CFLAGS_OLD="$CFLAGS"
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1149
      CFLAGS=""
34923
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1150
      FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [-Wno-this-is-a-warning-that-do-not-exist],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1151
          IF_TRUE: [BUILD_CC_CAN_DISABLE_WARNINGS=true],
0a2be16ce53d 8146995: Introduce named arguments in configure
ihse
parents: 34864
diff changeset
  1152
          IF_FALSE: [BUILD_CC_CAN_DISABLE_WARNINGS=false]
34102
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1153
      )
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1154
      if test "x$BUILD_CC_CAN_DISABLE_WARNINGS" = "xtrue"; then
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1155
        BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1156
      else
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1157
        BUILD_CC_DISABLE_WARNING_PREFIX=
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1158
      fi
c0a98357f847 8143141: Bring in minor build changes from the jigsaw/jake forest
erikj
parents: 33571
diff changeset
  1159
      CC="$CC_OLD"
37864
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1160
      CXX="$CXX_OLD"
5284b5a9fdc7 8155587: Cross compilation may cause compiler warnings for "build" compiler
erikj
parents: 37404
diff changeset
  1161
      CFLAGS="$CFLAGS_OLD"
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1162
      ;;
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1163
    clang)
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1164
      DISABLE_WARNING_PREFIX="-Wno-"
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1165
      CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1166
      ;;
35747
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
  1167
    xlc)
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
  1168
      DISABLE_WARNING_PREFIX="-qsuppress="
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
  1169
      CFLAGS_WARNINGS_ARE_ERRORS="-qhalt=w"
aeaa6d0101a8 8149647: Incremental enhancements from build-infra
ihse
parents: 35451
diff changeset
  1170
      ;;
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1171
  esac
29304
81a723f8d33c 8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents: 28907
diff changeset
  1172
  AC_SUBST(DISABLE_WARNING_PREFIX)
36506
17612cee3530 8142968: Module System implementation
alanb
parents: 36051
diff changeset
  1173
  AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
23423
153d4b6b1124 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
sla
parents: 23161
diff changeset
  1174
  AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
16987
19305cbf4362 8013786: JDK-8013480 broke configure on solaris
erikj
parents: 16582
diff changeset
  1175
])
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1176
39936
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1177
# FLAGS_SETUP_GCC6_COMPILER_FLAGS([PREFIX])
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1178
# Arguments:
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1179
# $1 - Optional prefix for each variable defined.
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1180
AC_DEFUN([FLAGS_SETUP_GCC6_COMPILER_FLAGS],
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1181
[
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1182
  # These flags are required for GCC 6 builds as undefined behaviour in OpenJDK code
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1183
  # runs afoul of the more aggressive versions of these optimisations.
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1184
  # Notably, value range propagation now assumes that the this pointer of C++
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1185
  # member functions is non-null.
39936
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1186
  NO_DELETE_NULL_POINTER_CHECKS_CFLAG="-fno-delete-null-pointer-checks"
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1187
  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1188
  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_DELETE_NULL_POINTER_CHECKS_CFLAG -Werror],
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1189
  dnl					     IF_FALSE: [NO_DELETE_NULL_POINTER_CHECKS_CFLAG=""])
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1190
  NO_LIFETIME_DSE_CFLAG="-fno-lifetime-dse"
39936
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1191
  dnl Argument check is disabled until FLAGS_COMPILER_CHECK_ARGUMENTS handles cross-compilation
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1192
  dnl FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$NO_LIFETIME_DSE_CFLAG -Werror],
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1193
  dnl					     IF_FALSE: [NO_LIFETIME_DSE_CFLAG=""])
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1194
  AC_MSG_NOTICE([GCC >= 6 detected; adding ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} and ${NO_LIFETIME_DSE_CFLAG}])
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1195
  $1CFLAGS_JDK="[$]$1CFLAGS_JDK ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
552923792fd8 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 39194
diff changeset
  1196
  $1JVM_CFLAGS="[$]$1JVM_CFLAGS ${NO_DELETE_NULL_POINTER_CHECKS_CFLAG} ${NO_LIFETIME_DSE_CFLAG}"
36535
141db8da8c18 8151841: Build needs additional flags to compile with GCC 6
andrew
parents: 36531
diff changeset
  1197
])