Just An Application

November 23, 2009

Bootstrapping OpenJDK 7 On Snow Leopard: The 32-Bit Version

Filed under: Java, MacOSX, OpenJDK7, Snow Leopard — Tags: , , — Simon Lewis @ 8:56 pm

The process described here builds a 64-bit version of OpenJDK 7.

The same process can also be used to build a 32-bit version but there are a couple of important differences.

Simply changing the value of

    ARCH_DATA_MODEL

to

    32

will trigger a number of compilation issues whilest building Hotspot. They are only warnings, but the build is set-up to treat all warnings as fatal.

The issues can be fixed such that the warnings go away and the build completes, but unlike the 64-bit version the resulting SDK does not work properly, and is pretty much unusable.

There is, however an easy fix. Using earlier versions of gcc and g++ than the Snow Leopard default versions results in a working SDK.

The versions can be specified using variables passed to make in the build script as follows


    make \
        ARCH_DATA_MODEL=32                         \
        LANG=C                                     \
        ALT_BOOTDIR=$JDK6_HOME                     \
        ALT_FREETYPE_HEADERS_PATH=/usr/X11/include \
        ALT_FREETYPE_LIB_PATH=/usr/X11/lib         \
        NO_DOCS=true                               \
        CC=gcc-4.0                                 \
        CXX=g++-4.0                                \
        $@

where

    $JDK6_HOME

specifies the location of the ersatz JDK6 directory.


Copyright (c) 2009 By Simon Lewis. All Rights Reserved.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: