overlays/linux-lava: get rid of --target warning

This commit is contained in:
Cilly Leang 2025-08-18 17:46:13 +10:00
parent e7d5efd169
commit 2d85d6635b
Signed by: cilly
GPG key ID: 6500251E087653C9

View file

@ -1,12 +1,16 @@
self: super: let
llvmPackages = super.llvmPackages_19;
clangVersion = super.lib.versions.major llvmPackages.libclang.version;
addFlagsScript = "$out/nix-support/add-local-cc-cflags-before.sh";
cc = llvmPackages.stdenv.cc.override {
# :sob: see https://github.com/NixOS/nixpkgs/issues/142901
bintools = llvmPackages.bintools;
# https://github.com/NixOS/nixpkgs/issues/368850
extraBuildCommands = ''
cat <(echo "NIX_CC_WRAPPER_SUPPRESS_TARGET_WARNING=1") "${addFlagsScript}" > "${addFlagsScript}.new"
mv "${addFlagsScript}.new" "${addFlagsScript}"
substituteInPlace "$out/nix-support/cc-cflags" --replace " -nostdlibinc" ""
substituteInPlace "$out/nix-support/add-local-cc-cflags-before.sh" --replace 'echo "Warning: supplying the --target argument to a nix-wrapped compiler may not work correctly - cc-wrapper is currently not designed with multi-target compilers in mind. You may want to use an un-wrapped compiler instead." >&2' ""
echo " -resource-dir=${llvmPackages.libclang.lib}/lib/clang/${clangVersion}" >> $out/nix-support/cc-cflags
'';
};