dotnet / dotnet-buildtools-prereqs-docker

Used to maintain the Docker images hosted at the mcr.microsoft.com/dotnet-buildtools/prereqs image repository
MIT License
53 stars 99 forks source link

Update our AZLinux 3.0 .NET 9 images to build a custom standard library toolchain #1025

Closed jkoritzinsky closed 1 month ago

jkoritzinsky commented 2 months ago

Update our docker images to build a toolchain with a static libc++ that uses the target-provided libstdc++ for the C++ Itanium ABI.

This scenario has some limitations (we're limited to API features that don't use any ABI features exposed since 2016), but it works fine for our C++11 code in dotnet/runtime.

The sanitizer instrumentation in libc++ isn't compatible with this old of a libstdc++ though, so this PR provides a separate image for that scenario. That image provides a statically linked libc++ that includes libc++abi. Additionally, it instruments libc++ and libc++abi directly with ASAN so our ASAN testing can have a fully instrumented toolchain.

This isn't required for ASAN, but is required for other sanitizers we may consider adding validation with in the future.

sbomer commented 2 months ago

Does building libc++ also make it the default for clang on these images? Or does the runtime build need to set some flags to build against libc++?

jkoritzinsky commented 2 months ago

This does make libc++ the default. We'll have to make some changes to the dotnet/runtime build to utilize these new features in the images (by default they'll use the libstdc++ that they've been using).

jkoritzinsky commented 2 months ago

Waiting to merge until usage UX in https://github.com/dotnet/runtime/pull/101773 is agreed upon.

jkoritzinsky commented 1 month ago

Usage UX has been defined, I'll merge this in and (once the new images are built) update the PR in dotnet/runtime with the sanitizer fixes.