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

AArch64: CMake build settings #3000

Merged
merged 1 commit into from
Oct 15, 2018
Merged

Conversation

knn-k
Copy link
Contributor

@knn-k knn-k commented Sep 27, 2018

This commit adds some changes to CMake build settings for aarch64.

Signed-off-by: knn-k [email protected]

@knn-k
Copy link
Contributor Author

knn-k commented Sep 27, 2018

  1. The GNU toolchain for aarch64 does not accept the option -m64. gnu.cmake is changed so that it adds -m64 option only when the target processor is not aarch64.
  2. Some C/C++ files in OMR expect a symbol AARCH64 instead of J9AARCH64 or AARCH64GNU. Added -DAARCH64 to aarch64.cmake.
  3. Set TR_TARGET_ARCH and TR_TARGET_BITS explicitly instead of from TR_HOST_ARCH and TR_HOST_BITS.
  4. Add TR_TARGET_ARM64 and TR_TARGET_64BIT to TR_COMPILE_DEFINITIONS.
  5. Add .cpp files in aarch64/codegen to CMakeLists.txt.

@knn-k
Copy link
Contributor Author

knn-k commented Sep 27, 2018

You need a toolchain file for running cmake for cross-compilation. Where should the toolchain file be in the OMR source tree?

@knn-k knn-k force-pushed the aarch64crossbuild1 branch 3 times, most recently from 864a9fa to 97a1337 Compare September 27, 2018 10:52
@0xdaryl 0xdaryl self-assigned this Sep 28, 2018
@knn-k knn-k changed the title WIP: AArch64: CMake build settings AArch64: CMake build settings Oct 4, 2018
@knn-k
Copy link
Contributor Author

knn-k commented Oct 4, 2018

Removed "WIP:".

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 4, 2018

Changes look reasonsonable to me. Could one of @Leonardo2718 or @rwy0717 please eyeball them?

set(TR_TARGET_ARCH ${TR_HOST_ARCH})
set(TR_TARGET_SUBARCH ${TR_HOST_SUBARCH})
set(TR_TARGET_BITS ${TR_HOST_BITS})
endif()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You want to cross compile a JIT that runs on aarch64 and targets aarch64. Here, it looks like you're trying to make TR itself a cross compiler? Am I reading this right? Is this needed?

@rwy7
Copy link
Contributor

rwy7 commented Oct 5, 2018

For the toolchain, I would put it in a new cmake/toolchains/ directory.

@rwy7
Copy link
Contributor

rwy7 commented Oct 5, 2018

Does TR_HOST_ARCH describe the build environment, or the runtime environment?

@knn-k
Copy link
Contributor Author

knn-k commented Oct 5, 2018

@rwy0717
I am trying to build the JIT that runs on aarch64 by running a cross-compiling GCC on x86-64, and I have already built triltest that runs on aarch64 linux in my local environment using the changes in this PR.

I thought TR_HOST_ARCH was the build environment.

I remember the old J9 on x86 generated JXE files with AOT code for another processor. Does the comment "Currently not doing cross, so assume HOST == TARGET" in OmrCompilerSupport.cmake mean such case ?
If so, setting aarch64 to both TR_HOST_ARCH and TR_TARGET_ARCH is the right thing to do?

@rwy7
Copy link
Contributor

rwy7 commented Oct 5, 2018

OK, it appears that TR_HOST_ARCH is set but not used anywhere--it's meaningless. It's possible someone was thinking about producing a cross-jit, but didn't get anywhere...

Where and how are you setting the TR_TARGET_ARCH? In a toolchain file?

@knn-k
Copy link
Contributor Author

knn-k commented Oct 5, 2018

TR_TARGET_ARCH is set in cmake/modules/platform/arch/aarch64.cmake. Other platforms set TR_HOST_ARCH in cmake/modules/platform/arch/*.cmake.

I can set TR_HOST_ARCH in aarch64.cmake like other platforms do, and revert my change in OmrCompilerSupport.cmake.

(Update)
I am trying to do the above, but the attempt has been unsuccessful. cmake generates files for x86 instead of aarch64.

This commit adds some changes to CMake build settings for aarch64.

Signed-off-by: knn-k <[email protected]>
@knn-k
Copy link
Contributor Author

knn-k commented Oct 5, 2018

Updated the files.

@rwy7
Copy link
Contributor

rwy7 commented Oct 5, 2018

Toolchain looks good.

I checked with others, and host definitely refers to the runtime environment. It looks like you've removed the check already 👍

With the changes currently in the PR, are you still having trouble getting cmake to cross compile?

@knn-k
Copy link
Contributor Author

knn-k commented Oct 8, 2018

No, my trouble was solved. I can build for aarch64.

@knn-k
Copy link
Contributor Author

knn-k commented Oct 15, 2018

I think this can be merged now.

@rwy7
Copy link
Contributor

rwy7 commented Oct 15, 2018

LGTM

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 15, 2018

@genie-omr build all

@charliegracie
Copy link
Contributor

@genie-omr build xcplinux

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 15, 2018

@charliegracie : What is the xcplinux build? Some kind of cross-compile build?

@charliegracie
Copy link
Contributor

that was the temporary name I picked for the Linux x86-64 compressed references build... I have since switched it to xcrlinux as to not conflict with plinux. Once we have all of the builds move to the OMR CI I will open an Issue to discuss how we want to name the builds so appropriate builds can be launched with the bot.

@0xdaryl
Copy link
Contributor

0xdaryl commented Oct 15, 2018

ah, ok. I though it was some kind of pLinux cross-compile build.

@0xdaryl 0xdaryl merged commit de7e6dc into eclipse-omr:master Oct 15, 2018
@knn-k knn-k deleted the aarch64crossbuild1 branch October 16, 2018 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants