author | ihse |
Tue, 20 Feb 2018 12:05:50 +0100 | |
branch | ihse-cflags-rewrite-branch |
changeset 56158 | 97b2b2de66f2 |
parent 56146 | d019a80c41c0 |
child 56161 | a7585ecb9fc2 |
permissions | -rw-r--r-- |
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 | 26 |
################################################################################ |
27 |
# |
|
56124 | 28 |
# Setup flags for C/C++ compiler |
42538 | 29 |
# |
30 |
||
56124 | 31 |
############################################################################### |
32 |
# |
|
33 |
# How to compile shared libraries. |
|
34 |
# |
|
35 |
AC_DEFUN([FLAGS_SETUP_SHARED_LIBS], |
|
32810
8203e52cd373
8138694: Devkit build on Macosx still requires Xcode to be installed
erikj
parents:
30856
diff
changeset
|
36 |
[ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
37 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
38 |
PICFLAG="-fPIC" |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
39 |
C_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
40 |
CXX_FLAG_REORDER='' |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
41 |
|
14111 | 42 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
43 |
# Linking is different on MacOSX |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
44 |
if test "x$STATIC_BUILD" = xtrue; then |
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
45 |
SHARED_LIBRARY_FLAGS ='-undefined dynamic_lookup' |
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
46 |
else |
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56146
diff
changeset
|
47 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 -fPIC" |
33562
c76b2fa11486
8136556: Add the ability to perform static builds of MacOSX x64 binaries
bobv
parents:
32813
diff
changeset
|
48 |
fi |
44398
406532d25529
8177634: Fix for 8175307 may cause linker errors on OS X 10.9
ihse
parents:
44074
diff
changeset
|
49 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
50 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
51 |
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' |
35747 | 52 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
53 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
54 |
# Default works for linux, might work on other platforms as well. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
55 |
SHARED_LIBRARY_FLAGS='-shared' |
41875 | 56 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
57 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
58 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
59 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
60 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
61 |
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
|
62 |
C_FLAG_REORDER='' |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
63 |
CXX_FLAG_REORDER='' |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
64 |
|
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
65 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
66 |
# Linking is different on MacOSX |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
67 |
PICFLAG='' |
56158
97b2b2de66f2
Fixing PIC-flag issues, and all remaining differences on linux_x64.
ihse
parents:
56146
diff
changeset
|
68 |
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0" |
44398
406532d25529
8177634: Fix for 8175307 may cause linker errors on OS X 10.9
ihse
parents:
44074
diff
changeset
|
69 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
70 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
71 |
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' |
35747 | 72 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' |
37402 | 73 |
|
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
74 |
else |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
75 |
# Default works for linux, might work on other platforms as well. |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
76 |
PICFLAG='-fPIC' |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
77 |
SHARED_LIBRARY_FLAGS='-shared' |
41875 | 78 |
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$ORIGIN[$]1' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
79 |
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1' |
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
80 |
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1' |
42538 | 81 |
|
82 |
# arm specific settings |
|
83 |
if test "x$OPENJDK_TARGET_CPU" = "xarm"; then |
|
84 |
# '-Wl,-z,origin' isn't used on arm. |
|
85 |
SET_SHARED_LIBRARY_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1' |
|
86 |
else |
|
87 |
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN" |
|
88 |
fi |
|
89 |
||
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
90 |
fi |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
91 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
42141 | 92 |
if test "x$OPENJDK_TARGET_CPU" = xsparcv9; then |
93 |
PICFLAG="-xcode=pic32" |
|
94 |
else |
|
95 |
PICFLAG="-KPIC" |
|
96 |
fi |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
97 |
C_FLAG_REORDER='-xF' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
98 |
CXX_FLAG_REORDER='-xF' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
99 |
SHARED_LIBRARY_FLAGS="-G" |
41875 | 100 |
SET_EXECUTABLE_ORIGIN='-R\$$ORIGIN[$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
101 |
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
102 |
SET_SHARED_LIBRARY_NAME='-h [$]1' |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
103 |
SET_SHARED_LIBRARY_MAPFILE='-M[$]1' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
104 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
36051 | 105 |
# '-qpic' defaults to 'qpic=small'. This means that the compiler generates only |
106 |
# one instruction for accessing the TOC. If the TOC grows larger than 64K, the linker |
|
107 |
# will have to patch this single instruction with a call to some out-of-order code which |
|
108 |
# does the load from the TOC. This is of course slow. But in that case we also would have |
|
109 |
# to use '-bbigtoc' for linking anyway so we could also change the PICFLAG to 'qpic=large'. |
|
110 |
# With 'qpic=large' the compiler will by default generate a two-instruction sequence which |
|
111 |
# can be patched directly by the linker and does not require a jump to out-of-order code. |
|
112 |
# Another alternative instead of using 'qpic=large -bbigtoc' may be to use '-qminimaltoc' |
|
113 |
# instead. This creates a distinct TOC for every compilation unit (and thus requires two |
|
114 |
# loads for accessing a global variable). But there are rumors that this may be seen as a |
|
115 |
# 'performance feature' because of improved code locality of the symbols used in a |
|
116 |
# compilation unit. |
|
117 |
PICFLAG="-qpic" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
118 |
C_FLAG_REORDER='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
119 |
CXX_FLAG_REORDER='' |
36051 | 120 |
SHARED_LIBRARY_FLAGS="-qmkshrobj -bM:SRE -bnoentry" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
121 |
SET_EXECUTABLE_ORIGIN="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
122 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
123 |
SET_SHARED_LIBRARY_NAME='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
124 |
SET_SHARED_LIBRARY_MAPFILE='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
125 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
126 |
PICFLAG="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
127 |
C_FLAG_REORDER='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
128 |
CXX_FLAG_REORDER='' |
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
129 |
SHARED_LIBRARY_FLAGS="-dll" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
130 |
SET_EXECUTABLE_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
131 |
SET_SHARED_LIBRARY_ORIGIN='' |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
132 |
SET_SHARED_LIBRARY_NAME='' |
35747 | 133 |
SET_SHARED_LIBRARY_MAPFILE='-def:[$]1' |
20363 | 134 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
135 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
136 |
AC_SUBST(C_FLAG_REORDER) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
137 |
AC_SUBST(CXX_FLAG_REORDER) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
138 |
AC_SUBST(SET_EXECUTABLE_ORIGIN) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
139 |
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN) |
20363 | 140 |
AC_SUBST(SET_SHARED_LIBRARY_NAME) |
141 |
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE) |
|
34596
e8328ce5b64e
8142907: Integration of minor fixes from the build-infra project
ihse
parents:
34120
diff
changeset
|
142 |
AC_SUBST(SHARED_LIBRARY_FLAGS) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
143 |
]) |
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
144 |
|
56124 | 145 |
AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS], |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
146 |
[ |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
147 |
# Debug symbols |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
148 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
149 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64" && test "x$DEBUG_LEVEL" = "xfastdebug"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
150 |
CFLAGS_DEBUG_SYMBOLS="-g1" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
151 |
CXXFLAGS_DEBUG_SYMBOLS="-g1" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
152 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
153 |
CFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
154 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
155 |
fi |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
156 |
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
|
157 |
CFLAGS_DEBUG_SYMBOLS="-g" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
158 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
159 |
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
160 |
CFLAGS_DEBUG_SYMBOLS="-g -xs" |
35032 | 161 |
# -g0 enables debug symbols without disabling inlining. |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
162 |
CXXFLAGS_DEBUG_SYMBOLS="-g0 -xs" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
163 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
164 |
CFLAGS_DEBUG_SYMBOLS="-g" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
165 |
CXXFLAGS_DEBUG_SYMBOLS="-g" |
36531
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
166 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
167 |
CFLAGS_DEBUG_SYMBOLS="-Zi" |
ef4e1ca50af8
8151619: genSocketOptionRegistry.exe always relinked on Windows
erikj
parents:
36051
diff
changeset
|
168 |
CXXFLAGS_DEBUG_SYMBOLS="-Zi" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
169 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
170 |
AC_SUBST(CFLAGS_DEBUG_SYMBOLS) |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
171 |
AC_SUBST(CXXFLAGS_DEBUG_SYMBOLS) |
56124 | 172 |
]) |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
173 |
|
56124 | 174 |
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS], |
175 |
[ |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
176 |
# bounds, memory and behavior checking options |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
177 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
178 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
179 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
180 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
181 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
182 |
fastdebug ) |
26123
44827e1a7a7b
8047952: Remove FORTIFY_SOURCE from fastdebug and slowdebug builds
mduigou
parents:
25459
diff
changeset
|
183 |
# no adjustment |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
184 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
185 |
slowdebug ) |
37402 | 186 |
# FIXME: By adding this to C(XX)FLAGS_DEBUG_OPTIONS/JVM_CFLAGS_SYMBOLS it |
35747 | 187 |
# get's added conditionally on whether we produce debug symbols or not. |
188 |
# This is most likely not really correct. |
|
189 |
||
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
190 |
# Add runtime stack smashing and undefined behavior checks. |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
191 |
# Not all versions of gcc support -fstack-protector |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
192 |
STACK_PROTECTOR_CFLAG="-fstack-protector-all" |
35451
d0b71f2375d0
8129395: Configure should verify that -fstack-protector is valid - take 2
ihse
parents:
35450
diff
changeset
|
193 |
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror], IF_FALSE: [STACK_PROTECTOR_CFLAG=""]) |
30856
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
194 |
|
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
195 |
CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
09b01c98ca8d
8081692: Configure should verify that -fstack-protector is valid
ihse
parents:
30740
diff
changeset
|
196 |
CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
197 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
198 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
199 |
fi |
56124 | 200 |
]) |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
201 |
|
56124 | 202 |
AC_DEFUN([FLAGS_SETUP_OPTIMIZATION], |
203 |
[ |
|
37402 | 204 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
205 |
# Optimization levels |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
206 |
if test "x$TOOLCHAIN_TYPE" = xsolstudio; then |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
207 |
CC_HIGHEST="$CC_HIGHEST -fns -fsimple -fsingle -xbuiltin=%all -xdepend -xrestrict -xlibmil" |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
208 |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
209 |
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xx86"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
210 |
# FIXME: seems we always set -xregs=no%frameptr; put it elsewhere more global? |
37402 | 211 |
C_O_FLAG_HIGHEST_JVM="-xO4" |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
212 |
C_O_FLAG_HIGHEST="-xO4 -Wu,-O4~yz $CC_HIGHEST -xalias_level=basic -xregs=no%frameptr" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
213 |
C_O_FLAG_HI="-xO4 -Wu,-O4~yz -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
214 |
C_O_FLAG_NORM="-xO2 -Wu,-O2~yz -xregs=no%frameptr" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
215 |
C_O_FLAG_DEBUG="-xregs=no%frameptr" |
37402 | 216 |
C_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
217 |
C_O_FLAG_NONE="-xregs=no%frameptr" |
37402 | 218 |
CXX_O_FLAG_HIGHEST_JVM="-xO4" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
219 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption ube -O4~yz $CC_HIGHEST -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
220 |
CXX_O_FLAG_HI="-xO4 -Qoption ube -O4~yz -xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
221 |
CXX_O_FLAG_NORM="-xO2 -Qoption ube -O2~yz -xregs=no%frameptr" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
222 |
CXX_O_FLAG_DEBUG="-xregs=no%frameptr" |
37402 | 223 |
CXX_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
224 |
CXX_O_FLAG_NONE="-xregs=no%frameptr" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
225 |
if test "x$OPENJDK_TARGET_CPU_BITS" = "x32"; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
226 |
C_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST -xchip=pentium" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
227 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_HIGHEST -xchip=pentium" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
228 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
229 |
elif test "x$OPENJDK_TARGET_CPU_ARCH" = "xsparc"; then |
37402 | 230 |
C_O_FLAG_HIGHEST_JVM="-xO4" |
22730
c6ac76f2c90c
8019729: JDK build HIGHEST compiler optimisation setting isn't valid for Sun C++ compiler
erikj
parents:
22721
diff
changeset
|
231 |
C_O_FLAG_HIGHEST="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0 $CC_HIGHEST -xalias_level=basic -xprefetch=auto,explicit -xchip=ultra" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
232 |
C_O_FLAG_HI="-xO4 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
233 |
C_O_FLAG_NORM="-xO2 -Wc,-Qrm-s -Wc,-Qiselect-T0" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
234 |
C_O_FLAG_DEBUG="" |
37402 | 235 |
C_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
236 |
C_O_FLAG_NONE="" |
37402 | 237 |
CXX_O_FLAG_HIGHEST_JVM="-xO4" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
238 |
CXX_O_FLAG_HIGHEST="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0 $CC_HIGHEST -xprefetch=auto,explicit -xchip=ultra" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
239 |
CXX_O_FLAG_HI="-xO4 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
240 |
CXX_O_FLAG_NORM="-xO2 -Qoption cg -Qrm-s -Qoption cg -Qiselect-T0" |
35747 | 241 |
CXX_O_FLAG_DEBUG="" |
37402 | 242 |
CXX_O_FLAG_DEBUG_JVM="" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
243 |
CXX_O_FLAG_NONE="" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
244 |
fi |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
245 |
else |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
246 |
# The remaining toolchains share opt flags between CC and CXX; |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
247 |
# setup for C and duplicate afterwards. |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
248 |
if test "x$TOOLCHAIN_TYPE" = xgcc; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
249 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
250 |
# On MacOSX we optimize for size, something |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
251 |
# we should do for all platforms? |
37402 | 252 |
C_O_FLAG_HIGHEST_JVM="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
253 |
C_O_FLAG_HIGHEST="-Os" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
254 |
C_O_FLAG_HI="-Os" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
255 |
C_O_FLAG_NORM="-Os" |
37402 | 256 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
257 |
else |
37402 | 258 |
C_O_FLAG_HIGHEST_JVM="-O3" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
259 |
C_O_FLAG_HIGHEST="-O3" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
260 |
C_O_FLAG_HI="-O3" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
261 |
C_O_FLAG_NORM="-O2" |
37402 | 262 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
263 |
fi |
25459 | 264 |
C_O_FLAG_DEBUG="-O0" |
37402 | 265 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
266 |
C_O_FLAG_DEBUG_JVM="" |
|
267 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
268 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
269 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
270 |
C_O_FLAG_NONE="-O0" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
271 |
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
|
272 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
273 |
# On MacOSX we optimize for size, something |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
274 |
# we should do for all platforms? |
37402 | 275 |
C_O_FLAG_HIGHEST_JVM="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
276 |
C_O_FLAG_HIGHEST="-Os" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
277 |
C_O_FLAG_HI="-Os" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
278 |
C_O_FLAG_NORM="-Os" |
37402 | 279 |
C_O_FLAG_SIZE="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
280 |
else |
37402 | 281 |
C_O_FLAG_HIGHEST_JVM="-O3" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
282 |
C_O_FLAG_HIGHEST="-O3" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
283 |
C_O_FLAG_HI="-O3" |
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
284 |
C_O_FLAG_NORM="-O2" |
37402 | 285 |
C_O_FLAG_SIZE="-Os" |
23161
85635b5bf0a6
8019470: Changes needed to compile JDK 8 on MacOS with clang compiler
henryjen
parents:
22730
diff
changeset
|
286 |
fi |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
287 |
C_O_FLAG_DEBUG="-O0" |
37402 | 288 |
if test "x$OPENJDK_TARGET_OS" = xmacosx; then |
289 |
C_O_FLAG_DEBUG_JVM="" |
|
290 |
elif test "x$OPENJDK_TARGET_OS" = xlinux; then |
|
291 |
C_O_FLAG_DEBUG_JVM="-O0" |
|
292 |
fi |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
293 |
C_O_FLAG_NONE="-O0" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
294 |
elif test "x$TOOLCHAIN_TYPE" = xxlc; then |
39191 | 295 |
C_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1 -qinline -qinlglue" |
296 |
C_O_FLAG_HIGHEST="-O3 -qhot=level=1 -qinline -qinlglue" |
|
297 |
C_O_FLAG_HI="-O3 -qinline -qinlglue" |
|
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
298 |
C_O_FLAG_NORM="-O2" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
299 |
C_O_FLAG_DEBUG="-qnoopt" |
37402 | 300 |
# FIXME: Value below not verified. |
301 |
C_O_FLAG_DEBUG_JVM="" |
|
35020
8a7f717c3bc2
8145427: [aix] xlc: wrong flag used to switch off optimization
stuefe
parents:
34120
diff
changeset
|
302 |
C_O_FLAG_NONE="-qnoopt" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
303 |
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then |
37402 | 304 |
C_O_FLAG_HIGHEST_JVM="-O2 -Oy-" |
20363 | 305 |
C_O_FLAG_HIGHEST="-O2" |
306 |
C_O_FLAG_HI="-O1" |
|
307 |
C_O_FLAG_NORM="-O1" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
308 |
C_O_FLAG_DEBUG="-Od" |
37402 | 309 |
C_O_FLAG_DEBUG_JVM="" |
20363 | 310 |
C_O_FLAG_NONE="-Od" |
37402 | 311 |
C_O_FLAG_SIZE="-Os" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
312 |
fi |
37402 | 313 |
CXX_O_FLAG_HIGHEST_JVM="$C_O_FLAG_HIGHEST_JVM" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
314 |
CXX_O_FLAG_HIGHEST="$C_O_FLAG_HIGHEST" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
315 |
CXX_O_FLAG_HI="$C_O_FLAG_HI" |
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
316 |
CXX_O_FLAG_NORM="$C_O_FLAG_NORM" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
317 |
CXX_O_FLAG_DEBUG="$C_O_FLAG_DEBUG" |
37402 | 318 |
CXX_O_FLAG_DEBUG_JVM="$C_O_FLAG_DEBUG_JVM" |
22721
63761da45392
8034788: Rewrite toolchain.m4 to support multiple toolchains per platform.
ihse
parents:
22715
diff
changeset
|
319 |
CXX_O_FLAG_NONE="$C_O_FLAG_NONE" |
37402 | 320 |
CXX_O_FLAG_SIZE="$C_O_FLAG_SIZE" |
20363 | 321 |
fi |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
322 |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
323 |
# Adjust optimization flags according to debug level. |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
324 |
case $DEBUG_LEVEL in |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
325 |
release ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
326 |
# no adjustment |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
327 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
328 |
fastdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
329 |
# Not quite so much optimization |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
330 |
C_O_FLAG_HI="$C_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
331 |
CXX_O_FLAG_HI="$CXX_O_FLAG_NORM" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
332 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
333 |
slowdebug ) |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
334 |
# Disable optimization |
37402 | 335 |
C_O_FLAG_HIGHEST_JVM="$C_O_FLAG_DEBUG_JVM" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
336 |
C_O_FLAG_HIGHEST="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
337 |
C_O_FLAG_HI="$C_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
338 |
C_O_FLAG_NORM="$C_O_FLAG_DEBUG" |
37402 | 339 |
C_O_FLAG_SIZE="$C_O_FLAG_DEBUG" |
340 |
CXX_O_FLAG_HIGHEST_JVM="$CXX_O_FLAG_DEBUG_JVM" |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
341 |
CXX_O_FLAG_HIGHEST="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
342 |
CXX_O_FLAG_HI="$CXX_O_FLAG_DEBUG" |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
343 |
CXX_O_FLAG_NORM="$CXX_O_FLAG_DEBUG" |
37402 | 344 |
CXX_O_FLAG_SIZE="$CXX_O_FLAG_DEBUG" |
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
345 |
;; |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
346 |
esac |
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
347 |
|
37402 | 348 |
AC_SUBST(C_O_FLAG_HIGHEST_JVM) |
20363 | 349 |
AC_SUBST(C_O_FLAG_HIGHEST) |
350 |
AC_SUBST(C_O_FLAG_HI) |
|
351 |
AC_SUBST(C_O_FLAG_NORM) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
352 |
AC_SUBST(C_O_FLAG_DEBUG) |
20363 | 353 |
AC_SUBST(C_O_FLAG_NONE) |
37402 | 354 |
AC_SUBST(C_O_FLAG_SIZE) |
355 |
AC_SUBST(CXX_O_FLAG_HIGHEST_JVM) |
|
20363 | 356 |
AC_SUBST(CXX_O_FLAG_HIGHEST) |
357 |
AC_SUBST(CXX_O_FLAG_HI) |
|
358 |
AC_SUBST(CXX_O_FLAG_NORM) |
|
24911
a039e17f8896
8032045: Enable compiler and linker safety switches for debug builds
mduigou
parents:
23981
diff
changeset
|
359 |
AC_SUBST(CXX_O_FLAG_DEBUG) |
20363 | 360 |
AC_SUBST(CXX_O_FLAG_NONE) |
37402 | 361 |
AC_SUBST(CXX_O_FLAG_SIZE) |
13133
701e61c32ece
7182051: Update of latest build-infra Makefiles (missing files)
erikj
parents:
diff
changeset
|
362 |
]) |