Skip to content

Conversation

@sbomer
Copy link
Member

@sbomer sbomer commented Mar 30, 2023

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).

Contributes to #83428.

janvorli and others added 20 commits February 9, 2023 11:19
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
To locate gcc toolchain in target sysroot, when host arch matches target arch.
@ghost ghost assigned sbomer Mar 30, 2023
@ghost
Copy link

ghost commented Mar 30, 2023

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: sbomer
Assignees: sbomer
Labels:

area-Infrastructure-coreclr

Milestone: -

BruceForstall pushed a commit to dotnet/jitutils that referenced this pull request Apr 14, 2023
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).
@rzikm
Copy link
Member

rzikm commented Apr 19, 2023

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).

clang : error : invalid linker name in argument '-fuse-ld=lld' [/repo/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj]

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
https://github.com/sbomer/runtime/blob/92d1f2217649103e3f3e5121b8ad35dca5a81bbb/src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj#L62? Or is some additional detection needed?

sbomer added a commit to dotnet/core that referenced this pull request May 2, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 19, 2023
@sbomer sbomer deleted the marinerBuild branch August 7, 2025 17:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants