diff --git a/overlays/linux-lava.nix b/overlays/linux-lava.nix index 4cfa1a4..321532f 100644 --- a/overlays/linux-lava.nix +++ b/overlays/linux-lava.nix @@ -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 ''; };