diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index d9174df31a2a1..8558a9f3d8d26 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -639,7 +639,7 @@ stdenvNoCC.mkDerivation { # no `/usr/include`, there’s essentially no risk to dropping # the flag there. See discussion in NixOS/nixpkgs#191152. # - + optionalString ((cc.isClang or false) && !targetPlatform.isDarwin) '' + + optionalString ((cc.isClang or false) && !(cc.isROCm or false) && !targetPlatform.isDarwin) '' echo " -nostdlibinc" >> $out/nix-support/cc-cflags '' diff --git a/pkgs/development/rocm-modules/5/llvm/base.nix b/pkgs/development/rocm-modules/5/llvm/base.nix index 1330d9d84b37f..86a865613487d 100644 --- a/pkgs/development/rocm-modules/5/llvm/base.nix +++ b/pkgs/development/rocm-modules/5/llvm/base.nix @@ -180,6 +180,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { isLLVM = targetDir == "llvm"; isClang = targetDir == "clang" || builtins.elem "clang" targetProjects; + isROCm = true; updateScript = rocmUpdateScript { name = finalAttrs.pname; diff --git a/pkgs/development/rocm-modules/5/llvm/stage-3/clang.nix b/pkgs/development/rocm-modules/5/llvm/stage-3/clang.nix index a0e4e79e4337a..c702334140d7e 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-3/clang.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-3/clang.nix @@ -40,8 +40,11 @@ wrapCCWith rec { ''; passthru.isClang = true; + passthru.isROCm = true; }); + gccForLibs = stdenv.cc.cc; + extraPackages = [ llvm lld diff --git a/pkgs/development/rocm-modules/6/llvm/base.nix b/pkgs/development/rocm-modules/6/llvm/base.nix index bbe964547a9cb..8b85ae53bcaa1 100644 --- a/pkgs/development/rocm-modules/6/llvm/base.nix +++ b/pkgs/development/rocm-modules/6/llvm/base.nix @@ -188,6 +188,7 @@ stdenv.mkDerivation (finalAttrs: { passthru = { isLLVM = targetDir == "llvm"; isClang = targetDir == "clang" || builtins.elem "clang" targetProjects; + isROCm = true; updateScript = rocmUpdateScript { name = finalAttrs.pname; diff --git a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix index 894ffed8b8b61..4afaa726ad786 100644 --- a/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix +++ b/pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix @@ -40,8 +40,11 @@ wrapCCWith rec { ''; passthru.isClang = true; + passthru.isROCm = true; }); + gccForLibs = stdenv.cc.cc; + extraPackages = [ llvm lld