make/bsd/makefiles/gcc.make

Fri, 30 Aug 2013 15:07:23 -0400

author
hseigel
date
Fri, 30 Aug 2013 15:07:23 -0400
changeset 5619
ca0501b58953
parent 5611
dfc126b2f659
child 5671
1c6b721a3fbf
permissions
-rw-r--r--

8024050: Incorrect optimization level and comment specified for unsafe.cpp
Summary: Fix comments and optimization level.
Reviewed-by: rdurbin, coleenp, hseigel
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)
hseigel@5619 132
hseigel@5619 133 # The following files are compiled at various optimization
hseigel@5619 134 # levels due to optimization issues encountered at the
hseigel@5619 135 # 'OPT_CFLAGS_DEFAULT' level. The Clang compiler issues a compile
hseigel@5619 136 # time error if there is an optimization level specification
hseigel@5619 137 # skew between the PCH file and the C++ file. Especially if the
hseigel@5619 138 # PCH file is compiled at a higher optimization level than
hseigel@5619 139 # the C++ file. One solution might be to prepare extra optimization
hseigel@5619 140 # level specific PCH files for the opt build and use them here, but
hseigel@5619 141 # it's probably not worth the effort as long as only a few files
hseigel@5619 142 # need this special handling.
simonis@5230 143 PCH_FLAG/loopTransform.o = $(PCH_FLAG/NO_PCH)
simonis@5230 144 PCH_FLAG/sharedRuntimeTrig.o = $(PCH_FLAG/NO_PCH)
simonis@5230 145 PCH_FLAG/sharedRuntimeTrans.o = $(PCH_FLAG/NO_PCH)
hseigel@5611 146 PCH_FLAG/unsafe.o = $(PCH_FLAG/NO_PCH)
simonis@5230 147
simonis@5230 148 endif
simonis@5230 149 else # ($(USE_CLANG), true)
simonis@5230 150 # check for precompiled headers support
simonis@5230 151 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
simonis@5230 152 # Allow the user to turn off precompiled headers from the command line.
simonis@5230 153 ifneq ($(USE_PRECOMPILED_HEADER),0)
simonis@5230 154 PRECOMPILED_HEADER_DIR=.
simonis@5230 155 PRECOMPILED_HEADER_SRC=$(GAMMADIR)/src/share/vm/precompiled/precompiled.hpp
simonis@5230 156 PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/precompiled.hpp.gch
simonis@5230 157 endif
simonis@5230 158 endif
simonis@5230 159 endif
simonis@5230 160
simonis@5230 161 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
simonis@5230 162 ifeq ($(USE_PRECOMPILED_HEADER),0)
simonis@5230 163 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
simonis@5230 164 endif
never@3156 165
never@3156 166 #------------------------------------------------------------------------
never@3156 167 # Compiler flags
never@3156 168
never@3156 169 # position-independent code
never@3156 170 PICFLAG = -fPIC
never@3156 171
never@3156 172 VM_PICFLAG/LIBJVM = $(PICFLAG)
never@3156 173 VM_PICFLAG/AOUT =
never@3156 174 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
never@3156 175
erikj@3649 176 ifeq ($(JVM_VARIANT_ZERO), true)
erikj@3649 177 CFLAGS += $(LIBFFI_CFLAGS)
never@3156 178 endif
erikj@3649 179 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
erikj@3649 180 CFLAGS += $(LIBFFI_CFLAGS)
erikj@3649 181 CFLAGS += $(LLVM_CFLAGS)
never@3156 182 endif
never@3156 183 CFLAGS += $(VM_PICFLAG)
never@3156 184 CFLAGS += -fno-rtti
never@3156 185 CFLAGS += -fno-exceptions
simonis@5230 186 ifeq ($(USE_CLANG),)
simonis@5230 187 CFLAGS += -pthread
simonis@5230 188 CFLAGS += -fcheck-new
simonis@5230 189 # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
simonis@5230 190 # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
simonis@5230 191 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
simonis@5230 192 CFLAGS += -fvisibility=hidden
simonis@5230 193 endif
simonis@5230 194 else
simonis@5230 195 CFLAGS += -fvisibility=hidden
simonis@5230 196 endif
simonis@5230 197
simonis@5230 198 ifeq ($(USE_CLANG), true)
simonis@5230 199 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
simonis@5230 200 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
simonis@5230 201 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
simonis@5230 202 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
simonis@5230 203 else
simonis@5230 204 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
simonis@5230 205 endif
never@3156 206 endif
never@3156 207
never@3156 208 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
never@3156 209 ARCHFLAG/i486 = -m32 -march=i586
simonis@5230 210 ARCHFLAG/amd64 = -m64 $(STACK_ALIGNMENT_OPT)
never@3156 211 ARCHFLAG/ia64 =
never@3156 212 ARCHFLAG/sparc = -m32 -mcpu=v9
never@3156 213 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
never@3156 214 ARCHFLAG/zero = $(ZERO_ARCHFLAG)
never@3156 215
never@3156 216 # Darwin-specific build flags
never@3156 217 ifeq ($(OS_VENDOR), Darwin)
never@3156 218 # Ineffecient 16-byte stack re-alignment on Darwin/IA32
never@3156 219 ARCHFLAG/i486 += -mstackrealign
never@3156 220 endif
never@3156 221
never@3156 222 CFLAGS += $(ARCHFLAG)
never@3156 223 AOUT_FLAGS += $(ARCHFLAG)
never@3156 224 LFLAGS += $(ARCHFLAG)
never@3156 225 ASFLAGS += $(ARCHFLAG)
never@3156 226
never@3156 227 ifdef E500V2
never@3156 228 CFLAGS += -DE500V2
never@3156 229 endif
never@3156 230
never@3156 231 # Use C++ Interpreter
never@3156 232 ifdef CC_INTERP
never@3156 233 CFLAGS += -DCC_INTERP
never@3156 234 endif
never@3156 235
never@3156 236 # Keep temporary files (.ii, .s)
never@3156 237 ifdef NEED_ASM
never@3156 238 CFLAGS += -save-temps
never@3156 239 else
never@3156 240 CFLAGS += -pipe
never@3156 241 endif
never@3156 242
never@3156 243 # Compiler warnings are treated as errors
dcubed@3202 244 ifneq ($(COMPILER_WARNINGS_FATAL),false)
dcubed@3202 245 WARNINGS_ARE_ERRORS = -Werror
dcubed@3202 246 endif
never@3156 247
simonis@5230 248 ifeq ($(USE_CLANG), true)
simonis@5230 249 # However we need to clean the code up before we can unrestrictedly enable this option with Clang
simonis@5230 250 WARNINGS_ARE_ERRORS += -Wno-unused-value -Wno-logical-op-parentheses -Wno-parentheses-equality -Wno-parentheses
simonis@5230 251 WARNINGS_ARE_ERRORS += -Wno-switch -Wno-tautological-compare
simonis@5230 252 # Not yet supported by clang in Xcode 4.6.2
simonis@5230 253 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
simonis@5230 254 WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
twisti@5545 255 WARNINGS_ARE_ERRORS += -Wno-empty-body
simonis@5230 256 endif
simonis@5230 257
jprovino@4722 258 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
simonis@5230 259
simonis@5230 260 ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
simonis@5230 261 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
simonis@5230 262 # conversions which might affect the values. Only enable it in earlier versions.
simonis@5230 263 WARNING_FLAGS = -Wunused-function
simonis@5230 264 ifeq ($(USE_CLANG),)
simonis@5230 265 WARNINGS_FLAGS += -Wconversion
simonis@5230 266 endif
never@3156 267 endif
never@3156 268
jprovino@4722 269 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS)
never@3156 270 # Special cases
never@3156 271 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
never@3156 272 # XXXDARWIN: for _dyld_bind_fully_image_containing_address
never@3156 273 ifeq ($(OS_VENDOR), Darwin)
never@3156 274 CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
never@3156 275 endif
never@3156 276
jprovino@4165 277 OPT_CFLAGS/SIZE=-Os
jprovino@4165 278 OPT_CFLAGS/SPEED=-O3
jprovino@4165 279
jprovino@4165 280 # Hotspot uses very unstrict aliasing turn this optimization off
jprovino@4165 281 # This option is added to CFLAGS rather than OPT_CFLAGS
jprovino@4165 282 # so that OPT_CFLAGS overrides get this option too.
jprovino@4165 283 CFLAGS += -fno-strict-aliasing
never@3156 284
never@3156 285 # The flags to use for an Optimized g++ build
dcubed@3202 286 ifeq ($(OS_VENDOR), Darwin)
dcubed@3202 287 # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
dcubed@3202 288 # <http://wikis.sun.com/display/OpenJDK/Mac+OS+X+Port+Compilers>
jprovino@4165 289 OPT_CFLAGS_DEFAULT ?= SIZE
dcubed@3202 290 else
jprovino@4165 291 OPT_CFLAGS_DEFAULT ?= SPEED
dcubed@3202 292 endif
never@3156 293
jprovino@4165 294 ifdef OPT_CFLAGS
jprovino@4165 295 ifneq ("$(origin OPT_CFLAGS)", "command line")
jprovino@4165 296 $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
jprovino@4165 297 endif
jprovino@4165 298 endif
never@3156 299
jprovino@4165 300 OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
jprovino@4165 301
jprovino@4165 302 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
never@3156 303 # if we use expensive-optimizations
never@3156 304 ifeq ($(BUILDARCH), ia64)
never@3156 305 OPT_CFLAGS += -fno-expensive-optimizations
never@3156 306 endif
never@3156 307
never@3156 308 OPT_CFLAGS/NOOPT=-O0
never@3156 309
simonis@5230 310 # Work around some compiler bugs.
simonis@5230 311 ifeq ($(USE_CLANG), true)
simonis@5230 312 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
simonis@5230 313 OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
hseigel@5619 314 OPT_CFLAGS/unsafe.o += -O1
simonis@5230 315 endif
simonis@5230 316 else
simonis@5230 317 # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
simonis@5230 318 ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
simonis@5230 319 OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
simonis@5230 320 endif
never@3156 321 endif
never@3156 322
never@3156 323 # Flags for generating make dependency flags.
simonis@5230 324 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
simonis@5230 325 ifeq ($(USE_CLANG),)
simonis@5230 326 ifneq ($(CC_VER_MAJOR), 2)
simonis@5230 327 DEPFLAGS += -fpch-deps
simonis@5230 328 endif
never@3156 329 endif
never@3156 330
never@3156 331 # -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
stefank@3325 332 ifeq ($(USE_PRECOMPILED_HEADER),0)
never@3156 333 CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
never@3156 334 endif
never@3156 335
erikj@4682 336 ifeq ($(OS_VENDOR), Darwin)
erikj@4682 337 # Setting these parameters makes it an error to link to macosx APIs that are
erikj@4682 338 # newer than the given OS version and makes the linked binaries compatible even
erikj@4682 339 # if built on a newer version of the OS.
erikj@4682 340 # The expected format is X.Y.Z
erikj@4682 341 ifeq ($(MACOSX_VERSION_MIN),)
erikj@4682 342 MACOSX_VERSION_MIN=10.7.0
erikj@4682 343 endif
erikj@4682 344 # The macro takes the version with no dots, ex: 1070
erikj@4682 345 CFLAGS += -DMAC_OS_X_VERSION_MAX_ALLOWED=$(subst .,,$(MACOSX_VERSION_MIN)) \
erikj@4682 346 -mmacosx-version-min=$(MACOSX_VERSION_MIN)
erikj@4682 347 LDFLAGS += -mmacosx-version-min=$(MACOSX_VERSION_MIN)
erikj@4682 348 endif
erikj@4682 349
never@3156 350 #------------------------------------------------------------------------
never@3156 351 # Linker flags
never@3156 352
never@3156 353 # statically link libstdc++.so, work with gcc but ignored by g++
never@3156 354 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
never@3156 355
simonis@5230 356 ifeq ($(USE_CLANG),)
simonis@5230 357 # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
simonis@5230 358 ifneq ("${CC_VER_MAJOR}", "2")
simonis@5230 359 STATIC_LIBGCC += -static-libgcc
simonis@5230 360 endif
never@3156 361
simonis@5230 362 ifeq ($(BUILDARCH), ia64)
simonis@5230 363 LFLAGS += -Wl,-relax
simonis@5230 364 endif
never@3156 365 endif
never@3156 366
never@3156 367 # Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
never@3156 368 MAPFLAG = -Xlinker --version-script=FILENAME
never@3156 369
never@3156 370 #
never@3156 371 # Shared Library
never@3156 372 #
never@3156 373 ifeq ($(OS_VENDOR), Darwin)
never@3156 374 # Standard linker flags
never@3156 375 LFLAGS +=
never@3156 376
dholmes@5299 377 # The apple linker has its own variant of mapfiles/version-scripts
dholmes@5299 378 MAPFLAG = -Xlinker -exported_symbols_list -Xlinker FILENAME
never@3156 379
never@3156 380 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
never@3156 381 SONAMEFLAG =
never@3156 382
never@3156 383 # Build shared library
dcubed@3202 384 SHARED_FLAG = -Wl,-install_name,@rpath/$(@F) -dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $(VM_PICFLAG)
never@3156 385
never@3156 386 # Keep symbols even they are not used
never@3156 387 #AOUT_FLAGS += -Xlinker -export-dynamic
never@3156 388 else
never@3156 389 # Enable linker optimization
never@3156 390 LFLAGS += -Xlinker -O1
never@3156 391
never@3156 392 # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
never@3156 393 SONAMEFLAG = -Xlinker -soname=SONAME
never@3156 394
never@3156 395 # Build shared library
never@3156 396 SHARED_FLAG = -shared $(VM_PICFLAG)
never@3156 397
never@3156 398 # Keep symbols even they are not used
never@3156 399 AOUT_FLAGS += -Xlinker -export-dynamic
never@3156 400 endif
never@3156 401
never@3156 402 #------------------------------------------------------------------------
never@3156 403 # Debug flags
never@3156 404
simonis@5230 405 ifeq ($(USE_CLANG), true)
simonis@5230 406 # Restrict the debug information created by Clang to avoid
simonis@5230 407 # too big object files and speed the build up a little bit
simonis@5230 408 # (see http://llvm.org/bugs/show_bug.cgi?id=7554)
simonis@5230 409 CFLAGS += -flimit-debug-info
never@3156 410 endif
never@3156 411
simonis@5230 412 # DEBUG_BINARIES uses full -g debug information for all configs
never@3156 413 ifeq ($(DEBUG_BINARIES), true)
simonis@5230 414 CFLAGS += -g
simonis@5230 415 else
simonis@5230 416 # Use the stabs format for debugging information (this is the default
simonis@5230 417 # on gcc-2.91). It's good enough, has all the information about line
simonis@5230 418 # numbers and local variables, and libjvm.so is only about 16M.
simonis@5230 419 # Change this back to "-g" if you want the most expressive format.
simonis@5230 420 # (warning: that could easily inflate libjvm.so to 150M!)
simonis@5230 421 # Note: The Itanium gcc compiler crashes when using -gstabs.
simonis@5230 422 DEBUG_CFLAGS/ia64 = -g
simonis@5230 423 DEBUG_CFLAGS/amd64 = -g
simonis@5230 424 DEBUG_CFLAGS/arm = -g
simonis@5230 425 DEBUG_CFLAGS/ppc = -g
simonis@5230 426 DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
simonis@5230 427 ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
simonis@5230 428 DEBUG_CFLAGS += -gstabs
simonis@5230 429 endif
never@3156 430 endif
never@3156 431
never@3156 432 # If we are building HEADLESS, pass on to VM
never@3156 433 # so it can set the java.awt.headless property
never@3156 434 ifdef HEADLESS
never@3156 435 CFLAGS += -DHEADLESS
never@3156 436 endif
never@3156 437
never@3156 438 # We are building Embedded for a small device
never@3156 439 # favor code space over speed
never@3156 440 ifdef MINIMIZE_RAM_USAGE
never@3156 441 CFLAGS += -DMINIMIZE_RAM_USAGE
never@3156 442 endif

mercurial