1 #
2 # Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 $(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcAdlc.gmk))
27
28 ifeq ($(call check-jvm-feature, compiler2), true)
29
30 ADLC_SUPPORT_DIR := $(JVM_SUPPORT_DIR)/adlc
31
32 ##############################################################################
33 # Build the ad compiler (the adlc build tool)
34
35 # Flags depending on the build platform/tool chain
36 # NOTE: No optimization or debug flags set here
37 ifeq ($(call isBuildOs, linux), true)
38 ADLC_CFLAGS := -fno-exceptions -DLINUX
39 else ifeq ($(call isBuildOs, solaris), true)
40 ADLC_LDFLAGS := -m64
41 ADLC_CFLAGS := -m64
42 ADLC_CFLAGS_WARNINGS := +w
43 else ifeq ($(call isBuildOs, aix), true)
44 ADLC_LDFLAGS := -q64
45 ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
46 else ifeq ($(call isBuildOs, windows), true)
47 ADLC_LDFLAGS := -nologo
48 ADLC_CFLAGS := -nologo -EHsc
49 # NOTE: The old build also have -D_CRT_SECURE_NO_DEPRECATE but it doesn't
50 # seem needed any more.
51 ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
52 endif
53
54 # Set the C++ standard if supported
55 ADLC_CFLAGS += $(ADLC_CXXFLAG)
56
57 # NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
58 # hurt.
59 ADLC_CFLAGS += -DASSERT
60
61 ADLC_CFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)
62
71 CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
72 LDFLAGS := $(ADLC_LDFLAGS), \
73 LIBS := $(ADLC_LIBS), \
74 OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
75 OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
76 DEBUG_SYMBOLS := false, \
77 DISABLED_WARNINGS_clang := tautological-compare, \
78 ))
79
80 ADLC_TOOL := $(BUILD_ADLC_TARGET)
81
82 ##############################################################################
83 # Transform the ad source files into C++ source files using adlc
84
85 # Setup flags for the adlc build tool (ADLCFLAGS).
86 ADLCFLAGS += -q -T
87
88 # ADLC flags depending on target OS
89 ifeq ($(call isTargetOs, linux), true)
90 ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1
91 else ifeq ($(call isTargetOs, solaris), true)
92 ADLCFLAGS += -DSOLARIS=1 -DSPARC_WORKS=1
93 else ifeq ($(call isTargetOs, aix), true)
94 ADLCFLAGS += -DAIX=1
95 else ifeq ($(call isTargetOs, macosx), true)
96 ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1
97 endif
98
99 ifeq ($(call isTargetOs, windows), false)
100 # NOTE: Windows adlc flags was different in the old build. Is this really
101 # correct?
102
103 # -g makes #line directives in the generated C++ files.
104 ADLCFLAGS += -g
105
106 ADLCFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)=1
107 endif
108
109 # This generates checks in the generated C++ files that _LP64 is correctly
110 # (un)defined when compiling them.
111 ifeq ($(call isTargetCpuBits, 64), true)
112 ADLCFLAGS += -D_LP64=1
|
1 #
2 # Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
23 # questions.
24 #
25
26 $(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcAdlc.gmk))
27
28 ifeq ($(call check-jvm-feature, compiler2), true)
29
30 ADLC_SUPPORT_DIR := $(JVM_SUPPORT_DIR)/adlc
31
32 ##############################################################################
33 # Build the ad compiler (the adlc build tool)
34
35 # Flags depending on the build platform/tool chain
36 # NOTE: No optimization or debug flags set here
37 ifeq ($(call isBuildOs, linux), true)
38 ADLC_CFLAGS := -fno-exceptions -DLINUX
39 else ifeq ($(call isBuildOs, aix), true)
40 ADLC_LDFLAGS := -q64
41 ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
42 else ifeq ($(call isBuildOs, windows), true)
43 ADLC_LDFLAGS := -nologo
44 ADLC_CFLAGS := -nologo -EHsc
45 # NOTE: The old build also have -D_CRT_SECURE_NO_DEPRECATE but it doesn't
46 # seem needed any more.
47 ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
48 endif
49
50 # Set the C++ standard if supported
51 ADLC_CFLAGS += $(ADLC_CXXFLAG)
52
53 # NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
54 # hurt.
55 ADLC_CFLAGS += -DASSERT
56
57 ADLC_CFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)
58
67 CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
68 LDFLAGS := $(ADLC_LDFLAGS), \
69 LIBS := $(ADLC_LIBS), \
70 OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
71 OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
72 DEBUG_SYMBOLS := false, \
73 DISABLED_WARNINGS_clang := tautological-compare, \
74 ))
75
76 ADLC_TOOL := $(BUILD_ADLC_TARGET)
77
78 ##############################################################################
79 # Transform the ad source files into C++ source files using adlc
80
81 # Setup flags for the adlc build tool (ADLCFLAGS).
82 ADLCFLAGS += -q -T
83
84 # ADLC flags depending on target OS
85 ifeq ($(call isTargetOs, linux), true)
86 ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1
87 else ifeq ($(call isTargetOs, aix), true)
88 ADLCFLAGS += -DAIX=1
89 else ifeq ($(call isTargetOs, macosx), true)
90 ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1
91 endif
92
93 ifeq ($(call isTargetOs, windows), false)
94 # NOTE: Windows adlc flags was different in the old build. Is this really
95 # correct?
96
97 # -g makes #line directives in the generated C++ files.
98 ADLCFLAGS += -g
99
100 ADLCFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)=1
101 endif
102
103 # This generates checks in the generated C++ files that _LP64 is correctly
104 # (un)defined when compiling them.
105 ifeq ($(call isTargetCpuBits, 64), true)
106 ADLCFLAGS += -D_LP64=1
|