1.6 KiB
1.6 KiB
rocm/llvm 7.2.4
https://github.com/ROCm/llvm-project/archive/refs/tags/rocm-7.2.4.tar.gz
disable=true
FILE=compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp
sed -i 's|^#include <linux/scc.h>|#if __has_include(<linux/scc.h>)\n#include <linux/scc.h>\n#define SANITIZER_HAS_SCC_H 1\n#else\n#define SANITIZER_HAS_SCC_H 0\n#endif|' "$FILE"
sed -i '/unsigned struct_scc_modem_sz = sizeof(struct scc_modem);/c\
#if SANITIZER_HAS_SCC_H\
unsigned struct_scc_modem_sz = sizeof(struct scc_modem);\
#else\
unsigned struct_scc_modem_sz = 0;\
#endif' "$FILE"
sed -i '/unsigned struct_scc_stat_sz = sizeof(struct scc_stat);/c\
#if SANITIZER_HAS_SCC_H\
unsigned struct_scc_stat_sz = sizeof(struct scc_stat);\
#else\
unsigned struct_scc_stat_sz = 0;\
#endif' "$FILE"
mkdir -p build; cd build
cmake ../llvm \
-DCMAKE_INSTALL_PREFIX="$pkgpath" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_TARGETS_TO_BUILD="AMDGPU;X86" \
-DLLVM_ENABLE_PROJECTS="clang;lld" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt" \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INCLUDE_DOCS=OFF \
-DCLANG_INCLUDE_TESTS=OFF
cmake --build . -j$(nproc)
cmake --install .
sed -i 's/^#define _fmaxd max$/#define _fmaxd fmax/; s/^#define _fmaxf max$/#define _fmaxf fmaxf/' lib/clang/22/include/__clang_cuda_complex_builtins.h
sed -i 's/^#define _fmaxd fmax$/#define _fmaxd __builtin_fmax/; s/^#define _fmaxf fmaxf$/#define _fmaxf __builtin_fmaxf/' \
/pkg/gnu/rocm/llvm/lib/clang/22/include/__clang_cuda_complex_builtins.h