diff --git a/pkgs/development/rocm-modules/5/llvm/base.nix b/pkgs/development/rocm-modules/5/llvm/base.nix index 82de9e6f3665..4fae8fbf506d 100644 --- a/pkgs/development/rocm-modules/5/llvm/base.nix +++ b/pkgs/development/rocm-modules/5/llvm/base.nix @@ -1,5 +1,6 @@ { lib , stdenv +, gcc12Stdenv , fetchFromGitHub , rocmUpdateScript , pkg-config @@ -44,6 +45,13 @@ , isBroken ? false }: +let stdenv' = stdenv; in +let stdenv = + if stdenv'.cc.cc.isGNU or false && lib.versionAtLeast stdenv'.cc.cc.version "13.0" + then gcc12Stdenv + else stdenv'; +in + let llvmNativeTarget = if stdenv.isx86_64 then "X86" diff --git a/pkgs/development/rocm-modules/5/llvm/stage-2/rstdenv.nix b/pkgs/development/rocm-modules/5/llvm/stage-2/rstdenv.nix index 45d369a6541c..3820d45a2b81 100644 --- a/pkgs/development/rocm-modules/5/llvm/stage-2/rstdenv.nix +++ b/pkgs/development/rocm-modules/5/llvm/stage-2/rstdenv.nix @@ -12,6 +12,7 @@ overrideCC stdenv (wrapCCWith rec { inherit bintools; libcxx = runtimes; cc = clang-unwrapped; + gccForLibs = stdenv.cc.cc; extraPackages = [ llvm