This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][Sanitizer] Link sanitizer libs with -latomic on SPARC
ClosedPublic

Authored by ro on Jul 26 2022, 7:20 AM.

Details

Summary

When building on Linux/sparc64, the 32-bit libclang_rt.asan.so, libclang_rt.ubsan_minimal.so, and libclang_rt.ubsan_standalone.so failed to link with undefined references to 64-bit atomics, which clang cannot inline. Even D130569 didn't help because those libraries are linked with -nodefaultlibs, so dependent libraries need to be added explicitly.

That's what this patch does.

Tested on sparc64-unknown-linux-gnu and sparcv9-sun-solaris2.11.

Diff Detail