48 # position-independent code |
48 # position-independent code |
49 PICFLAG = -fPIC |
49 PICFLAG = -fPIC |
50 |
50 |
51 VM_PICFLAG/LIBJVM = $(PICFLAG) |
51 VM_PICFLAG/LIBJVM = $(PICFLAG) |
52 VM_PICFLAG/AOUT = |
52 VM_PICFLAG/AOUT = |
53 |
|
54 ifneq ($(BUILDARCH), i486) |
|
55 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) |
53 VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO)) |
56 else |
|
57 # PIC has significant overhead on x86, build nonpic VM for now. |
|
58 # Link JVM at a "good" base location to avoid unnecessary .text patching. |
|
59 JVM_BASE_ADDR = 0x06000000 |
|
60 endif |
|
61 |
54 |
62 CFLAGS += $(VM_PICFLAG) |
55 CFLAGS += $(VM_PICFLAG) |
63 CFLAGS += -fno-rtti |
56 CFLAGS += -fno-rtti |
64 CFLAGS += -fno-exceptions |
57 CFLAGS += -fno-exceptions |
65 CFLAGS += -D_REENTRANT |
58 CFLAGS += -D_REENTRANT |
89 CFLAGS += -pipe |
82 CFLAGS += -pipe |
90 endif |
83 endif |
91 |
84 |
92 # Compiler warnings are treated as errors |
85 # Compiler warnings are treated as errors |
93 WARNINGS_ARE_ERRORS = -Werror |
86 WARNINGS_ARE_ERRORS = -Werror |
|
87 |
94 # Except for a few acceptable ones |
88 # Except for a few acceptable ones |
|
89 # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit |
|
90 # conversions which might affect the values. To avoid that, we need to turn |
|
91 # it off explicitly. |
|
92 ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" |
|
93 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare |
|
94 else |
95 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare |
95 ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare |
|
96 endif |
|
97 |
96 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) |
98 CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS) |
97 # Special cases |
99 # Special cases |
98 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
100 CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) |
99 |
101 |
100 # The flags to use for an Optimized g++ build |
102 # The flags to use for an Optimized g++ build |