64-bit requirement
Weijun Wang
weijun.wang at oracle.com
Sun Jan 23 18:26:40 PST 2011
This is my command, no redefinition of ARCH or CC or CXX:
make \
ALLOW_DOWNLOADS=true \
SA_APPLE_BOOT_JAVA=true \
ALWAYS_PASS_TEST_GAMMA=true \
ALT_BOOTDIR=`/usr/libexec/java_home -v 1.6`
On the other hand, I made changes in hotspot and jdk's makefiles to remove some appearances of "64" words. In fact, no matter what ARCH you specify, the original build process always tries to make both 32 bit and 64 bit.
FYI, below are my diffs. I certainly know they are only workarounds for my 32 bit Core Duo MacBook, and should never be applied on any other platforms.
For hotspot:
diff --git a/make/Makefile b/make/Makefile
--- a/make/Makefile
+++ b/make/Makefile
@@ -457,7 +457,7 @@
# macosx universal builds
$(UNIVERSAL_LIPO_LIST):
- lipo -create -output $@ $(EXPORT_JRE_LIB_DIR)/{i386,amd64}/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@)
+ lipo -create -output $@ $(EXPORT_JRE_LIB_DIR)/i386/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@)
$(UNIVERSAL_COPY_LIST):
$(CP) $(EXPORT_JRE_LIB_DIR)/i386/$(subst $(EXPORT_JRE_LIB_DIR)/,,$@) $@
@@ -466,7 +466,7 @@
universal_product:
$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=32 all_product
- $(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 all_product
+ #$(QUIETLY) $(MAKE) ARCH_DATA_MODEL=64 all_product
$(MKDIR) -p $(EXPORT_JRE_LIB_DIR)/{client,server}
$(QUIETLY) $(MAKE) universalize
for jdk:
diff --git a/make/common/Defs-macosx.gmk b/make/common/Defs-macosx.gmk
--- a/make/common/Defs-macosx.gmk
+++ b/make/common/Defs-macosx.gmk
@@ -131,8 +131,8 @@
endif
LDFLAGS_COMMON += $(ZERO_ARCHFLAG)
else ifeq ($(ARCH),universal)
- CFLAGS_REQUIRED += -arch i386 -arch x86_64 -D_LITTLE_ENDIAN
- LDFLAGS_COMMON += -arch i386 -arch x86_64
+ CFLAGS_REQUIRED += -arch i386 -D_LITTLE_ENDIAN
+ LDFLAGS_COMMON += -arch i386
else
CFLAGS_REQUIRED = $(CFLAGS_REQUIRED_$(ARCH))
LDFLAGS_COMMON += $(LDFLAGS_COMMON_$(ARCH))
diff --git a/make/common/shared/Compiler-gcc.gmk b/make/common/shared/Compiler-gcc.gmk
--- a/make/common/shared/Compiler-gcc.gmk
+++ b/make/common/shared/Compiler-gcc.gmk
@@ -92,7 +92,7 @@
ifeq ($(ARCH), universal)
AR = $(CC)
- ARFLAGS = -nostdlib -r -arch i386 -arch x86_64 -o
+ ARFLAGS = -nostdlib -r -arch i386 -o
endif
endif
diff --git a/make/sun/xawt/Makefile b/make/sun/xawt/Makefile
--- a/make/sun/xawt/Makefile
+++ b/make/sun/xawt/Makefile
@@ -207,10 +207,9 @@
ifeq ($(PLATFORM), macosx)
CFLAGS_32=-arch i386
-SIZERS = $(SIZER).32 $(SIZER).64
-SIZERS_C = $(SIZER_32_C) $(SIZER_64_C)
-SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32 $(WRAPPER_GENERATOR_DIR)/sizes.64
-CFLAGS_64=-arch x86_64
+SIZERS = $(SIZER).32
+SIZERS_C = $(SIZER_32_C)
+SIZES = $(WRAPPER_GENERATOR_DIR)/sizes.32
else # !macosx
ifeq ($(ARCH_DATA_MODEL), 32)
SIZERS = $(SIZER).32
Thanks
Weijun
On Jan 24, 2011, at 7:09 AM, Alexander Strange wrote:
>
> On Jan 23, 2011, at 4:40 PM, Michael Hall wrote:
>
>>
>> On Jan 18, 2011, at 9:13 PM, Alexander Strange wrote:
>>
>>> Although it hasn't been tested recently, you may be able to compile for 32-bit only using by setting "ARCH=i386 CC=gcc-4.0 CXX=g++-4.0".
>>
>> So far you seem to end up in a darned if you do, darned if you don't situation with this.
>>
>> First I didn't figure anything out on the test_gamma problems. I saw somewhere where with JAVA_HOME set and a tweak to LD_LIBRARY_PATH you could get around problems. I had the JAVA_HOME but the LD_LIBRARY_PATH didn't seem to do any good. So I commented out all invocations of test_gamma in my Makefile to get around this.
>
> Sorry, I meant setting those in addition to the other variables in the build line on the wiki page, which fix the problems with test_gamma and so on.
>
> Note that we just removed the CC= CXX= from that command - it was there due to confusion over which shipped compilers supported -mstackrealign - and it can be removed here too. So just adding ARCH=i386 may get you as far as Weijun did.
>
> I'll investigate it myself soonish.
>
More information about the macosx-port-dev
mailing list