|
86 | 86 |
|
87 | 87 | #if SANITIZER_APPLE |
88 | 88 | # include <Availability.h> |
89 | | -#endif |
| 89 | + |
| 90 | +// aligned_alloc was introduced in OSX 10.15 |
| 91 | +// Linking will fail when using an older SDK |
| 92 | +# if defined(__MAC_10_15) |
| 93 | +// macOS 10.15 is greater than our minimal deployment target. To ensure we |
| 94 | +// generate a weak reference so the dylib continues to work on older |
| 95 | +// systems, we need to forward declare the intercepted function as "weak |
| 96 | +// imports". |
| 97 | +SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment, |
| 98 | + __sanitizer::usize __size); |
| 99 | +# define SI_MAC_SDK_10_15_AVAILABLE 1 |
| 100 | +# else |
| 101 | +# define SI_MAC_SDK_10_15_AVAILABLE 0 |
| 102 | +# endif // defined(__MAC_10_15) |
| 103 | + |
| 104 | +#endif // SANITIZER_APPLE |
90 | 105 |
|
91 | 106 | #if SANITIZER_IOS |
92 | 107 | #define SI_IOS 1 |
|
507 | 522 | #define SANITIZER_INTERCEPT_PVALLOC (SI_GLIBC || SI_ANDROID) |
508 | 523 | #define SANITIZER_INTERCEPT_CFREE (SI_GLIBC && !SANITIZER_RISCV64) |
509 | 524 | #define SANITIZER_INTERCEPT_REALLOCARRAY SI_POSIX |
510 | | - |
511 | | -#if SANITIZER_APPLE && defined(__MAC_10_15) |
512 | | -# define SI_MAC_SDK_10_15_AVAILABLE 1 |
513 | | -#else |
514 | | -# define SI_MAC_SDK_10_15_AVAILABLE 0 |
515 | | -#endif // SANITIZER_APPLE && defined(__MAC_10_15) |
516 | | - |
517 | | -// aligned_alloc was introduced in OSX 10.15 |
518 | | -// Linking will fail when using an older SDK |
519 | | -#if SI_MAC_SDK_10_15_AVAILABLE |
520 | | -// macOS 10.15 is greater than our minimal deployment target. To ensure we |
521 | | -// generate a weak reference so the dylib continues to work on older |
522 | | -// systems, we need to forward declare the intercepted function as "weak |
523 | | -// imports". |
524 | | -SANITIZER_WEAK_IMPORT void *aligned_alloc(__sanitizer::usize __alignment, |
525 | | - __sanitizer::usize __size); |
526 | | -#endif // SI_MAC_SDK_10_15_AVAILABLE |
527 | | - |
528 | 525 | #define SANITIZER_INTERCEPT_ALIGNED_ALLOC \ |
529 | 526 | (!SI_MAC || SI_MAC_SDK_10_15_AVAILABLE) |
530 | | - |
531 | 527 | #define SANITIZER_INTERCEPT_MALLOC_USABLE_SIZE (!SI_MAC && !SI_NETBSD) |
532 | 528 | #define SANITIZER_INTERCEPT_MCHECK_MPROBE SI_LINUX_NOT_ANDROID |
533 | 529 | #define SANITIZER_INTERCEPT_WCSLEN 1 |
|
0 commit comments