[compiler-rt] [sanitizer] Lift AsanDoesNotSupportStaticLinkage to sanitizer_common.h. NFC (PR #80948)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 05:55:01 PST 2024


================
@@ -290,6 +290,17 @@ bool SetEnv(const char *name, const char *value);
 
 u32 GetUid();
 void ReExec();
+
+#if defined(__ELF__) && !SANITIZER_FUCHSIA
+extern uptr kDynamic[] asm("_DYNAMIC");
+inline void DoesNotSupportStaticLinking() {
+  // This will fail to link with -static. However, -static-pie is not detected.
----------------
teresajohnson wrote:

Is there a TODO that should be added to detect -static-pie? How can that one be detected?

https://github.com/llvm/llvm-project/pull/80948


More information about the llvm-commits mailing list