ports/devel/llvm12/files/patch-llvm_lib_CodeGen_TargetLoweringBase.cpp
Piotr Kubaj e6d23ad3c1 devel/llvm12: fix for broken binaries generated by llvm12
Selectively reverts LLVM commit 2518433f861fcb877d0a7bdd9aec1aec1f77505a that was pointed as the source of regression on LLVM12.
This affects powerpc64*, making binaries crash with segmentation fault due to bad code generation around "__stack_chk_guard"

Root cause and/or proper fix is under investigation: https://bugs.llvm.org/show_bug.cgi?id=51590

Submitted by:	adalava
Differential review (for base):	https://reviews.freebsd.org/D31698
2021-08-27 18:22:26 +00:00

12 lines
612 B
C++

--- llvm/lib/CodeGen/TargetLoweringBase.cpp.orig 2021-08-27 13:06:05 UTC
+++ llvm/lib/CodeGen/TargetLoweringBase.cpp
@@ -1961,7 +1961,8 @@ void TargetLoweringBase::insertSSPDeclarations(Module
GlobalVariable::ExternalLinkage, nullptr,
"__stack_chk_guard");
if (TM.getRelocationModel() == Reloc::Static &&
- !TM.getTargetTriple().isWindowsGNUEnvironment())
+ !TM.getTargetTriple().isWindowsGNUEnvironment() &&
+ !(TM.getTargetTriple().isPPC64() && TM.getTargetTriple().isOSFreeBSD()))
GV->setDSOLocal(true);
}
}