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

Compilation failures in omr/tools when cross compiling #1955

Closed
JamesKingdon opened this issue Nov 4, 2017 · 4 comments
Closed

Compilation failures in omr/tools when cross compiling #1955

JamesKingdon opened this issue Nov 4, 2017 · 4 comments
Assignees

Comments

@JamesKingdon
Copy link
Contributor

In the context of attempting an OpenJDK/OpenJ9 cross compile for arm 32 bit, the compilation fails in the tools directory. It appears the makefiles are picking up the 32 bit size of the target platform and applying it to the tools which are being compiled for the host. Since the host is 64 bit and not configured for multi-arch this fails with missing include files (note the -m32 in the options)

g++  -I.  -DUT_DIRECT_TRACE_REGISTRATION  -DLINUX -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DJ9X86 -c  -MMD -MP -fno-exceptions -fno-rtti -fno-threadsafe-statics -fpic -m32 -msse2 -I/usr/include/nptl -Wall -Wno-non-virtual-dtor -O3 -fno-strict-aliasing -march=pentium4 -mtune=prescott   -o FileReader.o FileReader.cpp
In file included from /usr/include/stdlib.h:24:0,
                 from FileReader.cpp:23:
/usr/include/features.h:367:25: fatal error: sys/cdefs.h: No such file or directory

The makefiles need to differentiate between the target and host architectures.

@charliegracie
Copy link
Contributor

The tools can/should be configured to be compiled for the host and not the target. @youngar can you provide some guidance here?

@JamesKingdon
Copy link
Contributor Author

The work around I used was to add OMR_ENV_DATA64=1 to toolconfigure.mk.in in the conditional section for cross compile. I have no idea if this is the 'correct' solution or not.

@youngar
Copy link
Member

youngar commented Nov 7, 2017

Hi, i'm seeing what you describe; OMR_ENV_DATA64 is picked up from the target platform. We do have separate variables OMR_TARGET_DATASIZE... 32 and OMR_BUILD_DATASIZE... 64 to detect the host and target platform. We need to change how the tools are configured to set OMR_ENV_DATA64 in toolconfigure.mk.in based on the host. Our build farm doesn't have a problem building the tools with -m32, so we never noticed.

@youngar youngar self-assigned this Nov 7, 2017
youngar added a commit to youngar/omr that referenced this issue Nov 7, 2017
Build tools require to be configured according to the current host
platform. This variable currently defaults to the target platform, which
causes cross compilation issues.

issue: eclipse#1955

Signed-off-by: Andrew Young <youngar17@gmail.com>
youngar added a commit to youngar/omr that referenced this issue Nov 17, 2017
Build tools require to be configured according to the current host
platform. This variable currently defaults to the target platform, which
causes cross compilation issues.

issue: eclipse#1955

Signed-off-by: Andrew Young <youngar17@gmail.com>
@JamesKingdon
Copy link
Contributor Author

Many thanks @youngar, I believe this problem is solved now.

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

No branches or pull requests

3 participants