mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Merge pull request #23856 from alexrp/backport-llvm-120036
This commit is contained in:
commit
a3693aae3a
5 changed files with 15 additions and 8 deletions
|
|
@ -86,6 +86,10 @@
|
|||
# include <sys/sysmacros.h>
|
||||
# endif
|
||||
|
||||
# if SANITIZER_LINUX && defined(__powerpc64__)
|
||||
# include <asm/ptrace.h>
|
||||
# endif
|
||||
|
||||
# if SANITIZER_FREEBSD
|
||||
# include <machine/atomic.h>
|
||||
# include <sys/exec.h>
|
||||
|
|
|
|||
|
|
@ -619,21 +619,22 @@ static void GetTls(uptr *addr, uptr *size) {
|
|||
*addr = tp - RoundUpTo(*size, align);
|
||||
*size = tp - *addr + ThreadDescriptorSize();
|
||||
# else
|
||||
if (SANITIZER_GLIBC)
|
||||
*size += 1664;
|
||||
else if (SANITIZER_FREEBSD)
|
||||
*size += 128; // RTLD_STATIC_TLS_EXTRA
|
||||
# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
|
||||
# if SANITIZER_GLIBC
|
||||
*size += 1664;
|
||||
# elif SANITIZER_FREEBSD
|
||||
*size += 128; // RTLD_STATIC_TLS_EXTRA
|
||||
# if defined(__mips__) || defined(__powerpc64__) || SANITIZER_RISCV64
|
||||
const uptr pre_tcb_size = TlsPreTcbSize();
|
||||
*addr -= pre_tcb_size;
|
||||
*size += pre_tcb_size;
|
||||
# else
|
||||
# else
|
||||
// arm and aarch64 reserve two words at TP, so this underestimates the range.
|
||||
// However, this is sufficient for the purpose of finding the pointers to
|
||||
// thread-specific data keys.
|
||||
const uptr tcb_size = ThreadDescriptorSize();
|
||||
*addr -= tcb_size;
|
||||
*size += tcb_size;
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# elif SANITIZER_NETBSD
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
# include <sys/ptrace.h>
|
||||
# if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \
|
||||
defined(__hexagon__) || defined(__loongarch__) || SANITIZER_RISCV64 || \
|
||||
defined(__sparc__)
|
||||
defined(__sparc__) || defined(__powerpc64__)
|
||||
# include <asm/ptrace.h>
|
||||
# ifdef __arm__
|
||||
typedef struct user_fpregs elf_fpregset_t;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@
|
|||
#include <sys/types.h> // for pid_t
|
||||
#include <sys/uio.h> // for iovec
|
||||
#include <elf.h> // for NT_PRSTATUS
|
||||
#if (defined(__aarch64__) || SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
|
||||
#if (defined(__aarch64__) || defined(__powerpc64__) || \
|
||||
SANITIZER_RISCV64 || SANITIZER_LOONGARCH64) && \
|
||||
!SANITIZER_ANDROID
|
||||
// GLIBC 2.20+ sys/user does not include asm/ptrace.h
|
||||
# include <asm/ptrace.h>
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ fn addCcArgs(target: std.Target, args: *std.ArrayList([]const u8)) error{OutOfMe
|
|||
"-std=c++17",
|
||||
"-fno-rtti",
|
||||
"-fno-exceptions",
|
||||
"-w", // Disable all warnings.
|
||||
});
|
||||
|
||||
if (target.abi.isAndroid() and target.os.version_range.linux.android >= 29) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue