Skip to content

Commit

Permalink
8338404: Cross-compilation to different endianness fails after JDK-83…
Browse files Browse the repository at this point in the history
…18913

Reviewed-by: erikj, fbredberg
  • Loading branch information
magicus committed Aug 30, 2024
1 parent b872718 commit bb28b0d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
17 changes: 15 additions & 2 deletions make/CreateJmods.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -229,8 +229,21 @@ ifeq ($(INTERIM_JMOD), true)
# Interim JMODs are not shipped anywhere, so there is no reason
# to compress them at all.
JMOD_FLAGS += --compress zip-0

JMOD_TARGET_OS := $(OPENJDK_BUILD_OS)
ifeq ($(JMOD_TARGET_OS), macosx)
JMOD_TARGET_OS := macos
endif

JMOD_TARGET_CPU := $(OPENJDK_BUILD_CPU)
ifeq ($(JMOD_TARGET_CPU), x86_64)
JMOD_TARGET_CPU := amd64
endif

JMOD_TARGET_PLATFORM := $(JMOD_TARGET_OS)-$(JMOD_TARGET_CPU)
else
JMOD_FLAGS += --compress $(JMOD_COMPRESS)
JMOD_TARGET_PLATFORM := $(OPENJDK_MODULE_TARGET_PLATFORM)
endif

# Create jmods in the support dir and then move them into place to keep the
Expand All @@ -242,7 +255,7 @@ $(eval $(call SetupExecute, create_$(JMOD_FILE), \
SUPPORT_DIR := $(JMODS_SUPPORT_DIR), \
PRE_COMMAND := $(RM) $(JMODS_DIR)/$(JMOD_FILE) $(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
COMMAND := $(JMOD) $(JMOD_SMALL_FLAGS) create --module-version $(VERSION_SHORT) \
--target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
--target-platform '$(JMOD_TARGET_PLATFORM)' \
--module-path $(JMODS_DIR) $(JMOD_FLAGS) \
--date $(SOURCE_DATE_ISO_8601) \
$(JMODS_SUPPORT_DIR)/$(JMOD_FILE), \
Expand Down
8 changes: 5 additions & 3 deletions make/InterimImage.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -46,10 +46,12 @@ $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE): $(JMODS) \
$(call DependOnVariable, INTERIM_MODULES_LIST)
$(call LogWarn, Creating interim jimage)
$(RM) -r $(INTERIM_IMAGE_DIR)
$(JLINK_TOOL) \
$(call MakeDir, $(INTERIM_IMAGE_DIR))
$(call ExecuteWithLog, $(INTERIM_IMAGE_DIR)/jlink, \
$(JLINK_TOOL) \
--output $(INTERIM_IMAGE_DIR) \
--disable-plugin generate-jli-classes \
--add-modules $(INTERIM_MODULES_LIST)
--add-modules $(INTERIM_MODULES_LIST))
$(TOUCH) $@

TARGETS += $(INTERIM_IMAGE_DIR)/$(JIMAGE_TARGET_FILE)
Expand Down

0 comments on commit bb28b0d

Please sign in to comment.