@@ -1151,6 +1151,10 @@ defvar LibmHasFrexpF128 = LibcallImpls<(add frexp_f128), isNotOSWindowsOrIsCygwi
1151
1151
defvar LibmHasLdexpF128 = LibcallImpls<(add ldexp_f128), isNotOSWindowsOrIsCygwinMinGW>;
1152
1152
1153
1153
defvar has__stack_chk_fail = LibcallImpls<(add __stack_chk_fail), isNotOSOpenBSD>;
1154
+ defvar has__stack_smash_handler = LibcallImpls<(add __stack_smash_handler), isOSOpenBSD>;
1155
+
1156
+ defvar DefaultStackProtector = (add has__stack_chk_fail,
1157
+ has__stack_smash_handler);
1154
1158
1155
1159
//===----------------------------------------------------------------------===//
1156
1160
// Objective-C Runtime Libcalls
@@ -1229,7 +1233,7 @@ def AArch64SystemLibrary : SystemRuntimeLibrary<
1229
1233
DarwinExp10, DarwinSinCosStret,
1230
1234
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
1231
1235
DefaultLibmExp10,
1232
- has__stack_chk_fail )
1236
+ DefaultStackProtector )
1233
1237
>;
1234
1238
1235
1239
// Prepend a # to every name
@@ -1506,7 +1510,7 @@ def ARMSystemLibrary
1506
1510
LibcallImpls<(add __divmodsi4, __udivmodsi4),
1507
1511
RuntimeLibcallPredicate<[{TT.isOSBinFormatMachO() &&
1508
1512
(!TT.isiOS() || !TT.isOSVersionLT(5, 0))}]>>,
1509
- has__stack_chk_fail )> {
1513
+ DefaultStackProtector )> {
1510
1514
let DefaultLibcallCallingConv = LibcallCallingConv<[{
1511
1515
(!TT.isOSDarwin() && !TT.isiOS() && !TT.isWatchOS() && !TT.isDriverKit()) ?
1512
1516
(FloatABI == FloatABI::Hard ? CallingConv::ARM_AAPCS_VFP
@@ -2015,7 +2019,7 @@ def PPCSystemLibrary
2015
2019
LibmHasSinCosPPCF128,
2016
2020
AvailableIf<memcpy, isNotAIX>,
2017
2021
LibcallImpls<(add Int128RTLibcalls), isPPC64>,
2018
- has__stack_chk_fail )>;
2022
+ DefaultStackProtector )>;
2019
2023
2020
2024
//===----------------------------------------------------------------------===//
2021
2025
// RISCV Runtime Libcalls
@@ -2030,7 +2034,7 @@ def RISCVSystemLibrary
2030
2034
exp10f, exp10, exp10l_f128,
2031
2035
__riscv_flush_icache,
2032
2036
LibcallImpls<(add Int128RTLibcalls), isRISCV64>,
2033
- has__stack_chk_fail )>;
2037
+ DefaultStackProtector )>;
2034
2038
2035
2039
//===----------------------------------------------------------------------===//
2036
2040
// SPARC Runtime Libcalls
@@ -2098,7 +2102,7 @@ def SPARCSystemLibrary
2098
2102
LibcallImpls<(add _Q_qtoll, _Q_qtoull, _Q_lltoq, _Q_ulltoq), isSPARC32>,
2099
2103
LibcallImpls<(add SPARC64_MulDivCalls, Int128RTLibcalls), isSPARC64>,
2100
2104
LibmHasSinCosF32, LibmHasSinCosF64, LibmHasSinCosF128,
2101
- has__stack_chk_fail )
2105
+ DefaultStackProtector )
2102
2106
>;
2103
2107
2104
2108
//===----------------------------------------------------------------------===//
@@ -2159,7 +2163,7 @@ defvar X86CommonLibcalls =
2159
2163
// FIXME: MSVCRT doesn't have powi. The f128 case is added as a
2160
2164
// hack for one test relying on it.
2161
2165
__powitf2_f128,
2162
- has__stack_chk_fail
2166
+ DefaultStackProtector
2163
2167
);
2164
2168
2165
2169
defvar Windows32DivRemMulCalls =
@@ -2328,5 +2332,5 @@ def LegacyDefaultSystemLibrary
2328
2332
exp10f, exp10, exp10l_f128,
2329
2333
__powisf2, __powidf2, __powitf2_f128,
2330
2334
LibcallImpls<(add Int128RTLibcalls), isArch64Bit>,
2331
- has__stack_chk_fail
2335
+ DefaultStackProtector
2332
2336
)>;
0 commit comments