Building openjdk 8 on Mac OS X
David Chase
david.r.chase at oracle.com
Wed Jan 7 15:27:16 UTC 2015
For reference, with version numbers, here is what worked for me this morning,
for both release and fastdebug builds (including closed bits):
I'm on Mavericks (10.9.5),
using Xcode 4.6.3, (sudo xcode-select -s /Applications/Xcode4.6.3.app/Contents/Developer)
MacPorts lipo (it works, put it earlier on your path because hotspot build references "lipo" with no fancy variables)
PATH=/opt/local/bin:/Users/dr2chase/work/graal/mxtool:/Users/dr2chase/bin:/usr/bin:/opt/local/sbin:/usr/local/bin:/usr/local/CrossPack-AVR/bin:/usr/sbin:/bin:/sbin
Note that I pick up a lot of stuff from MacPorts, and that has been known to solve some problems in the past even though it is not officially recommended:
spec.gmk:PACKAGE_PATH=/opt/local
spec.gmk:AR:= /opt/local/bin/ar
spec.gmk:NM:=/opt/local/bin/nm
spec.gmk:GNM:=/opt/local/bin/nm
spec.gmk:STRIP:=/opt/local/bin/strip
spec.gmk:LIPO:=/opt/local/bin/lipo
spec.gmk:POST_STRIP_CMD:=/opt/local/bin/strip -S
spec.gmk:NAWK:=/opt/local/bin/gawk
spec.gmk:SED:=/opt/local/bin/gsed
spec.gmk:OTOOL:=/opt/local/bin/otool
spec.gmk:READELF:=/opt/local/bin/greadelf
spec.gmk:FILE:=/opt/local/bin/file
spec.gmk:HG:=/opt/local/bin/hg
spec.sh:SED="/opt/local/bin/gsed"
spec.sh:POST_STRIP_CMD="/opt/local/bin/strip -S"
and did this change to SALIBS:
SALIBS = -isysroot /Applications/Xcode4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
( or perhaps better:
SALIBS = -isysroot `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -g -framework Foundation -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework JavaNativeFoundation -framework Security -framework CoreFoundation
)
bash configure --with-extra-cflags="-isysroot /Applications/Xcode4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F/Applications/Xcode4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks" --with-extra-cxxflags="-isysroot /Applications/Xcode4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F/Applications/Xcode4.6.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks"
( or perhaps better:
bash configure --with-extra-cflags="-isysroot `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks" --with-extra-cxxflags="-isysroot `xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F`xcode-select -p`/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks"
)
MACOSX_DEPLOYMENT_TARGET=10.8 make MACOSX_DEPLOYMENT_TARGET=10.8 images CONF=fastdebug
and it built and it worked, at least once.
I have not tested this on 10.8 or 10.10 (yet).
David
On 2015-01-07, at 2:57 AM, Wang Weijun <weijun.wang at oracle.com> wrote:
> Advices from Denis and Na (were in this thread, quoted at the end), and
>
> 1. MACOSX_DEPLOYMENT_TARGET is also necessary for make
>
> 2. I need an extra configure argument
>
> --with-tools-dir=/Applications/Xcode4.app/Contents/Developer/usr/bin
>
> 3. When applying Na's patch, make sure to use Xcode4.app if that's what your path is.
>
> With these, I am able to build the latest jdk8u-dev forest.
>
> --Max
>
> ----------Advice from Denis--------------
>
> Steps:
>
> 1. Download and save in some secure place Xcode4.6
> 2. Make a link form Xcode.4 lipo to /usr/bin/lipo
> 3. Set MACOSX_DEPLOYMENT_TARGET enviroment variable to 10.8
> 4. Execute configure like this
>
> sh configure --with-freetype=/Volumes/HD-PATU3/tools/freetype-2.4.0/ --with-extra-cflags="-isysroot /Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F/Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks" --with-extra-cxxflags="-isysroot /Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -F/Applications/Xcode4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks" --with-boot-jdk=/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/
>
> Thank you,
> Denis.
>
> ---------------Advice from Na-----------------
>
> You need to patch /hotspot/make/bsd/makefiles/saproc.make to make it use
> 10.8sdk instead of system library in Yosemite.
>
> - SALIBS = -g -framework Foundation
> -F/System/Library/Frameworks/JavaVM.framework/Frameworks
> -framework JavaNativeFoundation -framework Security -framework CoreFoundation
>
> + SALIBS = -isysroot
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
> /Developer/SDKs/MacOSX10.8.sdk
> -g -framework Foundation
> -F/System/Library/Frameworks/JavaVM.framework/Frameworks -framework
> JavaNativeFoundation -framework Security -framework CoreFoundation
>
> ----------------end-----------------
>
>> On Jan 7, 2015, at 11:58, Manas Thakur <manasthakur17 at gmail.com> wrote:
>>
>> Hi Toby,
>>
>> Can you please share all those patches that you needed to do in order to successfully build jdk8 (or jdk8u) on MAC OS X Yosemite?
>>
>> Regards,
>> Manas
More information about the build-dev
mailing list