rustc should give compile error when try to enable sanitizer while statically link to libc like gcc does #85459
Labels
A-sanitizers
Area: Sanitizers for correctness and code quality
C-bug
Category: This is a bug.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
requires-nightly
This issue requires a nightly compiler in some way.
Combination such compiler option will either lead to a link error, or a runtime segmentation fault.
Address sanitizer
Consider this C code:
Compile it using gcc with
-fsanitize=address -static
on glibc system:Compile it using clang with
-fsanitize=address -static
on glibc system:Compile it using clang with
-fsanitize=address -static
on musl system:( I don't enable GCC's sanitizer support on musl system, but the result should same )
The same code in rust:
x86_64-unknown-linux-gnu system:
x86_64-unknown-linux-musl system:
The crt-static is enabled on musl by default, disable it make sanitizer works:
Thread sanitizer
x86_64-unknown-linux-gnu system:
x86_64-unknown-linux-musl system:
Leak sanitizer
x86_64-unknown-linux-gnu system:
x86_64-unknown-linux-musl system:
The text was updated successfully, but these errors were encountered: