Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to crosscompile for ppc 32bits #2206

Closed
ntadas opened this issue Jun 15, 2018 · 7 comments
Closed

unable to crosscompile for ppc 32bits #2206

ntadas opened this issue Jun 15, 2018 · 7 comments
Labels

Comments

@ntadas
Copy link

ntadas commented Jun 15, 2018

I'm having some problems compiling the open j9 for ppc 32bits
I've followed these steps: https://github.com/eclipse/openj9/blob/master/buildenv/Build_Instructions_V8.md#2-get-the-source

after some time fighting with the configure options I was able to successfully run the configure with the extra options:
--openjdk-target=powerpc-fsl-linux --without-x --without-cups --without-alsa
I had to set also these environment variables:

export X11_NOT_NEEDED=yes
export CUPS_NOT_NEEDED=yes
export ALSA_NOT_NEEDED=yes

now I'm trying to do the actual compilation but I'm getting this error:

checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/local_disk/ntadas/jvm/openj9-openjdk-jdk8/build/linux-ppc-normal-server-release/vm/omr':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
gmake[3]: *** [CONFIGURE_SENTINEL_FILE] Error 1
gmake[2]: *** [configure] Error 2
gmake[1]: *** [run-preprocessors-j9] Error 2
make: *** [j9vm-build] Error 2

it seems that the new configures are loosing the information that this is being crossed compiled.
is this a known problem?

@DanHeidinga
Copy link
Member

I've never tried this before... the only platform I'm aware we do cross compiling for is arm. @JamesKingdon Any suggestions for dealing with cross-compiling?

If you meant to cross compile, use `--host'.
See `config.log' for more details

The error message suggests checking config.log for more details and setting the --host option. Have you tried that?

@ntadas
Copy link
Author

ntadas commented Jun 17, 2018

I've tried to replace the --openjdk-target=powerpc-fsl-linux with the --host and --target options (according to the configure help they do the same thing) and the result was the same.
please note the error is when compiling the omr (the --host should be when calling the configure of the omr). But this is done internally by the compilation of the j9.

if I check the omr config.log I see that its failing because it tries to execute a cross compiled binary (this because it doesn't know its a cross compilation)

configure:3394: checking whether the C compiler works
configure:3416: /homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc-fsl-linux/powerpc-fsl-linux-gcc    -m32 -mhard-float -mcpu=e500mc --sysroot=/homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/ppce500mc-fsl-linux -O2 -pipe -g -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c  >&5
configure:3420: $? = 0
configure:3468: result: yes
configure:3471: checking for C compiler default output file name
configure:3473: result: a.out
configure:3479: checking for suffix of executables
configure:3486: /homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc-fsl-linux/powerpc-fsl-linux-gcc -o conftest    -m32 -mhard-float -mcpu=e500mc --sysroot=/homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/ppce500mc-fsl-linux -O2 -pipe -g -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c  >&5
configure:3490: $? = 0
configure:3512: result:
configure:3534: checking whether we are cross compiling
configure:3542: /homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/x86_64-fslsdk-linux/usr/bin/powerpc-fsl-linux/powerpc-fsl-linux-gcc -o conftest    -m32 -mhard-float -mcpu=e500mc --sysroot=/homelocal/common/fsl-coriant/fsl/ppce500mc/18jan2/sysroots/ppce500mc-fsl-linux -O2 -pipe -g -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c  >&5
configure:3546: $? = 0
configure:3553: ./conftest
configure: line 3555: ./conftest: cannot execute binary file
configure:3557: $? = 126
configure:3564: error: in `/local_disk/ntadas/jvm/openj9-openjdk-jdk8/build/linux-ppc-normal-server-release/vm/omr':
configure:3566: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

If I change the cross_compiling=no to cross_compiling=yes in openj9-openjdk-jdk8/build/linux-ppc-normal-server-release/vm/omr/configure and run again the make profiles I gues a different error:

checking build system type... x86_64-pc-linux-gnu
checking OMR_BUILD_OS... linux
checking OMR_BUILD_ARCH... x86
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/local_disk/ntadas/jvm/openj9-openjdk-jdk8/build/linux-ppc-normal-server-release/vm/omr/tools':
configure: error: C compiler cannot create executables
See `config.log' for more details
gmake[4]: *** No rule to make target `pugixml', needed by `/hookgen'.  Stop.
gmake[4]: *** Waiting for unfinished jobs....
In file included from main.cpp:33:0:
HookGen.hpp:32:23: fatal error: pugixml.hpp: No such file or directory
 #include "pugixml.hpp"
                       ^
compilation terminated.
In file included from HookGen.cpp:33:0:
HookGen.hpp:32:23: fatal error: pugixml.hpp: No such file or directory
 #include "pugixml.hpp"
                       ^
compilation terminated.
gmake[4]: *** [main] Error 1
gmake[4]: *** [HookGen] Error 1
gmake[3]: *** [tools/hookgen] Error 2
gmake[2]: *** [buildhook] Error 2
gmake[2]: *** Waiting for unfinished jobs....
gmake[4]: o: Command not found
gmake[4]: o: Command not found
gmake[1]: *** [run-preprocessors-j9] Error 2

@JamesKingdon
Copy link
Contributor

Cross-compiling is only partially implemented. In particular we currently need to provide a build jdk as well as a boot jdk. The configure script I currently use for Java 10 for arm is

#!/bin/sh

BUILD_JDK=/root/buildjdk

TOOLCHAIN=/root/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf
#TOOLCHAIN=/root/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf

export PATH=$PATH:${TOOLCHAIN}/bin

bash ./configure --openjdk-target=arm-linux-gnueabihf --with-abi-profile=armv6-vfp-hflt  --with-x=${TOOLCHAIN}/arm-linux-gnueabihf/ --with-freetype=${TOOLCHAIN}/arm-linux-gnueabihf/libc/usr/ --with-freemarker-jar=/root/freemarker.jar --with-build-jdk=$BUILD_JDK --disable-warnings-as-errors --disable-ddr

I think the changes to support this ended up being fairly generic, but it's likely there is more we need to do for PPC

@ntadas
Copy link
Author

ntadas commented Jun 18, 2018

it seems that the omr doesn't support cross compilation.
at least in Java 8 version (I need to use Java 8)

@JamesKingdon
Copy link
Contributor

There was an attempt to cross compile Java 8 for arm, but we ran into a number of problems ( issue #712 ). It's likely that those problems will also impact a PPC cross compile for Java 8.

@ntadas
Copy link
Author

ntadas commented Jun 18, 2018

I really need Java 8, never the less I've tried to cross compile Java 10 to ppc 32bits and it also has problems.
I guess the only option I have is to try to compile it in the ppc target (not cross compile)

@DanHeidinga
Copy link
Member

Closing as this has been inactive for 2 years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants