173
174 # position-independent code
175 PICFLAG = -fPIC
176
177 VM_PICFLAG/LIBJVM = $(PICFLAG)
178 VM_PICFLAG/AOUT =
179 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
180
181 ifeq ($(JVM_VARIANT_ZERO), true)
182 CFLAGS += $(LIBFFI_CFLAGS)
183 endif
184 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
185 CFLAGS += $(LIBFFI_CFLAGS)
186 CFLAGS += $(LLVM_CFLAGS)
187 endif
188 CFLAGS += $(VM_PICFLAG)
189 CFLAGS += -fno-rtti
190 CFLAGS += -fno-exceptions
191 ifeq ($(USE_CLANG),)
192 CFLAGS += -pthread
193 CFLAGS += -fcheck-new
194 # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
195 # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
196 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
197 CFLAGS += -fvisibility=hidden
198 endif
199 else
200 CFLAGS += -fvisibility=hidden
201 endif
202
203 ifeq ($(USE_CLANG), true)
204 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
205 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
206 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
207 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
208 else
209 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
210 endif
211 endif
212
213 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
|
173
174 # position-independent code
175 PICFLAG = -fPIC
176
177 VM_PICFLAG/LIBJVM = $(PICFLAG)
178 VM_PICFLAG/AOUT =
179 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
180
181 ifeq ($(JVM_VARIANT_ZERO), true)
182 CFLAGS += $(LIBFFI_CFLAGS)
183 endif
184 ifeq ($(JVM_VARIANT_ZEROSHARK), true)
185 CFLAGS += $(LIBFFI_CFLAGS)
186 CFLAGS += $(LLVM_CFLAGS)
187 endif
188 CFLAGS += $(VM_PICFLAG)
189 CFLAGS += -fno-rtti
190 CFLAGS += -fno-exceptions
191 ifeq ($(USE_CLANG),)
192 CFLAGS += -pthread
193 CFLAGS += -fcheck-new -fstack-protector
194 # version 4 and above support fvisibility=hidden (matches jni_x86.h file)
195 # except 4.1.2 gives pointless warnings that can't be disabled (afaik)
196 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
197 CFLAGS += -fvisibility=hidden
198 endif
199 else
200 CFLAGS += -fvisibility=hidden
201 endif
202
203 ifeq ($(USE_CLANG), true)
204 # Before Clang 3.1, we had to pass the stack alignment specification directly to llvm with the help of '-mllvm'
205 # Starting with version 3.1, Clang understands the '-mstack-alignment' (and rejects '-mllvm -stack-alignment')
206 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 1 \) \))" "0"
207 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mstack-alignment=16
208 else
209 STACK_ALIGNMENT_OPT = -mno-omit-leaf-frame-pointer -mllvm -stack-alignment=16
210 endif
211 endif
212
213 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
|