< prev index next >

make/Images.gmk

Print this page

  1 #
  2 # Copyright (c) 2014, 2023, 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

155           -$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
156   ))
157 
158   JDK_TARGETS += $$($1_$2_gen_cds_archive_jdk)
159 
160   $$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jre, \
161       WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jre image for $1, \
162       INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
163       DEPS := $$(jlink_jre), \
164       OUTPUT_FILE := $$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
165       SUPPORT_DIR := $$(JRE_IMAGE_SUPPORT_DIR), \
166       COMMAND := $$(FIXPATH) $$(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
167           -XX:SharedArchiveFile=$$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
168           -$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
169   ))
170 
171   JRE_TARGETS += $$($1_$2_gen_cds_archive_jre)
172 endef
173 
174 ifeq ($(BUILD_CDS_ARCHIVE), true)
































175   $(foreach v, $(JVM_VARIANTS), \
176     $(eval $(call CreateCDSArchive,$v,)) \
177   )
178 
179   ifeq ($(call isTargetCpuBits, 64), true)
180     $(foreach v, $(JVM_VARIANTS), \
181       $(eval $(call CreateCDSArchive,$v,_nocoops)) \
182     )
183   endif
184 endif
185 
186 ################################################################################
187 # src.zip
188 
189 $(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
190 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
191 	$(install-file)
192 
193 JDK_TARGETS += $(JDK_IMAGE_DIR)/lib/src.zip
194 

  1 #
  2 # Copyright (c) 2014, 2024, 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

155           -$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
156   ))
157 
158   JDK_TARGETS += $$($1_$2_gen_cds_archive_jdk)
159 
160   $$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jre, \
161       WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jre image for $1, \
162       INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
163       DEPS := $$(jlink_jre), \
164       OUTPUT_FILE := $$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
165       SUPPORT_DIR := $$(JRE_IMAGE_SUPPORT_DIR), \
166       COMMAND := $$(FIXPATH) $$(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
167           -XX:SharedArchiveFile=$$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
168           -$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
169   ))
170 
171   JRE_TARGETS += $$($1_$2_gen_cds_archive_jre)
172 endef
173 
174 ifeq ($(BUILD_CDS_ARCHIVE), true)
175 
176 CLASSLIST_REFRESH := $(SUPPORT_OUTPUTDIR)/images/jdk/classlist.refresh
177 
178 # The classlist generated by GenerateLinkOptData.gmk uses the Holder classes from
179 # the intermin image, which are different than the ones in the final JDK image. So
180 # we need to generate the images/jdk/lib/classlist again, or else the @cp indices
181 # in the classlist will be incorrect.
182 #
183 # We also make sure that all @lambda-form-invoker lines are copied to the new classlist.
184 #
185 # FIXME: it's better to do this inside GenerateLinkOptData.gmk, but I don't know how ....
186 $(CLASSLIST_REFRESH): $(jlink_jdk)
187 	$(call LogWarn, Refresh classlist for jdk image)
188 	$(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:off \
189             -XX:DumpLoadedClassList=$@.raw \
190 	    -Duser.language=en -Duser.country=US \
191 	    -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
192 	    build.tools.classlist.HelloClasslist \
193 	    2> $@.stderr > $@.stdout
194 	$(CAT) $@.raw \
195 	    | $(GREP) -v HelloClasslist \
196 	    > $@.raw.2
197 	$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
198 	    -cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
199 	    build.tools.classlist.SortClasslist $@.raw.2 > $@
200 	$(CP) $(JDK_IMAGE_DIR)/lib/classlist $(JDK_IMAGE_DIR)/lib/classlist.saved
201 	cat $@ | $(GREP) -v '@lambda-form-invoker' > $(JDK_IMAGE_DIR)/lib/classlist
202 	cat $@ $(JDK_IMAGE_DIR)/lib/classlist.saved | $(GREP) '@lambda-form-invoker' \
203 	    | sort | uniq >> $(JDK_IMAGE_DIR)/lib/classlist
204 
205 JDK_TARGETS += $(CLASSLIST_REFRESH)
206 
207   $(foreach v, $(JVM_VARIANTS), \
208     $(eval $(call CreateCDSArchive,$v,)) \
209   )
210 
211   ifeq ($(call isTargetCpuBits, 64), true)
212     $(foreach v, $(JVM_VARIANTS), \
213       $(eval $(call CreateCDSArchive,$v,_nocoops)) \
214     )
215   endif
216 endif
217 
218 ################################################################################
219 # src.zip
220 
221 $(JDK_IMAGE_DIR)/lib/src.zip: $(SUPPORT_OUTPUTDIR)/src.zip
222 	$(call LogInfo, Copying $(patsubst $(OUTPUTDIR)/%,%,$@))
223 	$(install-file)
224 
225 JDK_TARGETS += $(JDK_IMAGE_DIR)/lib/src.zip
226 
< prev index next >