-
Couldn't load subscription status.
- Fork 5.2k
Add flags for overflow on clang. #120775
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
Add flags for overflow on clang. #120775
Conversation
In clang-20 there is a known breaking change to -fwrapv that impacted us. Details can be found at https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes. Add the -fno-strict-aliasing to match our MSVC usage as well.
|
/cc @rnkovacs |
|
Tagging subscribers to this area: @mangod9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of these days I'll get UBSAN working..
|
We should have a build image with clang 21 now: dotnet/dotnet-buildtools-prereqs-docker#1516 You can try updating all |
|
Last CI run still used clang 20: New images were built a few hours ago dotnet/dotnet-buildtools-prereqs-docker#1516 (comment) (it doesn't automatically rebuild the subtree). |
|
@jkotas, looks like we need to apply: --- a/src/native/libs/System.Security.Cryptography.Native/pal_x509.c
+++ b/src/native/libs/System.Security.Cryptography.Native/pal_x509.c
@@ -1250,6 +1250,7 @@ static int32_t X509ChainVerifyOcsp(X509_STORE_CTX* storeCtx, X509* subject, X509
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
+#pragma clang diagnostic ignored "-Wimplicit-void-ptr-cast"
if (i2d_OCSP_RESPONSE_bio(bio, resp))
#pragma clang diagnostic pop
{ |
|
FreeBSD build fix: --- a/src/native/libs/System.Native/pal_interfaceaddresses.c
+++ b/src/native/libs/System.Native/pal_interfaceaddresses.c
@@ -561,7 +561,7 @@ int32_t SystemNative_EnumerateGatewayAddressesForInterface(void* context, uint32
return -1;
}
- uint8_t* buffer = malloc(byteCount);
+ uint8_t* buffer = (uint8_t*)malloc(byteCount);
if (buffer == NULL)
{
errno = ENOMEM;
@@ -587,7 +587,7 @@ int32_t SystemNative_EnumerateGatewayAddressesForInterface(void* context, uint32
byteCount = tmpEstimatedSize;
free(buffer);
- buffer = malloc(byteCount);
+ buffer = (uint8_t*)malloc(byteCount);
if (buffer == NULL)
{
errno = ENOMEM; |
|
It would be nice to update tables in https://github.com/dotnet/runtime/blob/f0db8f9d9668ba03897739152d02623acbd04466/docs/workflow/using-docker.md at the same time (replace |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/ba-g Unrelated failures in outerloop |
|
@AaronRobinsonMSFT perhaps this is needed in some other places too: https://github.com/search?q=repo%3Adotnet%2Fdotnet%20-fwrapv&type=code |
|
Automated code flow will sync with VMR. |
|
@am11 did you click the link? There's some thing for mono, and also in src/deployment-tools and src/diagnostics. |
|
We sync eng/native with dotnet/diagnostics from time to time. I can resync it. Not sure if |
Updated comments and compile options for signed overflow and strict aliasing. See related code for dotnet/runtime - dotnet/runtime#120775
Updated compiler options to improve signed overflow handling and suppress strict aliasing rules. See related code for dotnet/runtime#120775
Updated compiler options to improve signed overflow handling and suppress strict aliasing rules. See related code for dotnet/runtime#120775
Related changes for mono - see #120775
Updated comments and compile options for signed overflow and strict aliasing. See related code for dotnet/runtime - dotnet/runtime#120775
In clang-20 there is a known breaking change to
-fwrapvthat impacted us. Details can be found at https://releases.llvm.org/20.1.0/tools/clang/docs/ReleaseNotes.html#potentially-breaking-changes.Add the
-fno-strict-aliasingto match our MSVC usage as well.Contributes to #119706