7 Commits

Author SHA1 Message Date
Chris Apple
4a65861402
[rtsan][llvm] Remove function pass, only support module pass (#119739)
Most of the other sanitizers are now only module level passes. This
moves all functionality into the module pass, and removes the function
pass.
2024-12-13 08:50:36 -08:00
Chris Apple
ca3180ad6e
[LLVM][rtsan] Add module pass to initialize rtsan (#118989)
This allows shared libraries instrumented with RTSan to be initialized.

This approach directly mirrors the approach in Tsan, Asan and many of
the other sanitizers
2024-12-06 11:29:11 -08:00
davidtrevelyan
4102625380
[rtsan][llvm][NFC] Rename sanitize_realtime_unsafe attr to sanitize_realtime_blocking (#113155)
# What

This PR renames the newly-introduced llvm attribute
`sanitize_realtime_unsafe` to `sanitize_realtime_blocking`. Likewise,
sibling variables such as `SanitizeRealtimeUnsafe` are renamed to
`SanitizeRealtimeBlocking` respectively. There are no other functional
changes.


# Why?

- There are a number of problems that can cause a function to be
real-time "unsafe",
- we wish to communicate what problems rtsan detects and *why* they're
unsafe, and
- a generic "unsafe" attribute is, in our opinion, too broad a net -
which may lead to future implementations that need extra contextual
information passed through them in order to communicate meaningful
reasons to users.
- We want to avoid this situation and make the runtime library boundary
API/ABI as simple as possible, and
- we believe that restricting the scope of attributes to names like
`sanitize_realtime_blocking` is an effective means of doing so.

We also feel that the symmetry between `[[clang::blocking]]` and
`sanitize_realtime_blocking` is easier to follow as a developer.

# Concerns

- I'm aware that the LLVM attribute `sanitize_realtime_unsafe` has been
part of the tree for a few weeks now (introduced here:
https://github.com/llvm/llvm-project/pull/106754). Given that it hasn't
been released in version 20 yet, am I correct in considering this to not
be a breaking change?
2024-10-26 13:06:11 +01:00
davidtrevelyan
4547d6042a
[llvm][rtsan] Add transform pass for sanitize_realtime_unsafe (#109543) 2024-10-03 06:32:21 -07:00
Chris Apple
22cce65464
[LLVM][rtsan] rtsan transform to preserve CFGAnalyses (#102651)
Follow on to #101232, as suggested in the comments, narrow the scope of
the preserved analyses.
2024-08-09 21:21:06 +02:00
Fangrui Song
f86594788c [rtsan] Fix warnings after #101232 2024-08-08 16:43:20 -07:00
Chris Apple
8acf8852e9
[LLVM][rtsan] Add RealtimeSanitizer transform pass (#101232)
Split from #100596.

Introduce the RealtimeSanitizer transform, which inserts the
rtsan_enter/exit functions at the appropriate places in an instrumented
function.
2024-08-08 16:32:54 -07:00