Thanks to visit codestin.com
Credit goes to github.com

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

  • The new images intentionally don't have binutils, so our build jobs have been updated to use llvm-based tools. This includes lld when we run nativeaot over our tests. This leads to a slight size regression, I believe due to ILCompiler not supporting --gc-sections with lld (see Add LinkerFlavor to NativeAOT #83558 (comment)). cc @MichalStrehovsky
  • This change turns off PGO optimization because it was hitting a compiler crash when consuming and old version of profile data produced by clang9 instrumented builds (https://bugzilla.redhat.com/show_bug.cgi?id=1827282). The intention is to quickly flow the change into our optimization repo, then collect and ingest the new data so we can turn optimization back on.
  • The Mono LLVMAot test build is kept on the old build images, because they run the aot compiler which depends on binutils. We can probably move it to the same plan as the other legs, but I'm not familiar with the context here. cc @akoeplinger. We would at least need to fix AS_NAME here:
    #define AS_NAME "as"
  • Mono arm64 product build is kept on the old images due to Unable to compile mono arm64 with clang12 #84503.

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