devel/llvm13: fix building software with -fstack-protector-strong
Apply https://reviews.llvm.org/D109090 Fixes immediate segfault when executing binaries built by the port's compiler with -fstack-protector-strong. Submitted by: adalava (cherry picked from commit531a51cc36
) devel/llvm13: revert to the older powerpc64 fix The newer one apparently causes a regression on amd64 freestanding binaries. While here, fix some whitespace issues in Makefile. Submitted by: adalava (cherry picked from commitd326758c32
)
This commit is contained in:
parent
3a17aaa55e
commit
3b3a785bf3
|
@ -385,7 +385,7 @@ _BE_LIBS_AMDGPU= AsmParser Disassembler Utils
|
|||
_BE_LIBS_BACKWARDS_AMDGPU=MCACustomBehaviour
|
||||
_BE_LIBS_ARM= AsmParser Disassembler Utils
|
||||
_BE_LIBS_AVR= AsmParser Disassembler
|
||||
_BE_LIBS_BPF= AsmParser Disassembler
|
||||
_BE_LIBS_BPF= AsmParser Disassembler
|
||||
_BE_LIBS_Hexagon= AsmParser Disassembler
|
||||
_BE_LIBS_Lanai= AsmParser Disassembler
|
||||
_BE_LIBS_MSP430= AsmParser Disassembler
|
||||
|
@ -412,7 +412,7 @@ BE_PATTERN=${_BE_LIBS_STANDARD:O:S/$/.a/:ts|}
|
|||
_CRTLIBDIR= ${LLVM_DIR}/lib/clang/${LLVM_RELEASE}/lib/freebsd
|
||||
_CRTBLDIR= ${LLVM_DIR}/lib/clang/${LLVM_RELEASE}/share
|
||||
_COMPILER_RT_BLACKLISTS= cfi_ignorelist.txt
|
||||
_COMPILER_RT_LIBS_i386= \
|
||||
_COMPILER_RT_LIBS_i386= \
|
||||
libclang_rt.asan-i386.a \
|
||||
libclang_rt.asan-i386.so \
|
||||
libclang_rt.asan-preinit-i386.a \
|
||||
|
@ -432,7 +432,7 @@ _COMPILER_RT_LIBS_i386= \
|
|||
.if ${ARCH} == "amd64"
|
||||
_COMPILER_RT_BLACKLISTS+= asan_ignorelist.txt
|
||||
_COMPILER_RT_BLACKLISTS+= msan_ignorelist.txt
|
||||
_COMPILER_RT_LIBS= \
|
||||
_COMPILER_RT_LIBS= \
|
||||
libclang_rt.asan-preinit-x86_64.a \
|
||||
libclang_rt.asan-x86_64.a \
|
||||
libclang_rt.asan-x86_64.a.syms \
|
||||
|
@ -490,7 +490,7 @@ MAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin
|
|||
# Comment out plist entries for unsupported options.
|
||||
.for opt in ${_ALL_OPTIONS}
|
||||
.if !${OPTIONS_DEFINE:M${opt}}
|
||||
PLIST_SUB+= ${opt}="@comment "
|
||||
PLIST_SUB+= ${opt}="@comment "
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp b/contrib/llvm-project/llvm/lib/CodeGen/TargetLoweringBase.cpp
|
||||
--- llvm/lib/CodeGen/TargetLoweringBase.cpp
|
||||
+++ llvm/lib/CodeGen/TargetLoweringBase.cpp
|
||||
@@ -1961,7 +1961,8 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user