[PATCH] D140857: Fix Fuchsia dyld in asan-ubsan variant

Shai Barack via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 2 15:31:10 PST 2023


shayba created this revision.
shayba added reviewers: phosek, leonardchan.
Herald added a subscriber: abrachet.
Herald added a project: All.
shayba requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.

The Clang Fuchsia driver sets -dynamic-linker to ld.so.1 or to a variant if needed.
Fix the variant lib path in asan-ubsan variant.

See also:
https://bugs.fuchsia.dev/p/fuchsia/issues/detail?id=118344


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140857

Files:
  clang/lib/Driver/ToolChains/Fuchsia.cpp


Index: clang/lib/Driver/ToolChains/Fuchsia.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Fuchsia.cpp
+++ clang/lib/Driver/ToolChains/Fuchsia.cpp
@@ -105,8 +105,12 @@
 
   if (!Args.hasArg(options::OPT_shared) && !Args.hasArg(options::OPT_r)) {
     std::string Dyld = D.DyldPrefix;
-    if (SanArgs.needsAsanRt() && SanArgs.needsSharedRt())
+    if (SanArgs.needsAsanRt() && !SanArgs.needsUbsanRt() &&
+        SanArgs.needsSharedRt())
       Dyld += "asan/";
+    if (SanArgs.needsAsanRt() && SanArgs.needsUbsanRt() &&
+        SanArgs.needsSharedRt())
+      Dyld += "asan-ubsan/";
     if (SanArgs.needsHwasanRt() && SanArgs.needsSharedRt())
       Dyld += "hwasan/";
     if (SanArgs.needsTsanRt() && SanArgs.needsSharedRt())


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140857.485889.patch
Type: text/x-patch
Size: 788 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230102/75bc2721/attachment.bin>


More information about the cfe-commits mailing list