Open safern opened 4 years ago
Tagging subscribers to this area: @directhex See info in area-owners.md if you want to be subscribed.
One issue I found while experimenting with this over the weekend is that we pass aarch64-linux-gnu
instead of aarch64-linux-musl
as the tuple in mono.proj which can be fixed by this:
diff --git a/src/mono/mono.proj b/src/mono/mono.proj
index 66a5ef711f1..3113d2f0105 100644
--- a/src/mono/mono.proj
+++ b/src/mono/mono.proj
@@ -589,8 +589,10 @@
<!-- ARM Linux cross build options -->
<PropertyGroup Condition="'$(TargetsAndroid)' != 'true' and '$(MonoCrossDir)' != '' and ('$(TargetArchitecture)' == 'arm' Or '$(TargetArchitecture)' == 'arm64')">
- <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm64'">aarch64-linux-gnu</_MonoTuple>
- <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm'">arm-linux-gnueabihf</_MonoTuple>
+ <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm64' and '$(RuntimeOS)' != 'linux-musl'">aarch64-linux-gnu</_MonoTuple>
+ <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm64' and '$(RuntimeOS)' == 'linux-musl'">aarch64-linux-musl</_MonoTuple>
+ <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm' and '$(RuntimeOS)' != 'linux-musl'">arm-linux-gnueabihf</_MonoTuple>
+ <_MonoTuple Condition="'$(TargetArchitecture)' == 'arm' and '$(RuntimeOS)' == 'linux-musl'">arm-linux-musleabihf</_MonoTuple>
<_MonoRANLIBOption>RANLIB="$(_MonoTuple)-ranlib"</_MonoRANLIBOption>
<_MonoAROption>AR="$(_MonoTuple)-ar"</_MonoAROption>
It still fails though due to clang using the native linker from the host which results in /usr/bin/ld: unrecognised emulation mode: aarch64linux
This is probably the result of issues in our build system rather than infrastructure. More complete build logs would make it much easier to spot the (probably various) issues. Cross compiling is hard :(
We tried to run the libraries outerloop tests on Mono in alpine arm64 and it failed to build mono with:
cc: @akoeplinger @steveisok @directhex