1
1
# ===========================================================================
2
- # (c) Copyright IBM Corp. 2018, 2022 All Rights Reserved
2
+ # (c) Copyright IBM Corp. 2018, 2025 All Rights Reserved
3
3
# ===========================================================================
4
4
# This code is free software; you can redistribute it and/or modify it
5
5
# under the terms of the GNU General Public License version 2 only, as
24
24
# * compile tools
25
25
# * generate java pointer source files
26
26
# * generate java structure stub source files
27
- # * generate pointer and structure stub class files
28
27
# - compile_check
28
+ # * generate pointer and structure stub class files
29
29
# * compile DDR_VM source with the generated class files from above
30
30
# ===========================================================================
31
31
@@ -41,8 +41,9 @@ include $(SPEC)
41
41
include $(TOPDIR)/make/common/MakeBase.gmk
42
42
include $(TOPDIR)/make/common/JavaCompilation.gmk
43
43
44
- # The main source directory.
45
- DDR_VM_SRC_ROOT := $(OPENJ9_TOPDIR)/debugtools/DDR_VM/src
44
+ # The main source directories.
45
+ DDR_VM_SRC_ROOT_BOOT := $(J9JCL_SOURCES_DIR)/ddr/interim
46
+ DDR_VM_SRC_ROOT_NEW := $(J9JCL_SOURCES_DIR)/openj9.dtfj/share/classes
46
47
47
48
# The top-level directory for intermediate artifacts.
48
49
DDR_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/ddr
@@ -54,7 +55,8 @@ DDR_SUPERSET_FILE := $(OUTPUTDIR)/vm/superset.dat
54
55
# Where to write class files.
55
56
DDR_CLASSES_BIN := $(DDR_SUPPORT_DIR)/classes
56
57
DDR_TEST_BIN := $(DDR_SUPPORT_DIR)/test
57
- DDR_TOOLS_BIN := $(DDR_SUPPORT_DIR)/tools
58
+ DDR_TOOLS_BIN_BOOT := $(DDR_SUPPORT_DIR)/tools-interim
59
+ DDR_TOOLS_BIN_NEW := $(DDR_SUPPORT_DIR)/tools
58
60
59
61
# Where to write generated source files.
60
62
DDR_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/openj9.dtfj
@@ -64,34 +66,48 @@ DDR_CLASSES_MARKER := $(DDR_SUPPORT_DIR)/classes.done
64
66
DDR_POINTERS_MARKER := $(DDR_SUPPORT_DIR)/gensrc-pointers.done
65
67
DDR_STRUCTURES_MARKER := $(DDR_SUPPORT_DIR)/gensrc-structures.done
66
68
69
+ # The list of source files that must be compiled
70
+ # (for either the source or class generation steps).
71
+ DDR_TOOLS_SOURCE_FILES := \
72
+ com/ibm/j9ddr/BytecodeGenerator.java \
73
+ com/ibm/j9ddr/CTypeParser.java \
74
+ com/ibm/j9ddr/StructureHeader.java \
75
+ com/ibm/j9ddr/StructureReader.java \
76
+ com/ibm/j9ddr/StructureTypeManager.java \
77
+ com/ibm/j9ddr/logging/LoggerNames.java \
78
+ com/ibm/j9ddr/tools/ClassGenerator.java \
79
+ com/ibm/j9ddr/tools/FlagStructureList.java \
80
+ com/ibm/j9ddr/tools/PointerGenerator.java \
81
+ com/ibm/j9ddr/tools/StructureStubGenerator.java \
82
+ com/ibm/j9ddr/tools/store/J9DDRStructureStore.java \
83
+ com/ibm/j9ddr/tools/store/StructureKey.java \
84
+ com/ibm/j9ddr/tools/store/StructureMismatchError.java \
85
+ #
86
+
67
87
#############################################################################
68
88
69
- # Build the tools we will need .
70
- $(eval $(call SetupJavaCompilation,BUILD_DDR_TOOLS , \
89
+ # Build the tools for use with the boot JDK .
90
+ $(eval $(call SetupJavaCompilation,BUILD_DDR_TOOLS_BOOT , \
71
91
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
72
- BIN := $(DDR_TOOLS_BIN ), \
92
+ BIN := $(DDR_TOOLS_BIN_BOOT ), \
73
93
CLASSPATH := $(JDK_OUTPUTDIR)/modules/java.base, \
74
94
JAVAC_FLAGS := --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED, \
75
- SRC := $(DDR_VM_SRC_ROOT), \
76
- INCLUDE_FILES := \
77
- com/ibm/j9ddr/BytecodeGenerator.java \
78
- com/ibm/j9ddr/CTypeParser.java \
79
- com/ibm/j9ddr/StructureHeader.java \
80
- com/ibm/j9ddr/StructureReader.java \
81
- com/ibm/j9ddr/StructureTypeManager.java \
82
- com/ibm/j9ddr/logging/LoggerNames.java \
83
- com/ibm/j9ddr/tools/ClassGenerator.java \
84
- com/ibm/j9ddr/tools/FlagStructureList.java \
85
- com/ibm/j9ddr/tools/PointerGenerator.java \
86
- com/ibm/j9ddr/tools/StructureStubGenerator.java \
87
- com/ibm/j9ddr/tools/store/J9DDRStructureStore.java \
88
- com/ibm/j9ddr/tools/store/StructureKey.java \
89
- com/ibm/j9ddr/tools/store/StructureMismatchError.java \
95
+ SRC := $(DDR_SUPPORT_DIR)/interim, \
96
+ INCLUDE_FILES := $(DDR_TOOLS_SOURCE_FILES), \
97
+ ))
98
+
99
+ # Build the tools for use with the new JDK.
100
+ $(eval $(call SetupJavaCompilation,BUILD_DDR_TOOLS_NEW, \
101
+ TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
102
+ BIN := $(DDR_TOOLS_BIN_NEW), \
103
+ CLASSPATH := $(JDK_OUTPUTDIR)/modules/java.base, \
104
+ SRC := $(DDR_VM_SRC_ROOT_NEW), \
105
+ INCLUDE_FILES := $(DDR_TOOLS_SOURCE_FILES), \
90
106
))
91
107
92
108
# Any new references to constants must be paired with additions to the compatibility
93
109
# list unless those constants were defined long ago.
94
- DDR_COMPATIBILITY_FILE := $(DDR_VM_SRC_ROOT )/com/ibm/j9ddr/CompatibilityConstants29.dat
110
+ DDR_COMPATIBILITY_FILE := $(DDR_VM_SRC_ROOT_NEW )/com/ibm/j9ddr/CompatibilityConstants29.dat
95
111
96
112
#############################################################################
97
113
@@ -101,28 +117,33 @@ DDR_COMPATIBILITY_FILE := $(DDR_VM_SRC_ROOT)/com/ibm/j9ddr/CompatibilityConstant
101
117
# might be included: Patching openj9.dtfj fixes that. We use FixPath because
102
118
# fixpath.sh would only fix the first entry of the path.
103
119
DDR_PATH_SEP := $(if $(filter $(OPENJDK_BUILD_OS),windows),;,:)
104
- DDR_TOOLS_PATHLIST := "$(call FixPath,$(DDR_TOOLS_BIN))$(DDR_PATH_SEP)$(call FixPath,$(DDR_VM_SRC_ROOT))"
105
- DDR_TOOLS_OPTIONS := \
106
- -cp $(DDR_TOOLS_PATHLIST) \
107
- --patch-module=openj9.dtfj=$(DDR_TOOLS_PATHLIST)
120
+
121
+ DDR_TOOLS_PATHLIST_BOOT := "$(call FixPath,$(DDR_TOOLS_BIN_BOOT))$(DDR_PATH_SEP)$(call FixPath,$(DDR_VM_SRC_ROOT_BOOT))"
122
+ DDR_TOOLS_OPTIONS_BOOT := \
123
+ -cp $(DDR_TOOLS_PATHLIST_BOOT) \
124
+ --patch-module=openj9.dtfj=$(DDR_TOOLS_PATHLIST_BOOT)
125
+
126
+ DDR_TOOLS_PATHLIST_NEW := "$(call FixPath,$(DDR_TOOLS_BIN_NEW))$(DDR_PATH_SEP)$(call FixPath,$(DDR_VM_SRC_ROOT_NEW))"
127
+ DDR_TOOLS_OPTIONS_NEW := \
128
+ -cp $(DDR_TOOLS_PATHLIST_NEW) \
129
+ --patch-module=openj9.dtfj=$(DDR_TOOLS_PATHLIST_NEW)
108
130
109
131
# Only fields listed in this file can be directly accessed by hand-written DDR code;
110
132
# its contents influence the generated class files.
111
- DDR_FIELDS_FILE := $(DDR_VM_SRC_ROOT )/com/ibm/j9ddr/AuxFieldInfo29.dat
133
+ DDR_FIELDS_FILE := $(DDR_VM_SRC_ROOT_NEW )/com/ibm/j9ddr/AuxFieldInfo29.dat
112
134
113
- $(DDR_CLASSES_MARKER) : $(DDR_BLOB_FILE) $(DDR_COMPATIBILITY_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS )
135
+ $(DDR_CLASSES_MARKER) : $(DDR_BLOB_FILE) $(DDR_COMPATIBILITY_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS_NEW )
114
136
@$(ECHO) Generating DDR pointer and structure class files
115
137
@$(RM) -rf $(DDR_CLASSES_BIN)
116
- @$(JAVA) $(DDR_TOOLS_OPTIONS) \
117
- --add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
138
+ @$(JDK_OUTPUTDIR)/bin/java $(DDR_TOOLS_OPTIONS_NEW) \
118
139
com.ibm.j9ddr.tools.ClassGenerator \
119
140
--blob=$(DDR_BLOB_FILE) \
120
141
--out=$(DDR_CLASSES_BIN)
121
142
@$(TOUCH) $@
122
143
123
- $(DDR_POINTERS_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS )
144
+ $(DDR_POINTERS_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS_BOOT )
124
145
@$(ECHO) Generating DDR pointer class source files
125
- @$(JAVA) $(DDR_TOOLS_OPTIONS ) com.ibm.j9ddr.tools.PointerGenerator \
146
+ @$(JAVA) $(DDR_TOOLS_OPTIONS_BOOT ) com.ibm.j9ddr.tools.PointerGenerator \
126
147
-a $(DDR_FIELDS_FILE) \
127
148
-f $(dir $(DDR_SUPERSET_FILE)) \
128
149
-s $(notdir $(DDR_SUPERSET_FILE)) \
@@ -133,9 +154,9 @@ $(DDR_POINTERS_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOO
133
154
134
155
DDR_RESTRICT_FILE := $(OPENJ9_TOPDIR)/debugtools/DDR_VM/data/superset-constants.dat
135
156
136
- $(DDR_STRUCTURES_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_RESTRICT_FILE) $(DDR_COMPATIBILITY_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS )
157
+ $(DDR_STRUCTURES_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_RESTRICT_FILE) $(DDR_COMPATIBILITY_FILE) $(DDR_FIELDS_FILE) $(BUILD_DDR_TOOLS_BOOT )
137
158
@$(ECHO) Generating DDR structure stub source files
138
- @$(JAVA) $(DDR_TOOLS_OPTIONS ) com.ibm.j9ddr.tools.StructureStubGenerator \
159
+ @$(JAVA) $(DDR_TOOLS_OPTIONS_BOOT ) com.ibm.j9ddr.tools.StructureStubGenerator \
139
160
-f $(dir $(DDR_SUPERSET_FILE)) \
140
161
-s $(notdir $(DDR_SUPERSET_FILE)) \
141
162
-p com.ibm.j9ddr.vm29.structure \
@@ -150,9 +171,9 @@ $(DDR_STRUCTURES_MARKER) : $(DDR_SUPERSET_FILE) $(DDR_RESTRICT_FILE) $(DDR_COMPA
150
171
# or StructureStubGenerator) has already done so:
151
172
# /usr/bin/cp: cannot create directory 'support/gensrc/openj9.dtfj/com/ibm/j9ddr/vm29': File exists
152
173
# To avoid that problem, we insist that $(CP) runs before the other tasks.
153
- $(DDR_POINTERS_MARKER) $(DDR_STRUCTURES_MARKER) : $(call FindFiles,$(DDR_VM_SRC_ROOT ))
174
+ $(DDR_POINTERS_MARKER) $(DDR_STRUCTURES_MARKER) : $(call FindFiles, $(DDR_VM_SRC_ROOT_NEW ))
154
175
155
- generate : $(DDR_CLASSES_MARKER) $( DDR_POINTERS_MARKER) $(DDR_STRUCTURES_MARKER)
176
+ generate : $(DDR_POINTERS_MARKER) $(DDR_STRUCTURES_MARKER)
156
177
157
178
#############################################################################
158
179
@@ -171,7 +192,7 @@ $(eval $(call SetupJavaCompilation,BUILD_J9DDR_TEST_CLASSES, \
171
192
--system none, \
172
193
BIN := $(DDR_TEST_BIN), \
173
194
CLASSPATH := $(DDR_CLASSES_BIN), \
174
- SRC := $(J9JCL_SOURCES_DIR)/openj9.dtfj/share/classes \
195
+ SRC := $(DDR_VM_SRC_ROOT_NEW) \
175
196
))
176
197
177
198
.PHONY : compile_check
0 commit comments