Successful cross-compile from 32bit-linux to 64bit-linux

Fredrik Öhrström fredrik.ohrstrom at oracle.com
Fri Mar 23 15:58:44 UTC 2012


With my latest small pushes to build-infra/jdk8-hotspot-jdk
the build-infra forest can successfully cross compile from
32bit-linux to 64bit-linux and vice versa.

Some of the final problems were to set HOSTCC,HOST_CC and NIO_CC to
be the compiler that compiles code for the build platform.

Strip away the ARCHFLAG from the CFLAGS and LDFLAGS when
building the adlc tool.

And finally, navigate through the minefield of the strings:
i386,i486,i586,i686,amd64 and x86_64 that are used in the hotspot
makefiles, to get docs in the right dir when cross compiling.

../autoconf/configure --host=x86_64-unknown-linux-gnu
--with-builddeps-conf=/localdisk/yourdir/jdk8/common/autoconf/builddeps.conf.example
--with-builddeps-server=buildtools.se.oracle.com/buildtools/openjdk
--with-builddeps-dir=/localdisk/yourdir/builddeps --with-jvm-variants=server

../autoconf/configure --host=i686-unknown-linux-gnu
--with-builddeps-conf=/localdisk/yourdir/jdk8/common/autoconf/builddeps.conf.example
--with-builddeps-server=buildtools.se.oracle.com/buildtools/openjdk
--with-builddeps-dir=/localdisk/yourdir/builddeps --with-jvm-variants=server

For those outside of oracle, it should work without builddeps as long
as you have created a cross-compiler toolchain like
i686-unknown-linux-gnu-gcc et al
and put it in the path and supplied a correct sys-root with the
configure option --with-sys-root=....

//Fredrik




More information about the build-dev mailing list