Issue cross-compiling idk 8 for powerpc

Aleksey Shipilev shipilev at amazon.de
Wed Aug 7 18:10:37 UTC 2024


On 07.08.24 19:39, Aleksey Shipilev wrote:
> On 07.08.24 19:30, Kurt Stine wrote:
>> No, I am still unable to cross-compile jdk8u for ppc32. I was able to get the latest community 
>> ppc32 build from Azul, but it isn’t the latest/most up-to-date version.
> 
> I used to build PPC32 binaries for JDK 8u with debootstrapped sysroots and native cross-compiler:
>   https://github.com/openjdk/jdk/blob/master/doc/building.md#using-debian-debootstrap

Found my old build scripts. Just did the following on https://github.com/openjdk/jdk8u-dev/, and it 
worked.

=== 1. Apply this patch:

diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh
index 71fabf4dbb..cc27b99c0e 100644
--- a/common/autoconf/generated-configure.sh
+++ b/common/autoconf/generated-configure.sh
@@ -48239,6 +48239,10 @@ $as_echo "$as_me: The path of FREETYPE_INCLUDE_PATH, which resolves as 
\"$path\"
        fi
      fi

+    if test "x$SYSROOT" != x; then
+      FREETYPE_CFLAGS="$FREETYPE_CFLAGS --sysroot $SYSROOT"
+    fi
+
      if test "x$FREETYPE_LIBS" = x; then

    if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
diff --git a/common/autoconf/libraries.m4 b/common/autoconf/libraries.m4
index 6efae578ea..c39cb08dac 100644
--- a/common/autoconf/libraries.m4
+++ b/common/autoconf/libraries.m4
@@ -578,6 +578,10 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
        fi
      fi

+    if test "x$SYSROOT" != x; then
+      FREETYPE_CFLAGS="$FREETYPE_CFLAGS --sysroot $SYSROOT"
+    fi
+
      if test "x$FREETYPE_LIBS" = x; then
        BASIC_FIXUP_PATH(FREETYPE_LIB_PATH)
        if test "x$OPENJDK_TARGET_OS" = xwindows; then


=== 2. Debootstrap the sysroot: (you might be lucky with the sysroot you already have)
  https://github.com/openjdk/jdk/blob/master/doc/building.md#using-debian-debootstrap

=== 3. Configure with:

Assumes sysroot is at /chroots/powerpc/

$ CC=powerpc-linux-gnu-gcc CXX=powerpc-linux-gnu-g++ sh ./configure \
   --openjdk-target=powerpc-linux-gnu \
   --with-sysroot=/chroots/powerpc/ \
   --x-libraries=/chroots/powerpc/usr/lib/powerpc-linux-gnu/ \
   --with-freetype-lib=/chroots/powerpc/usr/lib/powerpc-linux-gnu/ \
   --with-freetype-include=/chroots/powerpc/usr/include/freetype2 \
   --with-boot-jdk=/home/shade/jdks/8u/ \
   --with-jvm-variants=zero \
   --with-extra-cflags=-Wno-error

=== 4. Build with:

$ make images

===  5. Enjoy:

$ ls build/linux-ppc-normal-zero-release/images/j2sdk-image/



Amazon Web Services Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597


More information about the build-dev mailing list