[PATCH] D109090: [PPC64] fix/workaround runtime crash on FreeBSD with llvm12 and later

Alfredo Dal'Ava JĂșnior via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 19:56:59 PDT 2021


adalava updated this revision to Diff 379589.
adalava edited the summary of this revision.
adalava added a comment.

Update patch to avoid setting dso_local for any FreeBSD target since symbol is defined on libc.so.7.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109090/new/

https://reviews.llvm.org/D109090

Files:
  llvm/lib/CodeGen/TargetLoweringBase.cpp


Index: llvm/lib/CodeGen/TargetLoweringBase.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringBase.cpp
+++ llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1982,8 +1982,11 @@
     auto *GV = new GlobalVariable(M, Type::getInt8PtrTy(M.getContext()), false,
                                   GlobalVariable::ExternalLinkage, nullptr,
                                   "__stack_chk_guard");
+
+    // FreeBSD has "__stack_chk_guard" defined externally on libc.so
     if (TM.getRelocationModel() == Reloc::Static &&
-        !TM.getTargetTriple().isWindowsGNUEnvironment())
+        !TM.getTargetTriple().isWindowsGNUEnvironment() &&
+        !TM.getTargetTriple().isOSFreeBSD())
       GV->setDSOLocal(true);
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109090.379589.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211014/492d7d0d/attachment.bin>


More information about the llvm-commits mailing list