Skip to content

Commit 2a10b4c

Browse files
committed
safestack build fix for freebsd i386
1 parent 8d2f079 commit 2a10b4c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

compiler-rt/lib/safestack/safestack_platform.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ inline void *Mmap(void *addr, size_t length, int prot, int flags, int fd,
143143
return __mmap(addr, length, prot, flags, fd, 0, offset);
144144
#elif SANITIZER_FREEBSD && (defined(__aarch64__) || defined(__x86_64__))
145145
return (void *)__syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
146+
#elif SANITIZER_FREEBSD && (defined(__i386__))
147+
return (void *)syscall(SYS_mmap, addr, length, prot, flags, fd, offset);
146148
#elif SANITIZER_SOLARIS
147149
return _REAL64(mmap)(addr, length, prot, flags, fd, offset);
148150
#elif SANITIZER_LINUX_USES_64BIT_SYSCALLS

compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,20 +2180,20 @@ static const char *RegNumToRegName(int reg) {
21802180
return NULL;
21812181
}
21822182

2183-
#if SANITIZER_LINUX
2183+
# if SANITIZER_LINUX
21842184
UNUSED
21852185
static void DumpSingleReg(ucontext_t *ctx, int RegNum) {
21862186
const char *RegName = RegNumToRegName(RegNum);
2187-
# if defined(__x86_64__)
2187+
# if defined(__x86_64__)
21882188
Printf("%s%s = 0x%016llx ", internal_strlen(RegName) == 2 ? " " : "",
21892189
RegName, ctx->uc_mcontext.gregs[RegNum]);
2190-
# elif defined(__i386__)
2190+
# elif defined(__i386__)
21912191
Printf("%s = 0x%08x ", RegName, ctx->uc_mcontext.gregs[RegNum]);
2192-
# else
2192+
# else
21932193
(void)RegName;
2194-
# endif
2194+
# endif
21952195
}
2196-
#endif
2196+
# endif
21972197

21982198
void SignalContext::DumpAllRegisters(void *context) {
21992199
ucontext_t *ucontext = (ucontext_t *)context;

0 commit comments

Comments
 (0)