blob: 0d982299ec6eee4a89bf52f6d93ec4a4173a9e0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
{ stdenv
, callPackage
, rocmUpdateScript
, llvm
, makeWrapper
}:
callPackage ../base.nix rec {
inherit stdenv rocmUpdateScript;
targetName = "clang-unwrapped";
targetDir = "clang";
extraBuildInputs = [ llvm makeWrapper ];
extraCMakeFlags = [
"-DCLANG_INCLUDE_DOCS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
];
extraPostPatch = ''
# Looks like they forgot to add finding libedit to the standalone build
ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules
substituteInPlace CMakeLists.txt \
--replace-fail "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)"
# `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'`
rm test/Analysis/scan-build/*.test
rm test/Analysis/scan-build/rebuild_index/rebuild_index.test
# `does not depend on a module exporting 'baz.h'`
rm test/Modules/header-attribs.cpp
# We do not have HIP or the ROCm stack available yet
rm test/Driver/hip-options.hip
# ???? `ld: cannot find crti.o: No such file or directory` linker issue?
rm test/Interpreter/dynamic-library.cpp
# `fatal error: 'stdio.h' file not found`
rm test/OpenMP/amdgcn_emit_llvm.c
'';
extraPostInstall = ''
mv bin/clang-tblgen $out/bin
# add wrapper to compress embedded accelerator-specific code
# this makes the output of composable_kernel significantly smaller right now
# TODO: remove this once ROCm does it out of the box
mv $out/bin/clang-offload-bundler $out/bin/clang-offload-bundler-unwrapped
makeWrapper $out/bin/clang-offload-bundler-unwrapped $out/bin/clang-offload-bundler \
--add-flags '-compress'
'';
requiredSystemFeatures = [ "big-parallel" ];
}
|