llvm20: add _GNU_SOURCE define for another source file

This commit is contained in:
Jérôme Duval
2025-03-15 10:17:20 +01:00
parent 2609cbd79c
commit d5fbbec816

View File

@@ -370,7 +370,7 @@ index a1e9eca..cc563d7 100644
2.45.2
From 8e4dcdc6b46688e5067bef2bdc07a81d932af3ed Mon Sep 17 00:00:00 2001
From a9e7dab82fa1952557b0da7724ba2eeef3b7f854 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= <jerome.duval@gmail.com>
Date: Thu, 6 Feb 2025 21:08:43 +0100
Subject: Haiku: Address sanitizer on x86_64
@@ -1020,13 +1020,14 @@ index 8b7874b..489c948 100644
// Syscall wrappers.
uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count);
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
index e11eff1..43e9fb6 100644
index e11eff1..950f644 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp
@@ -13,8 +13,9 @@
@@ -13,8 +13,10 @@
#include "sanitizer_platform.h"
+#define _GNU_SOURCE 1
+#define _DEFAULT_SOURCE 1
#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD || \
- SANITIZER_SOLARIS
@@ -1034,7 +1035,7 @@ index e11eff1..43e9fb6 100644
# include "sanitizer_allocator_internal.h"
# include "sanitizer_atomic.h"
@@ -74,6 +75,11 @@ extern "C" int __sys_sigaction(int signum, const struct sigaction *act,
@@ -74,6 +76,11 @@ extern "C" int __sys_sigaction(int signum, const struct sigaction *act,
# include <thread.h>
# endif
@@ -1046,7 +1047,7 @@ index e11eff1..43e9fb6 100644
# if SANITIZER_ANDROID
# include <android/api-level.h>
# if !defined(CPU_COUNT) && !defined(__aarch64__)
@@ -650,7 +656,6 @@ static void GetTls(uptr *addr, uptr *size) {
@@ -650,7 +657,6 @@ static void GetTls(uptr *addr, uptr *size) {
*addr = (uptr)tcb->tcb_dtv[1];
}
}
@@ -1054,7 +1055,7 @@ index e11eff1..43e9fb6 100644
# error "Unknown OS"
# endif
}
@@ -720,8 +725,13 @@ static int AddModuleSegments(const char *module_name, dl_phdr_info *info,
@@ -720,8 +726,13 @@ static int AddModuleSegments(const char *module_name, dl_phdr_info *info,
if (phdr->p_type == PT_LOAD) {
uptr cur_beg = info->dlpi_addr + phdr->p_vaddr;
uptr cur_end = cur_beg + phdr->p_memsz;
@@ -1068,7 +1069,7 @@ index e11eff1..43e9fb6 100644
cur_module.addAddressRange(cur_beg, cur_end, executable, writable);
} else if (phdr->p_type == PT_NOTE) {
# ifdef NT_GNU_BUILD_ID
@@ -857,6 +867,10 @@ u32 GetNumberOfCPUs() {
@@ -857,6 +868,10 @@ u32 GetNumberOfCPUs() {
req[1] = HW_NCPU;
CHECK_EQ(internal_sysctl(req, 2, &ncpu, &len, NULL, 0), 0);
return ncpu;