-
-
Notifications
You must be signed in to change notification settings - Fork 267
Preliminary support for LLVM 20 RTSan #4924
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
base: master
Are you sure you want to change the base?
Conversation
This is now required by LLVM API starting from LLVM 20
Based on checking the `ldc2 -help` output when using LLVM 20 and 19 on Linux x86_64 (with all targets enabled, incl. experimental SPIRV/ Xtensa). And comparing that against official LDC v1.34 with LLVM 16.
Where the ASan pass now apparently adds a `nosanitize_address` IR module flag, breaking these tests.
…profdata on Ubuntu 25.04
... when using LLVM JITLink on LLVM 20+
... this attribute can be used to mark a function as "blocking" (same mechanism as Clang's `[[clang::blocking]]` C/C++ attribute.
runtime/druntime/src/rt/dmain2.d
Outdated
{ | ||
import ldc.attributes; | ||
|
||
@weak extern (C) void __rtsan_disable() @nogc nothrow {} |
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.
Have a look at module ldc.sanitizers_optionally_linked. I think that's more robust / works on more platforms probably?
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.
Done.
One of the authors of rtsan here, was just linked this PR! Just shout if you have any questions. Excited to see it go into D |
An overall note before I look any further - it may be simpler to break this up into:
Seems like there are two major steps being done in this single PR. Breaking them up would make it easier to review and roll back upon an issue |
Hi, thank you for your review!
This is also why this is a draft. I am currently waiting on LLVM upstream to fix a LLVM 20 regression that breaks LDC in a very bad way (see #4911). This pull request will be rebased when that LLVM 20 upgrade pull request lands. |
... this function is not real-time safe and also not rtsan safe (will lock-up rtsan's stack scanner)
This pull request adds basic RTSan (real-time sanitizer) support for D developers to check if their applications are real-time safe (i.e. suitable to use in a real-time context).
Needs #4911. Fix #4755.