Cross building from x64 to arm64 fails compiling using clang #4573
Replies: 9 comments 1 reply
-
|
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Beta Was this translation helpful? Give feedback.
-
|
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Beta Was this translation helpful? Give feedback.
-
|
Some relevant bits from the log: Could it be that the compiler being used can't target arm64 and the compiler that can target arm64 isn't being picked up? |
Beta Was this translation helpful? Give feedback.
-
|
Yeah, that seems to be the case. It looks as though void's clang can't cross compile, and they use cross-aarch64-linux-gnu instead as a compiler. If I install clang then dotnet's build script tries to use it and fails. If I don't install it then dotnet's build script will complain it can't find clang. In both cases the $CC variable is set to cross-aarch64-linux-gnu I don't know how dependent dotnet is on clang, but would it be possible to use something else? Ideally though an env var or flag? |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
|
I haven't done any cross-builds for arm64 myself, but when I compare with ppc64le cross builds (which I do build): I set some env vars:
My build command is then literally:
|
Beta Was this translation helpful? Give feedback.
-
|
[Triage] This appears as a discussion with no actionable changes necessary within source-build. Converting to a discussion. Please open follow-up issues if any source changes are needed. |
Beta Was this translation helpful? Give feedback.
-
|
Using while doing crossbuild directly from runtime repo is 100% done without errors, the part that fails looks like that on runtime: Looks like one of the issue comes from https://github.com/dotnet/runtime/blob/e0620bc380fa291867568e653206a9ecb8923d64/eng/native/gen-buildsys.sh#L73 - this line assume that target arch is always host arch - which is not true when doing x64 => arm64 build. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Bug
When cross building from x64 to arm64 the process fails as clang "is not able to compile a simple test program."
Steps to Reproduce
In the dotnet/dotnet repo on version v8.0.7 the following command should cause the issue
ROOTFS_DIR=/usr/aarch64-linux-gnu bash ./build.sh --clean-while-building --online --source-repository https://github.com/dotnet/dotnet --source-version 8be139ddde52d33e24c7d82f813248ff9fc54b97 -- -p:TargetArchitecture=arm64 -p:CrossBuild=trueThe full void template is available on github (very much WIP)
Other Information
The relevant output log of the build process can be found here
(I have omitted the void-related stuff, such as installing dependencies, as well as the prep.sh output. If it's relevant I can paste it as well)
Beta Was this translation helpful? Give feedback.
All reactions