Skip to content

Commit 4197ac1

Browse files
authored
Merge pull request #10883 from 3405691582/openbsd
Cherrypick upstream LLVM changes for OpenBSD to swiftlang stable.
2 parents e4c5fa6 + c935c2e commit 4197ac1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler-rt/lib/builtins/cpu_model/aarch64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ _Bool __aarch64_have_lse_atomics = false;
4747
#elif defined(__ANDROID__)
4848
#include "aarch64/hwcap.inc"
4949
#include "aarch64/lse_atomics/android.inc"
50-
#elif __has_include(<sys/auxv.h>)
50+
#elif defined(__linux__) && __has_include(<sys/auxv.h>)
5151
#include "aarch64/hwcap.inc"
5252
#include "aarch64/lse_atomics/sysauxv.inc"
5353
#else
@@ -80,7 +80,7 @@ __attribute__((__visibility__("hidden"), __nocommon__))
8080
#elif defined(__ANDROID__)
8181
#include "aarch64/fmv/mrs.inc"
8282
#include "aarch64/fmv/android.inc"
83-
#elif __has_include(<sys/auxv.h>)
83+
#elif defined(__linux__) && __has_include(<sys/auxv.h>)
8484
#include "aarch64/fmv/mrs.inc"
8585
#include "aarch64/fmv/sysauxv.inc"
8686
#else

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,6 +1961,9 @@ void TargetLoweringBase::insertSSPDeclarations(Module &M) const {
19611961
// Currently only support "standard" __stack_chk_guard.
19621962
// TODO: add LOAD_STACK_GUARD support.
19631963
Value *TargetLoweringBase::getSDagStackGuard(const Module &M) const {
1964+
if (getTargetMachine().getTargetTriple().isOSOpenBSD()) {
1965+
return M.getNamedValue("__guard_local");
1966+
}
19641967
return M.getNamedValue("__stack_chk_guard");
19651968
}
19661969

0 commit comments

Comments
 (0)