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

Linux cross build: cmake variable setting #7098

Closed
hseok-oh opened this issue Dec 7, 2016 · 1 comment
Closed

Linux cross build: cmake variable setting #7098

hseok-oh opened this issue Dec 7, 2016 · 1 comment

Comments

@hseok-oh
Copy link
Contributor

hseok-oh commented Dec 7, 2016

Many CMake variables are set in <projectDir>/CMakeLists.txt.
Windows and Linux have different result.

For example, when host is x86 and target is ARM,

In Windows, CMakeList.txt set as
CLR_CMAKE_PLATFORM_ARCH_I386: 1
CLR_CMAKE_HOST_ARCH: x86
CLR_CMAKE_TARGET_ARCH: arm
CLR_CMAKE_TARGET_ARCH_ARM: 1

But in Linux,
CLR_CMAKE_PLATFORM_ARCH_ARM: 1
CLR_CMAKE_HOST_ARCH: arm
CLR_CMAKE_TARGET_ARCH: arm
CLR_CMAKE_TARGET_ARCH_ARM: 1

In linux, CLR_CMAKE_HOST_ARCH and CLR_CMAKE_PLATFORM_ARCH_<ARCH> are defined by CLR_CMAKE_PLATFORM_<OS>_<ARCH>, and CLR_CMAKE_PLATFORM__is defined byCMAKE_SYSTEM_PROCESSOR`.

CMAKE_SYSTEM_PROCESSOR have target architecture. If host and target is same, the result is uname -p. But in cross build environment, it have target architecture.
https://cmake.org/cmake/help/v3.7/variable/CMAKE_SYSTEM_PROCESSOR.html
https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html

This effects

  1. Not build for cross build environment
    ex. directory bin/Linux.arm.Release/x64/ and crossgen for x64-host/arm-target is not generated
    (it is not confirm correctness of crossgen if we fix to generate this directory and execution file)
  2. Different CMake files
    ex. src/pal/CMakeLists.txt: not build libcoreclrtraceptprovider.so (Several Interop tests failing in Helix on ARM #8421)

Need to fix for cross build.

@hseok-oh
Copy link
Contributor Author

hseok-oh commented Dec 13, 2016

These cmake variables are same when we build CoreCLR. These variable on windows are changed when it build cross-architecture native component. To build cross-architecture component on linux, we need additional implement in build.sh and gen-buildsys-clang.sh.

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant