make/bsd/makefiles/gcc.make

Thu, 29 Aug 2013 13:44:07 -0400

author
hseigel
date
Thu, 29 Aug 2013 13:44:07 -0400
changeset 5611
dfc126b2f659
parent 5545
e16282db4946
child 5619
ca0501b58953
permissions
-rw-r--r--

8022407: sun/misc/CopyMemory.java fails with SIGSEGV in Unsafe_SetByte+0x35
Summary: lower optimization level for unsafe.cpp due to MacOS Xcode 4.6.2 compiler optimization issue.
Reviewed-by: coleenp, twisti, dholmes
Contributed-by: lois.foltan@oracle.com

never@3156 1 #
dholmes@5299 2 # Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
never@3156 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@3156 4 #
never@3156 5 # This code is free software; you can redistribute it and/or modify it
never@3156 6 # under the terms of the GNU General Public License version 2 only, as
never@3156 7 # published by the Free Software Foundation.
never@3156 8 #
never@3156 9 # This code is distributed in the hope that it will be useful, but WITHOUT
never@3156 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@3156 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@3156 12 # version 2 for more details (a copy is included in the LICENSE file that
never@3156 13 # accompanied this code).
never@3156 14 #
never@3156 15 # You should have received a copy of the GNU General Public License version
never@3156 16 # 2 along with this work; if not, write to the Free Software Foundation,
never@3156 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@3156 18 #
never@3156 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
never@3156 20 # or visit www.oracle.com if you need additional information or have any
never@3156 21 # questions.
never@3156 22 #
never@3156 23 #
never@3156 24
never@3156 25 OS_VENDOR = $(shell uname -s)
never@3156 26
never@3156 27 #------------------------------------------------------------------------
erikj@3518 28 # CC, CXX & AS
never@3156 29
erikj@3600 30 # If a SPEC is not set already, then use these defaults.
erikj@3600 31 ifeq ($(SPEC),)
erikj@3600 32 # When cross-compiling the ALT_COMPILER_PATH points
erikj@3600 33 # to the cross-compilation toolset
erikj@3600 34 ifdef CROSS_COMPILE_ARCH
erikj@3600 35 CXX = $(ALT_COMPILER_PATH)/g++
erikj@3600 36 CC = $(ALT_COMPILER_PATH)/gcc
erikj@3600 37 HOSTCXX = g++
erikj@3600 38 HOSTCC = gcc
erikj@3600 39 else ifneq ($(OS_VENDOR), Darwin)
erikj@3600 40 CXX = g++
erikj@3600 41 CC = gcc
erikj@3600 42 HOSTCXX = $(CXX)
erikj@3600 43 HOSTCC = $(CC)
erikj@3600 44 endif
erikj@3600 45
erikj@3600 46 # i486 hotspot requires -mstackrealign on Darwin.
erikj@3600 47 # llvm-gcc supports this in Xcode 3.2.6 and 4.0.
erikj@3600 48 # gcc-4.0 supports this on earlier versions.
erikj@3600 49 # Prefer llvm-gcc where available.
erikj@3600 50 ifeq ($(OS_VENDOR), Darwin)
erikj@3600 51 ifeq ($(origin CXX), default)
erikj@3600 52 CXX = llvm-g++
erikj@3600 53 endif
erikj@3600 54 ifeq ($(origin CC), default)
erikj@3600 55 CC = llvm-gcc
erikj@3600 56 endif
erikj@3600 57
erikj@3600 58 ifeq ($(ARCH), i486)
erikj@3600 59 LLVM_SUPPORTS_STACKREALIGN := $(shell \
erikj@3600 60 [ "0"`llvm-gcc -v 2>&1 | grep LLVM | sed -E "s/.*LLVM build ([0-9]+).*/\1/"` -gt "2333" ] \
erikj@3600 61 && echo true || echo false)
erikj@3600 62
erikj@3600 63 ifeq ($(LLVM_SUPPORTS_STACKREALIGN), true)
erikj@3600 64 CXX32 ?= llvm-g++
erikj@3600 65 CC32 ?= llvm-gcc
erikj@3600 66 else
erikj@3600 67 CXX32 ?= g++-4.0
erikj@3600 68 CC32 ?= gcc-4.0
erikj@3600 69 endif
erikj@3600 70 CXX = $(CXX32)
erikj@3600 71 CC = $(CC32)
erikj@3600 72 endif
erikj@3600 73
simonis@5230 74 ifeq ($(USE_CLANG), true)
simonis@5230 75 CXX = clang++
simonis@5230 76 CC = clang
simonis@5230 77 endif
simonis@5230 78
erikj@3600 79 HOSTCXX = $(CXX)
erikj@3600 80 HOSTCC = $(CC)
erikj@3600 81 endif
erikj@3600 82
erikj@3600 83 AS = $(CC) -c -x assembler-with-cpp
dcubed@3202 84 endif
dcubed@3202 85
never@3156 86
simonis@5230 87 ifeq ($(USE_CLANG), true)
simonis@5230 88 CC_VER_MAJOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f1)
simonis@5230 89 CC_VER_MINOR := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/" | cut -d'.' -f2)
simonis@5230 90 else
simonis@5230 91 # -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
simonis@5230 92 # prints the numbers (e.g. "2.95", "3.2.1")
simonis@5230 93 CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
simonis@5230 94 CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
never@3156 95 endif
never@3156 96
simonis@5230 97 ifeq ($(USE_CLANG), true)
simonis@5230 98 # clang has precompiled headers support by default, but the user can switch
simonis@5230 99 # it off by using 'USE_PRECOMPILED_HEADER=0'.
simonis@5230 100 ifdef LP64
simonis@5230 101 ifeq ($(USE_PRECOMPILED_HEADER),)
simonis@5230 102 USE_PRECOMPILED_HEADER=1
simonis@5230 103 endif
simonis@5230 104 else
simonis@5230 105 # We don't support precompiled headers on 32-bit builds because there some files are
simonis@5230 106 # compiled with -fPIC while others are compiled without (see 'NONPIC_OBJ_FILES' rules.make)
simonis@5230 107 # Clang produces an error if the PCH file was compiled with other options than the actual compilation unit.
simonis@5230 108 USE_PRECOMPILED_HEADER=0
simonis@5230 109 endif
simonis@5230 110
simonis@5230 111 ifeq ($(USE_PRECOMPILED_HEADER),1)
simonis@5230 112
simonis@5230 113 ifndef LP64
simonis@5230 114 $(error " Precompiled Headers only supported on 64-bit platforms!")
simonis@5230 115 endif
simonis@5230 116
simonis@5230 117 PRECOMPILED_HEADER_DIR=.
simonis@5230 118 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
simonis@5230 119 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.pch
simonis@5230 120
simonis@5230 121 PCH_FLAG = -include precompiled.hpp
simonis@5230 122 PCH_FLAG/DEFAULT = $(PCH_FLAG)
simonis@5230 123 PCH_FLAG/NO_PCH = -DNO_PCH
simonis@5230 124 PCH_FLAG/BY_FILE = $(PCH_FLAG/$@)$(PCH_FLAG/DEFAULT$(PCH_FLAG/$@))
simonis@5230 125
simonis@5230 126 VM_PCH_FLAG/LIBJVM = $(PCH_FLAG/BY_FILE)
simonis@5230 127 VM_PCH_FLAG/AOUT =
simonis@5230 128 VM_PCH_FLAG = $(VM_PCH_FLAG/$(LINK_INTO))
simonis@5230 129
simonis@5230 130 # We only use precompiled headers for the JVM build
simonis@5230 131 CFLAGS += $(VM_PCH_FLAG)
simonis@5230 132
simonis@5230 133 # There are some files which don't like precompiled headers
simonis@5230 134 # The following files are build with 'OPT_CFLAGS/NOOPT' (-O0) in the opt build.
simonis@5230 135 # But Clang doesn't support a precompiled header which was compiled with -O3
simonis@5230 136 # to be used in a compilation unit which uses '-O0'. We could also prepare an
simonis@5230 137 # extra '-O0' PCH file for the opt build and use it here, but it's probably
simonis@5230 138 # not worth the effort as long as only two files need this special handling.
simonis@5230 139 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
simonis@5230 140 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
simonis@5230 141 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
hseigel@5611 142 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH)
simonis@5230 143
simonis@5230 144 endif
simonis@5230 145 else # ($(USE_CLANG), true)
simonis@5230 146 # check for precompiled headers support
simonis@5230 147 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
simonis@5230 148 # Allow the user to turn off precompiled headers from the command line.
simonis@5230 149 ifneq ($(USE_PRECOMPILED_HEADER),0)
simonis@5230 150 PRECOMPILED_HEADER_DIR=.
simonis@5230 151 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
simonis@5230 152 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
simonis@5230 153 endif
simonis@5230 154 endif
simonis@5230 155 endif
simonis@5230 156
simonis@5230 157 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
simonis@5230 158 ifeq ($(USE_PRECOMPILED_HEADER),0)
simonis@5230 159 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
simonis@5230 160 endif
never@3156 161
never@3156 162 #------------------------------------------------------------------------
never@3156 163 # Compiler flags
never@3156 164
never@3156 165 # position-independent code
never@3156 166 PICFLAG = -fPIC
never@3156 167
never@3156 168 VM_PICFLAG/LIBJVM = $(PICFLAG)
never@3156 169 VM_PICFLAG/AOUT =
never@3156 170 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
never@3156 171
erikj@3649 172 ifeq ($(JVM_VARIANT_ZERO), true)
erikj@3649 173 CFLAGS += $(LIBFFI_CFLAGS)
never@3156 174 endif
erikj@3649 175 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
erikj@3649 176 CFLAGS += $(LIBFFI_CFLAGS)
erikj@3649 177 CFLAGS += $(LLVM_CFLAGS)
never@3156 178 endif
never@3156 179 CFLAGS += $(VM_PICFLAG)
never@3156 180 CFLAGS += -fno-rtti
never@3156 181 CFLAGS += -fno-exceptions
simonis@5230 182 ifeq ($(USE_CLANG),)
simonis@5230 183 CFLAGS += -pthread
simonis@5230 184 CFLAGS += -fcheck-new
simonis@5230 185 # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
simonis@5230 186 # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
simonis@5230 187 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
simonis@5230 188 CFLAGS += -fvisibility=hidden
simonis@5230 189 endif
simonis@5230 190 else
simonis@5230 191 CFLAGS += -fvisibility=hidden
simonis@5230 192 endif
simonis@5230 193
simonis@5230 194 ifeq ($(USE_CLANG), true)
simonis@5230 195 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
simonis@5230 196 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
simonis@5230 197 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
simonis@5230 198 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
simonis@5230 199 else
simonis@5230 200 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
simonis@5230 201 endif
never@3156 202 endif
never@3156 203
never@3156 204 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
never@3156 205 ARCHFLAG/i486 = -m32 -march=i586
simonis@5230 206 ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
never@3156 207 ARCHFLAG/ia64 =
never@3156 208 ARCHFLAG/sparc = -m32 -mcpu=v9
never@3156 209 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
never@3156 210 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
never@3156 211
never@3156 212 # Darwin-specific build flags
never@3156 213 ifeq ($(OS_VENDOR), Darwin)
never@3156 214 # Ineffecient 16-byte stack re-alignment on Darwin/IA32
never@3156 215 ARCHFLAG/i486 += -mstackrealign
never@3156 216 endif
never@3156 217
never@3156 218 CFLAGS += $(ARCHFLAG)
never@3156 219 AOUT_FLAGS += $(ARCHFLAG)
never@3156 220 LFLAGS += $(ARCHFLAG)
never@3156 221 ASFLAGS += $(ARCHFLAG)
never@3156 222
never@3156 223 ifdef E500V2
never@3156 224 CFLAGS += -DE500V2
never@3156 225 endif
never@3156 226
never@3156 227 # Use C++ Interpreter
never@3156 228 ifdef CC_INTERP
never@3156 229 CFLAGS += -DCC_INTERP
never@3156 230 endif
never@3156 231
never@3156 232 # Keep temporary files (.ii, .s)
never@3156 233 ifdef NEED_ASM
never@3156 234 CFLAGS += -save-temps
never@3156 235 else
never@3156 236 CFLAGS += -pipe
never@3156 237 endif
never@3156 238
never@3156 239 # Compiler warnings are treated as errors
dcubed@3202 240 ifneq ($(COMPILER_WARNINGS_FATAL),false)
dcubed@3202 241 WARNINGS_ARE_ERRORS = -Werror
dcubed@3202 242 endif
never@3156 243
simonis@5230 244 ifeq ($(USE_CLANG), true)
simonis@5230 245 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
simonis@5230 246 WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
simonis@5230 247 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
simonis@5230 248 # Not yet supported by clang in Xcode 4.6.2
simonis@5230 249 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
simonis@5230 250 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
twisti@5545 251 WARNINGS_ARE_ERRORS += -Wno-empty-body
simonis@5230 252 endif
simonis@5230 253
jprovino@4722 254 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
simonis@5230 255
simonis@5230 256 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
simonis@5230 257 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
simonis@5230 258 # conversions which might affect the values. Only enable it in earlier versions.
simonis@5230 259 WARNING_FLAGS = -Wunused-function
simonis@5230 260 ifeq ($(USE_CLANG),)
simonis@5230 261 WARNINGS_FLAGS += -Wconversion
simonis@5230 262 endif
never@3156 263 endif
never@3156 264
jprovino@4722 265 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
never@3156 266 # Special cases
never@3156 267 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
never@3156 268 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
never@3156 269 ifeq ($(OS_VENDOR), Darwin)
never@3156 270 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
never@3156 271 endif
never@3156 272
jprovino@4165 273 OPT_CFLAGS/SIZE=-Os
jprovino@4165 274 OPT_CFLAGS/SPEED=-O3
jprovino@4165 275
jprovino@4165 276 # Hotspot uses very unstrict aliasing turn this optimization off
jprovino@4165 277 # This option is added to CFLAGS rather than OPT_CFLAGS
jprovino@4165 278 # so that OPT_CFLAGS overrides get this option too.
jprovino@4165 279 CFLAGS += -fno-strict-aliasing
never@3156 280
never@3156 281 # The flags to use for an Optimized g++ build
dcubed@3202 282 ifeq ($(OS_VENDOR), Darwin)
dcubed@3202 283 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
dcubed@3202 284 # <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
jprovino@4165 285 OPT_CFLAGS_DEFAULT ?= SIZE
dcubed@3202 286 else
jprovino@4165 287 OPT_CFLAGS_DEFAULT ?= SPEED
dcubed@3202 288 endif
never@3156 289
jprovino@4165 290 ifdef OPT_CFLAGS
jprovino@4165 291 ifneq ("$(origin OPT_CFLAGS)", "command line")
jprovino@4165 292 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
jprovino@4165 293 endif
jprovino@4165 294 endif
never@3156 295
jprovino@4165 296 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
jprovino@4165 297
jprovino@4165 298 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
never@3156 299 # if we use expensive-optimizations
never@3156 300 ifeq ($(BUILDARCH), ia64)
never@3156 301 OPT_CFLAGS += -fno-expensive-optimizations
never@3156 302 endif
never@3156 303
never@3156 304 OPT_CFLAGS/NOOPT=-O0
never@3156 305
simonis@5230 306 # Work around some compiler bugs.
simonis@5230 307 ifeq ($(USE_CLANG), true)
simonis@5230 308 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
simonis@5230 309 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
hseigel@5611 310 OPT_CFLAGS/unsafe.o += -01
simonis@5230 311 endif
simonis@5230 312 else
simonis@5230 313 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
simonis@5230 314 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
simonis@5230 315 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
simonis@5230 316 endif
never@3156 317 endif
never@3156 318
never@3156 319 # Flags for generating make dependency flags.
simonis@5230 320 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
simonis@5230 321 ifeq ($(USE_CLANG),)
simonis@5230 322 ifneq ($(CC_VER_MAJOR), 2)
simonis@5230 323 DEPFLAGS += -fpch-deps
simonis@5230 324 endif
never@3156 325 endif
never@3156 326
never@3156 327 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
stefank@3325 328 ifeq ($(USE_PRECOMPILED_HEADER),0)
never@3156 329 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
never@3156 330 endif
never@3156 331
erikj@4682 332 ifeq ($(OS_VENDOR), Darwin)
erikj@4682 333 # Setting these parameters makes it an error to link to macosx APIs that are
erikj@4682 334 # newer than the given OS version and makes the linked binaries compatible even
erikj@4682 335 # if built on a newer version of the OS.
erikj@4682 336 # The expected format is X.Y.Z
erikj@4682 337 ifeq ($(MACOSX_VERSION_MIN),)
erikj@4682 338 MACOSX_VERSION_MIN=10.7.0
erikj@4682 339 endif
erikj@4682 340 # The macro takes the version with no dots, ex: 1070
erikj@4682 341 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
erikj@4682 342 -mmacosx-version-min=$(MACOSX_VERSION_MIN)
erikj@4682 343 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
erikj@4682 344 endif
erikj@4682 345
never@3156 346 #------------------------------------------------------------------------
never@3156 347 # Linker flags
never@3156 348
never@3156 349 # statically link libstdc++.so, work with gcc but ignored by g++
never@3156 350 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
never@3156 351
simonis@5230 352 ifeq ($(USE_CLANG),)
simonis@5230 353 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
simonis@5230 354 ifneq ("${CC_VER_MAJOR}", "2")
simonis@5230 355 STATIC_LIBGCC += -static-libgcc
simonis@5230 356 endif
never@3156 357
simonis@5230 358 ifeq ($(BUILDARCH), ia64)
simonis@5230 359 LFLAGS += -Wl,-relax
simonis@5230 360 endif
never@3156 361 endif
never@3156 362
never@3156 363 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
never@3156 364 MAPFLAG = -Xlinker --version-script=FILENAME
never@3156 365
never@3156 366 #
never@3156 367 # Shared Library
never@3156 368 #
never@3156 369 ifeq ($(OS_VENDOR), Darwin)
never@3156 370 # Standard linker flags
never@3156 371 LFLAGS +=
never@3156 372
dholmes@5299 373 # The apple linker has its own variant of mapfiles/version-scripts
dholmes@5299 374 MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME
never@3156 375
never@3156 376 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
never@3156 377 SONAMEFLAG =
never@3156 378
never@3156 379 # Build shared library
dcubed@3202 380 SHARED_FLAG = -Wl,-install_name,@rpath/$(@F) -dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $(VM_PICFLAG)
never@3156 381
never@3156 382 # Keep symbols even they are not used
never@3156 383 #AOUT_FLAGS += -Xlinker -export-dynamic
never@3156 384 else
never@3156 385 # Enable linker optimization
never@3156 386 LFLAGS += -Xlinker -O1
never@3156 387
never@3156 388 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
never@3156 389 SONAMEFLAG = -Xlinker -soname=SONAME
never@3156 390
never@3156 391 # Build shared library
never@3156 392 SHARED_FLAG = -shared $(VM_PICFLAG)
never@3156 393
never@3156 394 # Keep symbols even they are not used
never@3156 395 AOUT_FLAGS += -Xlinker -export-dynamic
never@3156 396 endif
never@3156 397
never@3156 398 #------------------------------------------------------------------------
never@3156 399 # Debug flags
never@3156 400
simonis@5230 401 ifeq ($(USE_CLANG), true)
simonis@5230 402 # Restrict the debug information created by Clang to avoid
simonis@5230 403 # too big object files and speed the build up a little bit
simonis@5230 404 # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
simonis@5230 405 CFLAGS += -flimit-debug-info
never@3156 406 endif
never@3156 407
simonis@5230 408 # DEBUG_BINARIES uses full -g debug information for all configs
never@3156 409 ifeq ($(DEBUG_BINARIES), true)
simonis@5230 410 CFLAGS += -g
simonis@5230 411 else
simonis@5230 412 # Use the stabs format for debugging information (this is the default
simonis@5230 413 # on gcc-2.91). It's good enough, has all the information about line
simonis@5230 414 # numbers and local variables, and libjvm.so is only about 16M.
simonis@5230 415 # Change this back to "-g" if you want the most expressive format.
simonis@5230 416 # (warning: that could easily inflate libjvm.so to 150M!)
simonis@5230 417 # Note: The Itanium gcc compiler crashes when using -gstabs.
simonis@5230 418 DEBUG_CFLAGS/ia64 = -g
simonis@5230 419 DEBUG_CFLAGS/amd64 = -g
simonis@5230 420 DEBUG_CFLAGS/arm = -g
simonis@5230 421 DEBUG_CFLAGS/ppc = -g
simonis@5230 422 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
simonis@5230 423 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
simonis@5230 424 DEBUG_CFLAGS += -gstabs
simonis@5230 425 endif
never@3156 426 endif
never@3156 427
never@3156 428 # If we are building HEADLESS, pass on to VM
never@3156 429 # so it can set the java.awt.headless property
never@3156 430 ifdef HEADLESS
never@3156 431 CFLAGS += -DHEADLESS
never@3156 432 endif
never@3156 433
never@3156 434 # We are building Embedded for a small device
never@3156 435 # favor code space over speed
never@3156 436 ifdef MINIMIZE_RAM_USAGE
never@3156 437 CFLAGS += -DMINIMIZE_RAM_USAGE
never@3156 438 endif

mercurial