Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions llvm/include/llvm/IR/RuntimeLibcalls.td
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,10 @@ defvar LibmHasFrexpF128 = LibcallImpls<(add frexp_f128), isNotOSWindowsOrIsCygwi
defvar LibmHasLdexpF128 = LibcallImpls<(add ldexp_f128), isNotOSWindowsOrIsCygwinMinGW>;

defvar has__stack_chk_fail = LibcallImpls<(add __stack_chk_fail), isNotOSOpenBSD>;
defvar has__stack_smash_handler = LibcallImpls<(add __stack_smash_handler), isOSOpenBSD>;

defvar DefaultStackProtector = (add has__stack_chk_fail,
has__stack_smash_handler);

//===----------------------------------------------------------------------===//
// Objective-C Runtime Libcalls
Expand Down Expand Up @@ -1229,7 +1233,7 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
DarwinExp10, DarwinSinCosStret,
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
DefaultLibmExp10,
has__stack_chk_fail)
DefaultStackProtector)
>;

// Prepend a # to every name
Expand Down Expand Up @@ -1506,7 +1510,7 @@ def ARMSystemLibrary
LibcallImpls<(add __divmodsi4, __udivmodsi4),
RuntimeLibcallPredicate<[{TT.isOSBinFormatMachO() &&
(!TT.isiOS() || !TT.isOSVersionLT(5, 0))}]>>,
has__stack_chk_fail)> {
DefaultStackProtector)> {
let DefaultLibcallCallingConv = LibcallCallingConv<[{
(!TT.isOSDarwin() && !TT.isiOS() && !TT.isWatchOS() && !TT.isDriverKit()) ?
(FloatABI == FloatABI::Hard ? CallingConv::ARM_AAPCS_VFP
Expand Down Expand Up @@ -2015,7 +2019,7 @@ def PPCSystemLibrary
LibmHasSinCosPPCF128,
AvailableIf<memcpy, isNotAIX>,
LibcallImpls<(add Int128RTLibcalls), isPPC64>,
has__stack_chk_fail)>;
DefaultStackProtector)>;

//===----------------------------------------------------------------------===//
// RISCV Runtime Libcalls
Expand All @@ -2030,7 +2034,7 @@ def RISCVSystemLibrary
exp10f, exp10, exp10l_f128,
__riscv_flush_icache,
LibcallImpls<(add Int128RTLibcalls), isRISCV64>,
has__stack_chk_fail)>;
DefaultStackProtector)>;

//===----------------------------------------------------------------------===//
// SPARC Runtime Libcalls
Expand Down Expand Up @@ -2098,7 +2102,7 @@ def SPARCSystemLibrary
LibcallImpls<(add _Q_qtoll, _Q_qtoull, _Q_lltoq, _Q_ulltoq), isSPARC32>,
LibcallImpls<(add SPARC64_MulDivCalls, Int128RTLibcalls), isSPARC64>,
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
has__stack_chk_fail)
DefaultStackProtector)
>;

//===----------------------------------------------------------------------===//
Expand Down Expand Up @@ -2159,7 +2163,7 @@ defvar X86CommonLibcalls =
// FIXME: MSVCRT doesn't have powi. The f128 case is added as a
// hack for one test relying on it.
__powitf2_f128,
has__stack_chk_fail
DefaultStackProtector
);

defvar Windows32DivRemMulCalls =
Expand Down Expand Up @@ -2328,5 +2332,5 @@ def LegacyDefaultSystemLibrary
exp10f, exp10, exp10l_f128,
__powisf2, __powidf2, __powitf2_f128,
LibcallImpls<(add Int128RTLibcalls), isArch64Bit>,
has__stack_chk_fail
DefaultStackProtector
)>;
3 changes: 0 additions & 3 deletions llvm/lib/IR/RuntimeLibcalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ void RuntimeLibcallsInfo::initLibcalls(const Triple &TT,
setLibcallImpl(RTLIB::UNWIND_RESUME, RTLIB::_Unwind_SjLj_Resume);
}

if (TT.isOSOpenBSD())
setLibcallImpl(RTLIB::STACK_SMASH_HANDLER, RTLIB::__stack_smash_handler);

if (TT.isARM() || TT.isThumb()) {
setARMLibcallNames(*this, TT, FloatABI, EABIVersion);
return;
Expand Down