Skip to content

Conversation

@AaronRobinsonMSFT
Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT commented Oct 28, 2025

Customer Impact

  • Customer reported
  • Found internally

These issues were reported in #119706 as problems with clang-21 on Fedora 43. The investigation uncovered that clang introduced a potentially breaking change in clang-20 that we do not currently consume. These build changes impact VMR related builds when linux distrobutions performing source build adopt clang-21.

clang-20 breaking change log - https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes.

This PR contains the minimal changes needed to fix issues from the following PR #120775.

.NET 10: #121124
.NET 9: #121151

Regression

  • Yes
  • No

Build with the new clang-21 compiler will cause the runtime to crash.

Testing

This has been validated using various legs and examples to demonstrate the usage of undefined behavior these flags convert into "defined" behavior in C/C++.

Risk

Low. This has zero impact on our production build since we specifically target clang-16. This is only valid for those partners that are using clang-20+.

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates compiler flag configuration for Unix-based builds to use -fno-strict-overflow instead of -fwrapv when using Clang 20.0 or later, and adds -fno-strict-aliasing for Clang 20+.

Key Changes

  • Adds version-based conditional logic to use different overflow handling flags based on Clang version
  • Introduces -fno-strict-overflow flag for Clang 20+ (which implies -fwrapv and -fwrapv-pointer)
  • Adds -fno-strict-aliasing flag for Clang 20+ to match MSVC behavior

@agocke agocke added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 11, 2025
@AaronRobinsonMSFT
Copy link
Member Author

/ba-g Unrelated timeouts

AaronRobinsonMSFT added a commit that referenced this pull request Nov 14, 2025
…0.0 (#121151)

## Customer Impact

- [x] Customer reported
- [ ] Found internally

These issues were reported in
#119706 as problems with
clang-21 on Fedora 43. The investigation uncovered that clang introduced
a potentially breaking change in clang-20 that we do not currently
consume. These build changes impact VMR related builds when linux
distrobutions performing source build adopt clang-21.

clang-20 breaking change log -
https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes.

This PR contains the minimal changes needed to fix issues from the
following PR #120775.

.NET 10: #121124
.NET 8: #121150

## Regression

- [ ] Yes
- [x] No

Build with the new clang-21 compiler will cause the runtime to crash.

## Testing

This has been validated using various legs and examples to demonstrate
the usage of undefined behavior these flags convert into "defined"
behavior in C/C++.

## Risk

Low. This has zero impact on our production build since we specifically
target clang-18. This is only valid for those partners that are using
clang-20+.
@AaronRobinsonMSFT AaronRobinsonMSFT merged commit b95a379 into dotnet:release/8.0-staging Nov 14, 2025
174 of 179 checks passed
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the dotnet8_clang_21_flags branch November 14, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants