|
1 | | -{ lib |
| 1 | +{ config |
| 2 | +, lib |
2 | 3 | , stdenv |
3 | 4 | , fetchFromGitHub |
4 | 5 | , pkg-config |
@@ -68,7 +69,17 @@ stdenv.mkDerivation (finalAttrs: { |
68 | 69 | sourceRoot = "${finalAttrs.src.name}/llvm"; |
69 | 70 |
|
70 | 71 | cmakeFlags = [ |
71 | | - "-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU;NVPTX" |
| 72 | + "-DLLVM_TARGETS_TO_BUILD=${ |
| 73 | + let |
| 74 | + # Targets can be found in |
| 75 | + # https://github.com/llvm/llvm-project/tree/f28c006a5895fc0e329fe15fead81e37457cb1d1/clang/lib/Basic/Targets |
| 76 | + # NOTE: Unsure of how "host" would function, especially given that we might be cross-compiling. |
| 77 | + llvmTargets = [ "AMDGPU" "NVPTX" ] |
| 78 | + ++ lib.optionals stdenv.isAarch64 [ "AArch64" ] |
| 79 | + ++ lib.optionals stdenv.isx86_64 [ "X86" ]; |
| 80 | + in |
| 81 | + lib.concatStringsSep ";" llvmTargets |
| 82 | + }" |
72 | 83 | "-DLLVM_ENABLE_PROJECTS=llvm;mlir" |
73 | 84 | "-DLLVM_INSTALL_UTILS=ON" |
74 | 85 | ] ++ lib.optionals (buildDocs || buildMan) [ |
@@ -107,6 +118,8 @@ stdenv.mkDerivation (finalAttrs: { |
107 | 118 | license = with licenses; [ ncsa ]; |
108 | 119 | maintainers = with maintainers; [ SomeoneSerge Madouura ]; |
109 | 120 | platforms = platforms.linux; |
110 | | - broken = stdenv.isAarch64; # https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344 |
| 121 | + # Consider the derivation broken if we're not building for CUDA or ROCm, or if we're building for aarch64 |
| 122 | + # and ROCm is enabled. See https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344. |
| 123 | + broken = stdenv.isAarch64 && !config.cudaSupport; |
111 | 124 | }; |
112 | 125 | }) |
0 commit comments