nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 529 lines 20 kB view raw
1{ 2 lib, 3 stdenv, 4 llvmPackages_18, 5 overrideCC, 6 rocm-device-libs, 7 rocm-runtime, 8 fetchFromGitHub, 9 runCommand, 10 symlinkJoin, 11 rdfind, 12 wrapBintoolsWith, 13 emptyDirectory, 14 zstd, 15 zlib, 16 gcc-unwrapped, 17 glibc, 18 replaceVars, 19 libffi, 20 libxml2, 21 removeReferencesTo, 22 fetchpatch, 23 # Build compilers and stdenv suitable for profiling 24 # compressed line tables (-g1 -gz) and 25 # frame pointers for sampling profilers (-fno-omit-frame-pointer -momit-leaf-frame-pointer) 26 # TODO: Should also apply to downstream packages which use rocmClangStdenv 27 profilableStdenv ? false, 28}: 29 30let 31 llvmPackagesNoBintools = llvmPackages_18.override { 32 bootBintools = null; 33 bootBintoolsNoLibc = null; 34 }; 35 useLibcxx = false; # whether rocm stdenv uses libcxx (clang c++ stdlib) instead of gcc stdlibc++ 36 37 llvmStdenv = overrideCC llvmPackagesNoBintools.libcxxStdenv llvmPackagesNoBintools.clangUseLLVM; 38 llvmLibstdcxxStdenv = overrideCC llvmPackagesNoBintools.stdenv ( 39 llvmPackagesNoBintools.libstdcxxClang.override { 40 inherit (llvmPackages_18) bintools; 41 } 42 ); 43 stdenvToBuildRocmLlvm = if useLibcxx then llvmStdenv else llvmLibstdcxxStdenv; 44 gcc-include = runCommand "gcc-include" { } '' 45 mkdir -p $out 46 ln -s ${gcc-unwrapped}/include/ $out/ 47 ln -s ${gcc-unwrapped}/lib/ $out/ 48 ''; 49 50 # A prefix for use as the GCC prefix when building rocmcxx 51 disallowedRefsForToolchain = [ 52 stdenv.cc 53 stdenv.cc.cc 54 stdenv.cc.bintools 55 gcc-unwrapped 56 stdenvToBuildRocmLlvm 57 stdenvToBuildRocmLlvm.cc 58 stdenvToBuildRocmLlvm.cc.cc 59 ]; 60 gcc-prefix = 61 let 62 gccPrefixPaths = [ 63 gcc-unwrapped 64 gcc-unwrapped.lib 65 glibc.dev 66 ]; 67 in 68 symlinkJoin { 69 name = "gcc-prefix"; 70 paths = gccPrefixPaths ++ [ 71 glibc 72 ]; 73 disallowedRequisites = gccPrefixPaths; 74 postBuild = '' 75 rm -rf $out/{bin,libexec,nix-support,lib64,share,etc} 76 rm $out/lib/gcc/x86_64-unknown-linux-gnu/*/plugin/include/auto-host.h 77 78 mkdir /build/tmpout 79 mv $out/* /build/tmpout 80 cp -Lr --no-preserve=mode /build/tmpout/* $out/ 81 set -x 82 versionedIncludePath="$(echo $out/include/c++/*/)" 83 mv $versionedIncludePath/* $out/include/c++/ 84 rm -rf $versionedIncludePath/ 85 86 find $out/lib -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${gcc-unwrapped.lib} {} + 87 88 ln -s $out $out/x86_64-unknown-linux-gnu 89 ''; 90 }; 91 version = "6.3.1"; 92 # major version of this should be the clang version ROCm forked from 93 rocmLlvmVersion = "18.0.0-${llvmSrc.rev}"; 94 usefulOutputs = 95 drv: 96 builtins.filter (x: x != null) [ 97 drv 98 (drv.lib or null) 99 (drv.dev or null) 100 ]; 101 listUsefulOutputs = builtins.concatMap usefulOutputs; 102 llvmSrc = fetchFromGitHub { 103 # Performance improvements cherry-picked on top of rocm-6.3.x 104 # most importantly, amdgpu-early-alwaysinline memory usage fix 105 owner = "LunNova"; 106 repo = "llvm-project-rocm"; 107 rev = "4182046534deb851753f0d962146e5176f648893"; 108 hash = "sha256-sPmYi1WiiAqnRnHVNba2nPUxGflBC01FWCTNLPlYF9c="; 109 }; 110 llvmSrcFixed = llvmSrc; 111 llvmMajorVersion = lib.versions.major rocmLlvmVersion; 112 # An llvmPackages (pkgs/development/compilers/llvm/) built from ROCm LLVM's source tree 113 # optionally using LLVM libcxx 114 llvmPackagesRocm = llvmPackages_18.override (_old: { 115 stdenv = stdenvToBuildRocmLlvm; # old.stdenv #llvmPackagesNoBintools.libcxxStdenv; 116 117 # not setting gitRelease = because that causes patch selection logic to use git patches 118 # ROCm LLVM is closer to 18 official 119 # gitRelease = {}; officialRelease = null; 120 officialRelease = { }; # Set but empty because we're overriding everything from it. 121 version = rocmLlvmVersion; 122 src = llvmSrcFixed; 123 monorepoSrc = llvmSrcFixed; 124 doCheck = false; 125 }); 126 sysrootCompiler = 127 cc: name: paths: 128 let 129 linked = symlinkJoin { inherit name paths; }; 130 in 131 runCommand name 132 { 133 # If this is erroring, try why-depends --precise on the symlinkJoin of inputs to look for the problem 134 # nix why-depends --precise .#rocmPackages.llvm.rocmcxx.linked /store/path/its/not/allowed 135 disallowedRequisites = disallowedRefsForToolchain; 136 passthru.linked = linked; 137 } 138 '' 139 set -x 140 mkdir -p $out/ 141 cp --reflink=auto -rL ${linked}/* $out/ 142 chmod -R +rw $out 143 mkdir -p $out/usr 144 ln -s $out/ $out/usr/local 145 mkdir -p $out/nix-support/ 146 # we don't need mixed 32 bit, the presence of lib64 is used by LLVM to decide it's a multilib sysroot 147 rm -rf $out/lib64 148 echo 'export CC=clang' >> $out/nix-support/setup-hook 149 echo 'export CXX=clang++' >> $out/nix-support/setup-hook 150 mkdir -p $out/lib/clang/${llvmMajorVersion}/lib/linux/ 151 ln -s $out/lib/linux/libclang_rt.* $out/lib/clang/${llvmMajorVersion}/lib/linux/ 152 153 find $out -type f -exec sed -i "s|${cc.out}|$out|g" {} + 154 find $out -type f -exec sed -i "s|${cc.dev}|$out|g" {} + 155 156 # our /include now has more than clang expects, so this specific dir still needs to point to cc.dev 157 # FIXME: could copy into a different subdir? 158 sed -i 's|set(CLANG_INCLUDE_DIRS.*$|set(CLANG_INCLUDE_DIRS "${cc.dev}/include")|g' $out/lib/cmake/clang/ClangConfig.cmake 159 ${lib.getExe rdfind} -makesymlinks true $out/ # create links *within* the sysroot to save space 160 ''; 161 findClangNostdlibincPatch = 162 x: 163 ( 164 (lib.strings.hasSuffix "add-nostdlibinc-flag.patch" (builtins.baseNameOf x)) 165 || (lib.strings.hasSuffix "clang-at-least-16-LLVMgold-path.patch" (builtins.baseNameOf x)) 166 ); 167 llvmTargetsFlag = "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${ 168 { 169 "x86_64" = "X86"; 170 "aarch64" = "AArch64"; 171 } 172 .${llvmStdenv.targetPlatform.parsed.cpu.name} 173 or (throw "Unsupported CPU architecture: ${llvmStdenv.targetPlatform.parsed.cpu.name}") 174 }"; 175 # -ffat-lto-objects = emit LTO object files that are compatible with non-LTO-supporting builds too 176 # FatLTO objects are a special type of fat object file that contain LTO compatible IR in addition to generated object code, 177 # instead of containing object code for multiple target architectures. This allows users to defer the choice of whether to 178 # use LTO or not to link-time, and has been a feature available in other compilers, like GCC, for some time. 179 180 tablegenUsage = x: !(lib.strings.hasInfix "llvm-tblgen" x); 181 addGccLtoCmakeFlags = !llvmPackagesRocm.stdenv.cc.isClang; 182 llvmExtraCflags = 183 "-O3 -DNDEBUG -march=skylake -mtune=znver3" 184 + (lib.optionalString addGccLtoCmakeFlags " -D_GLIBCXX_USE_CXX11_ABI=0 -flto -ffat-lto-objects -flto-compression-level=19 -Wl,-flto") 185 + (lib.optionalString llvmPackagesRocm.stdenv.cc.isClang " -flto=thin -ffat-lto-objects") 186 + (lib.optionalString profilableStdenv " -fno-omit-frame-pointer -momit-leaf-frame-pointer -gz -g1"); 187in 188rec { 189 inherit (llvmPackagesRocm) libunwind; 190 inherit (llvmPackagesRocm) libcxx; 191 # Pass through original attrs for debugging where non-overridden llvm/clang is getting used 192 # llvm-orig = llvmPackagesRocm.llvm; # nix why-depends --derivation .#rocmPackages.clr .#rocmPackages.llvm.llvm-orig 193 # clang-orig = llvmPackagesRocm.clang; # nix why-depends --derivation .#rocmPackages.clr .#rocmPackages.llvm.clang-orig 194 llvm = (llvmPackagesRocm.llvm.override { ninja = emptyDirectory; }).overrideAttrs (old: { 195 dontStrip = profilableStdenv; 196 nativeBuildInputs = old.nativeBuildInputs ++ [ removeReferencesTo ]; 197 buildInputs = old.buildInputs ++ [ 198 zstd 199 zlib 200 ]; 201 env.NIX_BUILD_ID_STYLE = "fast"; 202 postPatch = '' 203 ${old.postPatch or ""} 204 patchShebangs lib/OffloadArch/make_generated_offload_arch_h.sh 205 ''; 206 LDFLAGS = "-Wl,--build-id=sha1,--icf=all,--compress-debug-sections=zlib"; 207 cmakeFlags = 208 (builtins.filter tablegenUsage old.cmakeFlags) 209 ++ [ 210 llvmTargetsFlag 211 "-DCMAKE_BUILD_TYPE=Release" 212 "-DLLVM_ENABLE_ZSTD=FORCE_ON" 213 "-DLLVM_ENABLE_ZLIB=FORCE_ON" 214 "-DLLVM_ENABLE_THREADS=ON" 215 "-DLLVM_ENABLE_LTO=Thin" 216 "-DLLVM_USE_LINKER=lld" 217 (lib.cmakeBool "LLVM_ENABLE_LIBCXX" useLibcxx) 218 "-DCLANG_DEFAULT_CXX_STDLIB=${if useLibcxx then "libc++" else "libstdc++"}" 219 ] 220 ++ lib.optionals addGccLtoCmakeFlags [ 221 "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" 222 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" 223 "-DCMAKE_NM=${gcc-unwrapped}/bin/gcc-nm" 224 ] 225 ++ lib.optionals useLibcxx [ 226 "-DLLVM_ENABLE_LTO=Thin" 227 "-DLLVM_USE_LINKER=lld" 228 "-DLLVM_ENABLE_LIBCXX=ON" 229 ]; 230 preConfigure = '' 231 ${old.preConfigure or ""} 232 cmakeFlagsArray+=( 233 '-DCMAKE_C_FLAGS_RELEASE=${llvmExtraCflags}' 234 '-DCMAKE_CXX_FLAGS_RELEASE=${llvmExtraCflags}' 235 ) 236 ''; 237 # Ensure we don't leak refs to compiler that was used to bootstrap this LLVM 238 disallowedReferences = (old.disallowedReferences or [ ]) ++ disallowedRefsForToolchain; 239 postFixup = '' 240 ${old.postFixup or ""} 241 remove-references-to -t "${stdenv.cc}" "$lib/lib/libLLVMSupport.a" 242 find $lib -type f -exec remove-references-to -t ${stdenv.cc.cc} {} + 243 find $lib -type f -exec remove-references-to -t ${stdenvToBuildRocmLlvm.cc} {} + 244 find $lib -type f -exec remove-references-to -t ${stdenv.cc.bintools} {} + 245 ''; 246 }); 247 lld = 248 (llvmPackagesRocm.lld.override { 249 libllvm = llvm; 250 ninja = emptyDirectory; 251 }).overrideAttrs 252 (old: { 253 patches = builtins.filter ( 254 x: !(lib.strings.hasSuffix "more-openbsd-program-headers.patch" (builtins.baseNameOf x)) 255 ) old.patches; 256 dontStrip = profilableStdenv; 257 nativeBuildInputs = old.nativeBuildInputs ++ [ 258 llvmPackagesNoBintools.lld 259 removeReferencesTo 260 ]; 261 buildInputs = old.buildInputs ++ [ 262 zstd 263 zlib 264 ]; 265 env.NIX_BUILD_ID_STYLE = "fast"; 266 LDFLAGS = "-Wl,--build-id=sha1,--icf=all,--compress-debug-sections=zlib"; 267 cmakeFlags = 268 (builtins.filter tablegenUsage old.cmakeFlags) 269 ++ [ 270 llvmTargetsFlag 271 "-DCMAKE_BUILD_TYPE=Release" 272 "-DLLVM_ENABLE_ZSTD=FORCE_ON" 273 "-DLLVM_ENABLE_ZLIB=FORCE_ON" 274 "-DLLVM_ENABLE_THREADS=ON" 275 "-DLLVM_ENABLE_LTO=Thin" 276 "-DLLVM_USE_LINKER=lld" 277 (lib.cmakeBool "LLVM_ENABLE_LIBCXX" useLibcxx) 278 "-DCLANG_DEFAULT_CXX_STDLIB=${if useLibcxx then "libc++" else "libstdc++"}" 279 ] 280 ++ lib.optionals addGccLtoCmakeFlags [ 281 "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" 282 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" 283 "-DCMAKE_NM=${gcc-unwrapped}/bin/gcc-nm" 284 ] 285 ++ lib.optionals useLibcxx [ 286 "-DLLVM_ENABLE_LIBCXX=ON" 287 ]; 288 # Ensure we don't leak refs to compiler that was used to bootstrap this LLVM 289 disallowedReferences = (old.disallowedReferences or [ ]) ++ disallowedRefsForToolchain; 290 postFixup = '' 291 ${old.postFixup or ""} 292 find $lib -type f -exec remove-references-to -t ${stdenv.cc.cc} {} + 293 find $lib -type f -exec remove-references-to -t ${stdenv.cc.bintools} {} + 294 ''; 295 preConfigure = '' 296 ${old.preConfigure or ""} 297 cmakeFlagsArray+=( 298 '-DCMAKE_C_FLAGS_RELEASE=${llvmExtraCflags}' 299 '-DCMAKE_CXX_FLAGS_RELEASE=${llvmExtraCflags}' 300 ) 301 ''; 302 }); 303 clang-unwrapped = 304 ( 305 (llvmPackagesRocm.clang-unwrapped.override { 306 libllvm = llvm; 307 ninja = emptyDirectory; 308 }).overrideAttrs 309 ( 310 old: 311 let 312 filteredPatches = builtins.filter (x: !(findClangNostdlibincPatch x)) old.patches; 313 in 314 { 315 meta.platforms = [ 316 "x86_64-linux" 317 ]; 318 pname = "${old.pname}-rocm"; 319 patches = filteredPatches ++ [ 320 # Never add FHS include paths 321 ./clang-bodge-ignore-systemwide-incls.diff 322 # Prevents builds timing out if a single compiler invocation is very slow but 323 # per-arch jobs are completing by ensuring there's terminal output 324 ./clang-log-jobs.diff 325 (fetchpatch { 326 # [ClangOffloadBundler]: Add GetBundleIDsInFile to OffloadBundler 327 sha256 = "sha256-G/mzUdFfrJ2bLJgo4+mBcR6Ox7xGhWu5X+XxT4kH2c8="; 328 url = "https://github.com/GZGavinZhao/rocm-llvm-project/commit/6d296f879b0fed830c54b2a9d26240da86c8bb3a.patch"; 329 relative = "clang"; 330 }) 331 # FIXME: Needed due to https://github.com/NixOS/nixpkgs/issues/375431 332 # Once we can switch to overrideScope this can be removed 333 (replaceVars ./../../../compilers/llvm/common/clang/clang-at-least-16-LLVMgold-path.patch { 334 libllvmLibdir = "${llvm.lib}/lib"; 335 }) 336 ]; 337 nativeBuildInputs = old.nativeBuildInputs ++ [ 338 llvmPackagesNoBintools.lld 339 removeReferencesTo 340 ]; 341 buildInputs = old.buildInputs ++ [ 342 zstd 343 zlib 344 ]; 345 dontStrip = profilableStdenv; 346 LDFLAGS = "-Wl,--build-id=sha1,--icf=all,--compress-debug-sections=zlib"; 347 env = (old.env or { }) // { 348 NIX_BUILD_ID_STYLE = "fast"; 349 }; 350 # Ensure we don't leak refs to compiler that was used to bootstrap this LLVM 351 disallowedReferences = (old.disallowedReferences or [ ]) ++ disallowedRefsForToolchain; 352 # Enable structured attrs for separateDebugInfo, because it is required with disallowedReferences set 353 __structuredAttrs = true; 354 requiredSystemFeatures = (old.requiredSystemFeatures or [ ]) ++ [ "big-parallel" ]; 355 # https://github.com/llvm/llvm-project/blob/6976deebafa8e7de993ce159aa6b82c0e7089313/clang/cmake/caches/DistributionExample-stage2.cmake#L9-L11 356 cmakeFlags = 357 (builtins.filter tablegenUsage old.cmakeFlags) 358 ++ [ 359 llvmTargetsFlag 360 "-DCMAKE_BUILD_TYPE=Release" 361 "-DLLVM_ENABLE_ZSTD=FORCE_ON" 362 "-DLLVM_ENABLE_ZLIB=FORCE_ON" 363 "-DLLVM_ENABLE_THREADS=ON" 364 "-DLLVM_ENABLE_LTO=Thin" 365 "-DLLVM_USE_LINKER=lld" 366 (lib.cmakeBool "LLVM_ENABLE_LIBCXX" useLibcxx) 367 "-DCLANG_DEFAULT_CXX_STDLIB=${if useLibcxx then "libc++" else "libstdc++"}" 368 ] 369 ++ lib.optionals addGccLtoCmakeFlags [ 370 "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" 371 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" 372 "-DCMAKE_NM=${gcc-unwrapped}/bin/gcc-nm" 373 ] 374 ++ lib.optionals useLibcxx [ 375 "-DLLVM_ENABLE_LTO=Thin" 376 "-DLLVM_ENABLE_LIBCXX=ON" 377 "-DLLVM_USE_LINKER=lld" 378 "-DCLANG_DEFAULT_RTLIB=compiler-rt" 379 ] 380 ++ lib.optionals (!useLibcxx) [ 381 # FIXME: Config file in rocmcxx instead of GCC_INSTALL_PREFIX? 382 "-DGCC_INSTALL_PREFIX=${gcc-prefix}" 383 ]; 384 postFixup = (old.postFixup or "") + '' 385 find $lib -type f -exec remove-references-to -t ${stdenvToBuildRocmLlvm.cc} {} + 386 find $lib -type f -exec remove-references-to -t ${stdenv.cc} {} + 387 find $lib -type f -exec remove-references-to -t ${stdenv.cc.cc} {} + 388 find $lib -type f -exec remove-references-to -t ${stdenv.cc.bintools} {} + 389 ''; 390 preConfigure = (old.preConfigure or "") + '' 391 cmakeFlagsArray+=( 392 '-DCMAKE_C_FLAGS_RELEASE=${llvmExtraCflags}' 393 '-DCMAKE_CXX_FLAGS_RELEASE=${llvmExtraCflags}' 394 ) 395 ''; 396 } 397 ) 398 ) 399 // { 400 libllvm = llvm; 401 }; 402 # A clang that understands standard include searching in a GNU sysroot and will put GPU libs in include path 403 # in the right order 404 # and expects its libc to be in the sysroot 405 rocmcxx = 406 (sysrootCompiler clang-unwrapped "rocmcxx" ( 407 listUsefulOutputs ( 408 [ 409 clang-unwrapped 410 bintools 411 compiler-rt 412 ] 413 ++ (lib.optionals useLibcxx [ 414 libcxx 415 ]) 416 ++ (lib.optionals (!useLibcxx) [ 417 gcc-include 418 glibc 419 glibc.dev 420 ]) 421 ) 422 )) 423 // { 424 version = llvmMajorVersion; 425 cc = rocmcxx; 426 libllvm = llvm; 427 isClang = true; 428 isGNU = false; 429 }; 430 clang-tools = llvmPackagesRocm.clang-tools.override { 431 inherit clang-unwrapped clang; 432 }; 433 compiler-rt-libc = llvmPackagesRocm.compiler-rt-libc.overrideAttrs (old: { 434 patches = old.patches ++ [ 435 (fetchpatch { 436 name = "Fix-missing-main-function-in-float16-bfloat16-support-checks.patch"; 437 url = "https://github.com/ROCm/llvm-project/commit/68d8b3846ab1e6550910f2a9a685690eee558af2.patch"; 438 hash = "sha256-Db+L1HFMWVj4CrofsGbn5lnMoCzEcU+7q12KKFb17/g="; 439 relative = "compiler-rt"; 440 }) 441 ]; 442 }); 443 compiler-rt = compiler-rt-libc; 444 bintools = wrapBintoolsWith { 445 bintools = llvmPackagesRocm.bintools-unwrapped.override { 446 inherit lld llvm; 447 }; 448 }; 449 450 clang = rocmcxx; 451 452 # Emulate a monolithic ROCm LLVM build to support building ROCm's in-tree LLVM projects 453 rocm-merged-llvm = symlinkJoin { 454 name = "rocm-llvm-merge"; 455 paths = [ 456 llvm 457 llvm.dev 458 lld 459 lld.lib 460 lld.dev 461 libunwind 462 libunwind.dev 463 compiler-rt 464 compiler-rt.dev 465 rocmcxx 466 ] 467 ++ lib.optionals useLibcxx [ 468 libcxx 469 libcxx.out 470 libcxx.dev 471 ]; 472 postBuild = builtins.unsafeDiscardStringContext '' 473 found_files=$(find $out -name '*.cmake') 474 if [ -z "$found_files" ]; then 475 >&2 echo "Error: No CMake files found in $out" 476 exit 1 477 fi 478 479 for target in ${clang-unwrapped.out} ${clang-unwrapped.lib} ${clang-unwrapped.dev}; do 480 if grep "$target" $found_files; then 481 >&2 echo "Unexpected ref to $target (clang-unwrapped) found" 482 # exit 1 483 # # FIXME: enable this to reduce closure size 484 fi 485 done 486 ''; 487 inherit version; 488 llvm-src = llvmSrc; 489 }; 490 491 rocmClangStdenv = overrideCC ( 492 if useLibcxx then llvmPackagesRocm.libcxxStdenv else llvmPackagesRocm.stdenv 493 ) clang; 494 495 # Projects 496 openmp = 497 (llvmPackagesRocm.openmp.override { 498 stdenv = rocmClangStdenv; 499 llvm = rocm-merged-llvm; 500 targetLlvm = rocm-merged-llvm; 501 clang-unwrapped = clang; 502 }).overrideAttrs 503 (old: { 504 disallowedReferences = (old.disallowedReferences or [ ]) ++ disallowedRefsForToolchain; 505 nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ removeReferencesTo ]; 506 cmakeFlags = 507 old.cmakeFlags 508 ++ [ 509 "-DDEVICELIBS_ROOT=${rocm-device-libs.src}" 510 # OMPD support is broken in ROCm 6.3. Haven't investigated why. 511 "-DLIBOMP_OMPD_SUPPORT:BOOL=FALSE" 512 "-DLIBOMP_OMPD_GDB_SUPPORT:BOOL=FALSE" 513 ] 514 ++ lib.optionals addGccLtoCmakeFlags [ 515 "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar" 516 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" 517 ]; 518 env.LLVM = "${rocm-merged-llvm}"; 519 env.LLVM_DIR = "${rocm-merged-llvm}"; 520 buildInputs = old.buildInputs ++ [ 521 rocm-device-libs 522 rocm-runtime 523 zlib 524 zstd 525 libxml2 526 libffi 527 ]; 528 }); 529}