7200065: Cross-compilation changes to support the new-build
Reviewed-by: dholmes, ohair
Contributed-by: Fredrik Ohrstrom <fredrik.ohrstrom@oracle.com>
--- a/hotspot/make/linux/makefiles/adlc.make Mon Sep 24 20:04:19 2012 -0700
+++ b/hotspot/make/linux/makefiles/adlc.make Tue Sep 25 07:58:42 2012 -0400
@@ -109,7 +109,7 @@
$(EXEC) : $(OBJECTS)
@echo Making adlc
- $(QUIETLY) $(HOST.LINK_NOPROF.CXX) -o $(EXEC) $(OBJECTS)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.LINK_NOPROF.CXX)) -o $(EXEC) $(OBJECTS)
# Random dependencies:
$(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
@@ -213,14 +213,14 @@
$(OUTDIR)/%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.COMPILE.CXX)) -o $@ $< $(COMPILE_DONE)
# Some object files are given a prefix, to disambiguate
# them from objects of the same name built for the VM.
$(OUTDIR)/adlc-%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.COMPILE.CXX)) -o $@ $< $(COMPILE_DONE)
# #########################################################################
--- a/hotspot/make/linux/makefiles/defs.make Mon Sep 24 20:04:19 2012 -0700
+++ b/hotspot/make/linux/makefiles/defs.make Tue Sep 25 07:58:42 2012 -0400
@@ -29,8 +29,14 @@
SLASH_JAVA ?= /java
# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
-ARCH:=$(shell uname -m)
-PATH_SEP = :
+
+# ARCH can be set explicitly in spec.gmk
+ifndef ARCH
+ ARCH := $(shell uname -m)
+endif
+
+PATH_SEP ?= :
+
ifeq ($(LP64), 1)
ARCH_DATA_MODEL ?= 64
else
@@ -72,8 +78,8 @@
HS_ARCH = sparc
endif
-# x86_64
-ifeq ($(ARCH), x86_64)
+# amd64/x86_64
+ifneq (,$(findstring $(ARCH), amd64 x86_64))
ifeq ($(ARCH_DATA_MODEL), 64)
ARCH_DATA_MODEL = 64
MAKE_ARGS += LP64=1
@@ -90,8 +96,8 @@
endif
endif
-# i686
-ifeq ($(ARCH), i686)
+# i686/i586 ie 32-bit x86
+ifneq (,$(findstring $(ARCH), i686 i586))
ARCH_DATA_MODEL = 32
PLATFORM = linux-i586
VM_PLATFORM = linux_i486