1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-09 13:42:56 +00:00

llvm/powerpc64*: fix broken binaries generated by clang12

Amends 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 by:
    https://bugs.llvm.org/show_bug.cgi?id=51590

Reviewed by:    dim
MFC after:      2 days
Sponsored by:   Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision:  https://reviews.freebsd.org/D31698
This commit is contained in:
Alfredo Dal'Ava Junior 2021-08-27 11:47:11 -03:00
parent c577bdfce6
commit 9a4d48a645

View File

@ -1961,7 +1961,8 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
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);
}
}