diff --git a/debian/changelog b/debian/changelog index c6f8d697..7869a327 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ llvm-toolchain-16 (1:16.0.6-24) UNRELEASED; urgency=medium [ Matthias Klose ] * Add a stage1 profile to disable curl, grpc and spirv. * Build with --as-needed. + * ASan: move allocator base to avoid conflict with high-entropy ASLR + for x86-64 Linux. Patch taken from LLVM 17. -- Matthias Klose Sat, 16 Mar 2024 22:12:22 +0100 diff --git a/debian/patches/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.diff b/debian/patches/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.diff new file mode 100644 index 00000000..ff9a4ec1 --- /dev/null +++ b/debian/patches/fb77ca05ffb4f8e666878f2f6718a9fb4d686839.diff @@ -0,0 +1,22 @@ +diff --git a/compiler-rt/lib/asan/asan_allocator.h b/compiler-rt/lib/asan/asan_allocator.h +index 0b4dbf03bb9d53..6a12a6c6025283 100644 +--- a/compiler-rt/lib/asan/asan_allocator.h ++++ b/compiler-rt/lib/asan/asan_allocator.h +@@ -143,11 +143,15 @@ typedef DefaultSizeClassMap SizeClassMap; + const uptr kAllocatorSpace = ~(uptr)0; + const uptr kAllocatorSize = 0x8000000000ULL; // 500G + typedef DefaultSizeClassMap SizeClassMap; +-# else ++# elif SANITIZER_APPLE + const uptr kAllocatorSpace = 0x600000000000ULL; + const uptr kAllocatorSize = 0x40000000000ULL; // 4T. + typedef DefaultSizeClassMap SizeClassMap; +-# endif ++# else ++const uptr kAllocatorSpace = 0x500000000000ULL; ++const uptr kAllocatorSize = 0x40000000000ULL; // 4T. ++typedef DefaultSizeClassMap SizeClassMap; ++# endif + template + struct AP64 { // Allocator64 parameters. Deliberately using a short name. + static const uptr kSpaceBeg = kAllocatorSpace; diff --git a/debian/patches/series b/debian/patches/series index 87ae970c..a7d5b0ba 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -156,3 +156,4 @@ D158066-simd-ppc64el.patch D142688-loong64.diff remove-unused-imp-module.diff libsanitizer-timebits.diff +fb77ca05ffb4f8e666878f2f6718a9fb4d686839.diff