-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Build on CBL-mariner host with rootfs #84148
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
Conversation
This change enables cross-building for Alpine x64 on other x64 distro.
Necessary because pkg-config on mariner is a shim for pkgconf, which doesn't support override variables.
- Use lld for LTO instead of ld.gold - Set cross toolchain options for x64 mono build - Prefer llvm-objcopy for mono symbol stripping
Our custom LLVM build seems to have different defaults when targeting ARM than the clang-12 available in ubuntu. Probably related to https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/b7363248b115339c4fb838fcd3ae43671eedae0a. Passing the -march explicitly should not hurt.
Allow text relocations. The lld defaults differ from ld, which will add text relocations on demand by default. See https://maskray.me/blog/2020-12-19-lld-and-gnu-linker-incompatibilities
+ more cleanup
To locate gcc toolchain in target sysroot, when host arch matches target arch.
Tagging subscribers to this area: @hoyosjs Issue Detailsnull
|
Co-authored-by: Adeel Mujahid <[email protected]>
Fixes dotnet/runtime#84780. Tested by hooking up the changes locally with runtime's `jitformat.py` and running `python3 ./src/coreclr/scripts/jitformat.py -c /runtime/src/coreclr -o linux -a x64` in our mariner build container. This might break scenarios where jitutils are used outside of ci on a non-mariner build image. Per discussion with @BruceForstall let's make a quick fix to unblock ci, and if this is problematic we could for example add an extra argument that controls whether the `-cross` argument is passed to the runtime build. For context, the `-cross` argument is necessary after dotnet/runtime#84148 because our linux build images have change from centos 7 to CBL-mariner, and the linux builds are now cross-builds that use a rootfs (even x64 and x64-musl).
This PR (or a related one) breaks System.Net.Security.Enterprise.Test builds (https://dev.azure.com/dnceng-public/public/_build/results?buildId=243440&view=logs&j=03b95830-93c2-599b-7e4d-1efb940adc28&t=9abf97cd-b4a3-5a26-6cf2-d05ce865f2ef&l=3907).
The docker image used (mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04) has clang-9 but no lld binary installed. Will that be fixed by the TODO at |
To reflect the plan in dotnet/runtime#83428, and changes made in dotnet/runtime#84148.
This changes the linux builds to use the CBL-mariner build images added in dotnet/dotnet-buildtools-prereqs-docker#832. All of these builds are now cross-builds with a rootfs (including x64, and x64 musl).
--gc-sections
with lld (see Add LinkerFlavor to NativeAOT #83558 (comment)). cc @MichalStrehovskyAS_NAME
here:runtime/src/mono/mono/mini/aot-compiler.c
Line 13030 in 1d2cd20
Contributes to #83428.