1
Fork 0

Update rustc's information on Android's sanitizers

This patch updates sanitizier support definitions for Android inside the
compiler.  It also adjusts the logic to make sure no pre-built sanitizer
runtime libraries are emitted as these are instead provided dynamically
on Android targets.
This commit is contained in:
Chris Wailes 2022-09-08 16:33:44 -07:00
parent 11bb80a92b
commit 3d5a41724b
5 changed files with 22 additions and 7 deletions

View file

@ -1090,11 +1090,12 @@ fn add_sanitizer_libraries(sess: &Session, crate_type: CrateType, linker: &mut d
// both executables and dynamic shared objects. Everywhere else the runtimes
// are currently distributed as static libraries which should be linked to
// executables only.
let needs_runtime = match crate_type {
CrateType::Executable => true,
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => sess.target.is_like_osx,
CrateType::Rlib | CrateType::Staticlib => false,
};
let needs_runtime = !sess.target.is_like_android
&& match crate_type {
CrateType::Executable => true,
CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => sess.target.is_like_osx,
CrateType::Rlib | CrateType::Staticlib => false,
};
if !needs_runtime {
return;