Reapply "various: fix Scudo allocator due to LLVM update"

This reverts commit 5119cafc59.
This commit is contained in:
Emily
2025-09-20 16:24:40 +01:00
parent f2e6aba382
commit 85b124cedd
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ let
or (throw "scudo not supported on ${pkgs.stdenv.hostPlatform.system}"); or (throw "scudo not supported on ${pkgs.stdenv.hostPlatform.system}");
in in
{ {
libPath = "${pkgs.llvmPackages.compiler-rt}/lib/linux/libclang_rt.scudo-${systemPlatform}.so"; libPath = "${pkgs.llvmPackages.compiler-rt}/lib/linux/libclang_rt.scudo_standalone-${systemPlatform}.so";
description = '' description = ''
A user-mode allocator based on LLVM Sanitizers CombinedAllocator, A user-mode allocator based on LLVM Sanitizers CombinedAllocator,
which aims at providing additional mitigations against heap based which aims at providing additional mitigations against heap based
+1 -1
View File
@@ -39,7 +39,7 @@ in
nix.settings.allowed-users = mkDefault [ "@users" ]; nix.settings.allowed-users = mkDefault [ "@users" ];
environment.memoryAllocator.provider = mkDefault "scudo"; environment.memoryAllocator.provider = mkDefault "scudo";
environment.variables.SCUDO_OPTIONS = mkDefault "ZeroContents=1"; environment.variables.SCUDO_OPTIONS = mkDefault "zero_contents=true";
security.lockKernelModules = mkDefault true; security.lockKernelModules = mkDefault true;
@@ -102,7 +102,7 @@ stdenv.mkDerivation (finalAttrs: {
env = { env = {
NIX_CFLAGS_COMPILE = toString ( NIX_CFLAGS_COMPILE = toString (
[ [
"-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" "-DSCUDO_DEFAULT_OPTIONS=delete_size_mismatch=false:dealloc_type_mismatch=false"
] ]
++ lib.optionals (!haveLibc) [ ++ lib.optionals (!haveLibc) [
# The compiler got stricter about this, and there is a usellvm patch below # The compiler got stricter about this, and there is a usellvm patch below