32 ############################################################################## |
32 ############################################################################## |
33 # Build the ad compiler (the adlc build tool) |
33 # Build the ad compiler (the adlc build tool) |
34 |
34 |
35 # Flags depending on the build platform/tool chain |
35 # Flags depending on the build platform/tool chain |
36 # NOTE: No optimization or debug flags set here |
36 # NOTE: No optimization or debug flags set here |
37 ifeq ($(OPENJDK_BUILD_OS), linux) |
37 ifeq ($(call isBuildOs, linux), true) |
38 ADLC_CFLAGS := -fno-exceptions -DLINUX |
38 ADLC_CFLAGS := -fno-exceptions -DLINUX |
39 else ifeq ($(OPENJDK_BUILD_OS), solaris) |
39 else ifeq ($(call isBuildOs, solaris), true) |
40 ADLC_LDFLAGS := -m64 |
40 ADLC_LDFLAGS := -m64 |
41 ADLC_CFLAGS := -m64 |
41 ADLC_CFLAGS := -m64 |
42 ADLC_CFLAGS_WARNINGS := +w |
42 ADLC_CFLAGS_WARNINGS := +w |
43 else ifeq ($(OPENJDK_BUILD_OS), aix) |
43 else ifeq ($(call isBuildOs, aix), true) |
44 ADLC_LDFLAGS := -q64 |
44 ADLC_LDFLAGS := -q64 |
45 ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX |
45 ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX |
46 else ifeq ($(OPENJDK_BUILD_OS), windows) |
46 else ifeq ($(call isBuildOs, windows), true) |
47 ADLC_LDFLAGS := -nologo |
47 ADLC_LDFLAGS := -nologo |
48 ADLC_CFLAGS := -nologo -EHsc |
48 ADLC_CFLAGS := -nologo -EHsc |
49 # NOTE: The old build also have -D_CRT_SECURE_NO_DEPRECATE but it doesn't |
49 # NOTE: The old build also have -D_CRT_SECURE_NO_DEPRECATE but it doesn't |
50 # seem needed any more. |
50 # seem needed any more. |
51 ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS |
51 ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS |
85 |
85 |
86 # Setup flags for the adlc build tool (ADLCFLAGS). |
86 # Setup flags for the adlc build tool (ADLCFLAGS). |
87 ADLCFLAGS += -q -T |
87 ADLCFLAGS += -q -T |
88 |
88 |
89 # ADLC flags depending on target OS |
89 # ADLC flags depending on target OS |
90 ifeq ($(OPENJDK_TARGET_OS), linux) |
90 ifeq ($(call isTargetOs, linux), true) |
91 ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1 |
91 ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1 |
92 else ifeq ($(OPENJDK_TARGET_OS), solaris) |
92 else ifeq ($(call isTargetOs, solaris), true) |
93 ADLCFLAGS += -DSOLARIS=1 -DSPARC_WORKS=1 |
93 ADLCFLAGS += -DSOLARIS=1 -DSPARC_WORKS=1 |
94 else ifeq ($(OPENJDK_TARGET_OS), aix) |
94 else ifeq ($(call isTargetOs, aix), true) |
95 ADLCFLAGS += -DAIX=1 |
95 ADLCFLAGS += -DAIX=1 |
96 else ifeq ($(OPENJDK_TARGET_OS), macosx) |
96 else ifeq ($(call isTargetOs, macosx), true) |
97 ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1 |
97 ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1 |
98 endif |
98 endif |
99 |
99 |
100 ifneq ($(OPENJDK_TARGET_OS), windows) |
100 ifeq ($(call isTargetOs, windows), false) |
101 # NOTE: Windows adlc flags was different in the old build. Is this really |
101 # NOTE: Windows adlc flags was different in the old build. Is this really |
102 # correct? |
102 # correct? |
103 |
103 |
104 # -g makes #line directives in the generated C++ files. |
104 # -g makes #line directives in the generated C++ files. |
105 ADLCFLAGS += -g |
105 ADLCFLAGS += -g |
107 ADLCFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)=1 |
107 ADLCFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)=1 |
108 endif |
108 endif |
109 |
109 |
110 # This generates checks in the generated C++ files that _LP64 is correctly |
110 # This generates checks in the generated C++ files that _LP64 is correctly |
111 # (un)defined when compiling them. |
111 # (un)defined when compiling them. |
112 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64) |
112 ifeq ($(call isTargetCpuBits, 64), true) |
113 ADLCFLAGS += -D_LP64=1 |
113 ADLCFLAGS += -D_LP64=1 |
114 else |
114 else |
115 ADLCFLAGS += -U_LP64 |
115 ADLCFLAGS += -U_LP64 |
116 endif |
116 endif |
117 |
117 |