python/lxml_html_clean: update to 0.4.1
[oi-userland.git] / components / developer / gcc-10 / patches / 0025-Fix-libsanitizer-build-for-illumos.patch
blob387ff5beee41da0d10fd308c94388243a4bcd5f0
1 From 01fed75bce97d35b597fa51c3e5bbe1b0e1cd1bb Mon Sep 17 00:00:00 2001
2 From: Aurelien Larcher <aurelien.larcher@gmail.com>
3 Date: Tue, 12 Nov 2019 15:01:57 +0000
4 Subject: [PATCH 25/34] Fix libsanitizer build for illumos
6 ---
7 .../sanitizer_platform_limits_solaris.h | 11 +++++++++++
8 .../sanitizer_common/sanitizer_posix_libcdep.cpp | 10 +++++-----
9 2 files changed, 16 insertions(+), 5 deletions(-)
11 diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_solaris.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_solaris.h
12 index 77ae6e6a44d..25f11e00ef8 100644
13 --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_solaris.h
14 +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_solaris.h
15 @@ -19,6 +19,9 @@
16 #include "sanitizer_internal_defs.h"
17 #include "sanitizer_platform.h"
19 +struct stat;
20 +struct dirent;
22 namespace __sanitizer {
23 extern unsigned struct_utsname_sz;
24 extern unsigned struct_stat_sz;
25 @@ -336,6 +339,14 @@ struct __sanitizer_glob_t {
26 uptr gl_offs;
27 char **gl_pathp;
28 int gl_pathn;
29 + int gl_matchc;
30 + int gl_flags;
31 + struct stat **gl_statv;
32 + void (*gl_closedir)(void *);
33 + struct dirent *(*gl_readdir)(void *);
34 + void *(*gl_opendir)(const char *);
35 + int (*gl_lstat)(const char *, struct stat *);
36 + int (*gl_stat)(const char *, struct stat *);
39 extern int glob_nomatch;
40 diff --git a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
41 index 304b3a01a08..745753f0d8f 100644
42 --- a/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
43 +++ b/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cpp
44 @@ -64,24 +64,24 @@ void ReleaseMemoryPagesToOS(uptr beg, uptr end) {
45 // In the default Solaris compilation environment, madvise() is declared
46 // to take a caddr_t arg; casting it to void * results in an invalid
47 // conversion error, so use char * instead.
48 - madvise((char *)beg_aligned, end_aligned - beg_aligned,
49 + posix_madvise((char *)beg_aligned, end_aligned - beg_aligned,
50 SANITIZER_MADVISE_DONTNEED);
53 void SetShadowRegionHugePageMode(uptr addr, uptr size) {
54 #ifdef MADV_NOHUGEPAGE // May not be defined on old systems.
55 if (common_flags()->no_huge_pages_for_shadow)
56 - madvise((char *)addr, size, MADV_NOHUGEPAGE);
57 + posix_madvise((char *)addr, size, MADV_NOHUGEPAGE);
58 else
59 - madvise((char *)addr, size, MADV_HUGEPAGE);
60 + posix_madvise((char *)addr, size, MADV_HUGEPAGE);
61 #endif // MADV_NOHUGEPAGE
64 bool DontDumpShadowMemory(uptr addr, uptr length) {
65 #if defined(MADV_DONTDUMP)
66 - return madvise((char *)addr, length, MADV_DONTDUMP) == 0;
67 + return posix_madvise((char *)addr, length, MADV_DONTDUMP) == 0;
68 #elif defined(MADV_NOCORE)
69 - return madvise((char *)addr, length, MADV_NOCORE) == 0;
70 + return posix_madvise((char *)addr, length, MADV_NOCORE) == 0;
71 #else
72 return true;
73 #endif // MADV_DONTDUMP
74 --
75 2.31.1