From 3dffa4cf308bf060212c3c2af167420bfe943b95 Mon Sep 17 00:00:00 2001 From: James Kingdon Date: Sun, 26 Nov 2017 09:01:56 -0500 Subject: [PATCH] Add support for buildspec linux_arm_docker Added a new buildspec for OpenJDK compiles on ARM (since the old buildspec is likely still needed for compiling IBM SDK and I couldn't see how to add conditional blocks to a buildspec). Signed-off-by: James Kingdon --- closed/OpenJ9.gmk | 10 +++++----- closed/autoconf/custom-hook.m4 | 2 +- closed/make/Main.gmk | 6 +++--- common/conf/jib-profiles.js | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 4f504a682f..7946db4460 100755 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -28,9 +28,9 @@ ifeq (,$(BUILD_ID)) BUILD_ID := 000000 endif -# 64 bit compressedrefs builds put some of the libraries in lib/compressedrefs. -# What's the appropriate directory for a 32 bit build? I've opted for 'default'. -ifeq (1,$(OPENJDK_DOCKER_CC_ARM)) # condition should be more specific to 32bit +# 64 bit compressedrefs builds put some of the libraries in lib/compressedrefs +# where as for 32 bit they should go in lib/default. +ifeq (xr32,$(OPENJ9_PLATFORM_CODE)) LIB_SUBDIR=default else LIB_SUBDIR=compressedrefs @@ -172,7 +172,7 @@ endef # ---------------------- # param 1 = The jdk/jre directory name # param 2 = The jdk/jre directory to add openj9 content -ifeq (1,$(OPENJDK_DOCKER_CC_ARM)) +ifeq (xr32,$(OPENJ9_PLATFORM_CODE)) define generated_target_rules .PHONY : stage_openj9_$1 $(foreach file,$(OPENJ9_SHARED_LIBRARIES),$(eval $(call openj9_copy_file,$2/$(OPENJ9_LIBS_OUTPUT_DIR)/$(LIB_SUBDIR)/$(file),$(OUTPUT_ROOT)/vm/$(file)))) @@ -250,7 +250,7 @@ define openj9_copy_tree_impl endef # Temporary fix until we work out how to handle the build_jdk for cross compiles -ifeq (1,$(OPENJDK_DOCKER_CC_ARM)) +ifeq (xr32,$(OPENJ9_PLATFORM_CODE)) $(info Cross compilation detected, skipping generated_target_rules_build) else $(eval $(call generated_target_rules_build,build_jdk,$(BUILD_JDK))) diff --git a/closed/autoconf/custom-hook.m4 b/closed/autoconf/custom-hook.m4 index 214eeeb56e..403062923b 100644 --- a/closed/autoconf/custom-hook.m4 +++ b/closed/autoconf/custom-hook.m4 @@ -191,7 +191,7 @@ AC_DEFUN_ONCE([OPENJ9_PLATFORM_SETUP], OPENJ9_PLATFORM_CODE=ap64 elif test "x$OPENJ9_CPU" = xarm; then OPENJ9_PLATFORM_CODE=xr32 - OPENJ9_BUILDSPEC=linux_arm + OPENJ9_BUILDSPEC=linux_arm_docker else AC_MSG_ERROR([Unsupported OpenJ9 cpu ${OPENJ9_CPU}, contact support team!]) fi diff --git a/closed/make/Main.gmk b/closed/make/Main.gmk index dddfa58a25..00b1721a70 100644 --- a/closed/make/Main.gmk +++ b/closed/make/Main.gmk @@ -30,10 +30,10 @@ j9vm-build : +($(CD) $(SRC_ROOT)/closed && $(MAKE) -f OpenJ9.gmk SPEC=$(SPEC) VERSION_MAJOR=$(VERSION_MAJOR) build-j9) j9vm-compose-buildjvm : j9vm-build -ifeq ($(OPENJDK_DOCKER_CC_ARM),1) - @$(ECHO) Cross compile detected, skipping stage_openj9_build_jdk -else +ifeq ($(OPENJDK_BUILD_CPU),$(OPENJDK_TARGET_CPU)) +($(CD) $(SRC_ROOT)/closed && $(MAKE) -f OpenJ9.gmk SPEC=$(SPEC) stage_openj9_build_jdk) +else + @$(ECHO) Cross compile detected, skipping stage_openj9_build_jdk endif product-images : openj9-jdk-image openj9-jre-image diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index 54ccfcecd5..83f458add1 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -928,6 +928,9 @@ var getJibProfilesDependencies = function (input, common) { linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0 ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0" : "arm-linaro-4.7+1.0") + linux_arm_docker: (input.profile != null && input.profile.indexOf("hflt") >= 0 + ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0" + : "arm-linaro-4.7+1.0") }; var devkit_platform = (input.target_cpu == "x86"