syzkaller: Use cross compilation (#427494)

authored by

Moritz Sanft and committed by
GitHub
cb9e9db2 9027305b

+18 -1
+18 -1
pkgs/by-name/sy/syzkaller/package.nix
··· 5 5 go, 6 6 ncurses, 7 7 }: 8 + let 9 + cpus = { 10 + "x86_64" = "amd64"; 11 + "i686" = "386"; 12 + "aarch64" = "arm64"; 13 + }; 14 + targetSystem = lib.systems.parse.mkSystemFromString stdenv.targetPlatform.system; 15 + targetOS = targetSystem.kernel.name; 16 + targetArch = cpus.${targetSystem.cpu.name}; 17 + targetVMArch = cpus.${(lib.systems.parse.mkSystemFromString stdenv.hostPlatform.system).cpu.name}; 18 + in 8 19 stdenv.mkDerivation (finalAttrs: { 9 20 pname = "syzkaller"; 10 21 version = "0-unstable-2024-01-09"; ··· 47 58 runHook postConfigure 48 59 ''; 49 60 61 + makeFlags = [ 62 + "TARGETOS=${targetOS}" 63 + "TARGETVMARCH=${targetVMArch}" 64 + "TARGETARCH=${targetArch}" 65 + ]; 66 + 50 67 dontInstall = true; 51 68 52 69 meta = { ··· 54 71 homepage = "https://github.com/google/syzkaller"; 55 72 license = lib.licenses.asl20; 56 73 maintainers = [ lib.maintainers.msanft ]; 57 - platforms = lib.platforms.linux; 74 + platforms = lib.platforms.unix; 58 75 mainProgram = "syz-manager"; 59 76 }; 60 77 })