< prev index next >

make/linux/makefiles/gcc.make

Print this page




 133 
 134 # position-independent code
 135 PICFLAG = -fPIC
 136 
 137 VM_PICFLAG/LIBJVM = $(PICFLAG)
 138 VM_PICFLAG/AOUT   =
 139 VM_PICFLAG        = $(VM_PICFLAG/$(LINK_INTO))
 140 
 141 ifeq ($(JVM_VARIANT_ZERO), true)
 142 CFLAGS += $(LIBFFI_CFLAGS)
 143 endif
 144 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
 145 CFLAGS += $(LIBFFI_CFLAGS)
 146 CFLAGS += $(LLVM_CFLAGS)
 147 endif
 148 CFLAGS += $(VM_PICFLAG)
 149 CFLAGS += -fno-rtti
 150 CFLAGS += -fno-exceptions
 151 CFLAGS += -D_REENTRANT
 152 ifeq ($(USE_CLANG),)
 153   CFLAGS += -fcheck-new
 154   # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
 155   # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
 156   ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 157     CFLAGS += -fvisibility=hidden
 158   endif
 159 else
 160   CFLAGS += -fvisibility=hidden
 161 endif
 162 
 163 ifeq ($(USE_CLANG), true)
 164   # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
 165   # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
 166   ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
 167     STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
 168   else
 169     STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
 170   endif
 171 endif
 172 
 173 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
 174 ARCHFLAG/i486    = -m32 -march=i586
 175 ARCHFLAG/amd64   = -m64 $(STACK_ALIGNMENT_OPT)

 176 ARCHFLAG/ia64    =
 177 ARCHFLAG/sparc   = -m32 -mcpu=v9
 178 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
 179 ARCHFLAG/zero    = $(ZERO_ARCHFLAG)
 180 ARCHFLAG/ppc64   =  -m64
 181 
 182 CFLAGS     += $(ARCHFLAG)
 183 AOUT_FLAGS += $(ARCHFLAG)
 184 LFLAGS     += $(ARCHFLAG)
 185 ASFLAGS    += $(ARCHFLAG)
 186 
 187 ifeq ($(DEBUG_BINARIES), true)
 188   ASFLAGS    += $(ASFLAGS_DEBUG_SYMBOLS)
 189 endif
 190 
 191 # Use C++ Interpreter
 192 ifdef CC_INTERP
 193   CFLAGS += -DCC_INTERP
 194 endif
 195 


 246 
 247 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp 
 248 # if we use expensive-optimizations
 249 ifeq ($(BUILDARCH), ia64)
 250 OPT_CFLAGS += -fno-expensive-optimizations
 251 endif
 252 
 253 OPT_CFLAGS/NOOPT=-O0
 254 
 255 # Work around some compiler bugs.
 256 ifeq ($(USE_CLANG), true)
 257   ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
 258     OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
 259   endif
 260 else
 261   # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
 262   ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
 263     OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
 264   endif
 265 endif



 266 
 267 # Flags for generating make dependency flags.
 268 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
 269 ifeq ($(USE_CLANG),)
 270   ifneq ("${CC_VER_MAJOR}", "2")
 271     DEPFLAGS += -fpch-deps
 272   endif
 273 endif
 274 
 275 #------------------------------------------------------------------------
 276 # Linker flags
 277 
 278 # statically link libstdc++.so, work with gcc but ignored by g++
 279 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
 280 # While the VM needs the above line, adlc needs a separate setting:
 281 ADLC_STATIC_STDCXX = -static-libstdc++
 282 
 283 ifeq ($(USE_CLANG),)
 284   # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
 285   ifneq ("${CC_VER_MAJOR}", "2")




 133 
 134 # position-independent code
 135 PICFLAG = -fPIC
 136 
 137 VM_PICFLAG/LIBJVM = $(PICFLAG)
 138 VM_PICFLAG/AOUT   =
 139 VM_PICFLAG        = $(VM_PICFLAG/$(LINK_INTO))
 140 
 141 ifeq ($(JVM_VARIANT_ZERO), true)
 142 CFLAGS += $(LIBFFI_CFLAGS)
 143 endif
 144 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
 145 CFLAGS += $(LIBFFI_CFLAGS)
 146 CFLAGS += $(LLVM_CFLAGS)
 147 endif
 148 CFLAGS += $(VM_PICFLAG)
 149 CFLAGS += -fno-rtti
 150 CFLAGS += -fno-exceptions
 151 CFLAGS += -D_REENTRANT
 152 ifeq ($(USE_CLANG),)
 153   CFLAGS += -fcheck-new -fstack-protector
 154   # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
 155   # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
 156   ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
 157     CFLAGS += -fvisibility=hidden
 158   endif
 159 else
 160   CFLAGS += -fvisibility=hidden
 161 endif
 162 
 163 ifeq ($(USE_CLANG), true)
 164   # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
 165   # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
 166   ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
 167     STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
 168   else
 169     STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
 170   endif
 171 endif
 172 
 173 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
 174 ARCHFLAG/i486    = -m32 -march=i586
 175 ARCHFLAG/amd64   = -m64 $(STACK_ALIGNMENT_OPT)
 176 ARCHFLAG/aarch64 =
 177 ARCHFLAG/ia64    =
 178 ARCHFLAG/sparc   = -m32 -mcpu=v9
 179 ARCHFLAG/sparcv9 = -m64 -mcpu=v9
 180 ARCHFLAG/zero    = $(ZERO_ARCHFLAG)
 181 ARCHFLAG/ppc64   =  -m64
 182 
 183 CFLAGS     += $(ARCHFLAG)
 184 AOUT_FLAGS += $(ARCHFLAG)
 185 LFLAGS     += $(ARCHFLAG)
 186 ASFLAGS    += $(ARCHFLAG)
 187 
 188 ifeq ($(DEBUG_BINARIES), true)
 189   ASFLAGS    += $(ASFLAGS_DEBUG_SYMBOLS)
 190 endif
 191 
 192 # Use C++ Interpreter
 193 ifdef CC_INTERP
 194   CFLAGS += -DCC_INTERP
 195 endif
 196 


 247 
 248 # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp 
 249 # if we use expensive-optimizations
 250 ifeq ($(BUILDARCH), ia64)
 251 OPT_CFLAGS += -fno-expensive-optimizations
 252 endif
 253 
 254 OPT_CFLAGS/NOOPT=-O0
 255 
 256 # Work around some compiler bugs.
 257 ifeq ($(USE_CLANG), true)
 258   ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 2), 1)
 259     OPT_CFLAGS/loopTransform.o += $(OPT_CFLAGS/NOOPT)
 260   endif
 261 else
 262   # 6835796. Problem in GCC 4.3.0 with mulnode.o optimized compilation.
 263   ifeq ($(shell expr $(CC_VER_MAJOR) = 4 \& $(CC_VER_MINOR) = 3), 1)
 264     OPT_CFLAGS/mulnode.o += $(OPT_CFLAGS/NOOPT)
 265   endif
 266 endif
 267 
 268 # Need extra inlining to collapse all the templated closures into the hot loop
 269 OPT_CFLAGS/shenandoahConcurrentMark.o += $(OPT_CFLAGS) --param inline-unit-growth=1000
 270 
 271 # Flags for generating make dependency flags.
 272 DEPFLAGS = -MMD -MP -MF $(DEP_DIR)/$(@:%=%.d)
 273 ifeq ($(USE_CLANG),)
 274   ifneq ("${CC_VER_MAJOR}", "2")
 275     DEPFLAGS += -fpch-deps
 276   endif
 277 endif
 278 
 279 #------------------------------------------------------------------------
 280 # Linker flags
 281 
 282 # statically link libstdc++.so, work with gcc but ignored by g++
 283 STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
 284 # While the VM needs the above line, adlc needs a separate setting:
 285 ADLC_STATIC_STDCXX = -static-libstdc++
 286 
 287 ifeq ($(USE_CLANG),)
 288   # statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
 289   ifneq ("${CC_VER_MAJOR}", "2")


< prev index next >