Skip to content

Commit

Permalink
Try to enable amdclang
Browse files Browse the repository at this point in the history
Signed-off-by: Zhou Qiankang <wszqkzqk@qq.com>
  • Loading branch information
wszqkzqk committed Feb 22, 2025
1 parent d9bed89 commit 5f79a20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 24 deletions.
19 changes: 8 additions & 11 deletions rocm-llvm/loong.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/PKGBUILD b/PKGBUILD
index 3523ba3..10ce853 100644
index 3523ba3..a972eef 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,6 +13,11 @@ source=("$pkgbase::git+https://github.com/ROCm/llvm-project#tag=rocm-$pkgver")
Expand All @@ -14,19 +14,16 @@ index 3523ba3..10ce853 100644
build() {
# Build only minimal debug info to reduce size
CFLAGS+=' -g1'
@@ -27,10 +32,7 @@ build() {
-DLLVM_HOST_TRIPLE=$CHOST
-DLLVM_ENABLE_PROJECTS='llvm;clang;lld;compiler-rt;clang-tools-extra'
-DCLANG_ENABLE_AMDCLANG=ON
- -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'
- -DLIBCXX_ENABLE_STATIC=ON
- -DLIBCXXABI_ENABLE_STATIC=ON
@@ -30,7 +35,7 @@ build() {
-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind'
-DLIBCXX_ENABLE_STATIC=ON
-DLIBCXXABI_ENABLE_STATIC=ON
- -DLLVM_TARGETS_TO_BUILD='AMDGPU;NVPTX;X86'
+ -DLLVM_TARGETS_TO_BUILD='AMDGPU;NVPTX;LoongArch'
-DCLANG_DEFAULT_LINKER=lld
-DLLVM_INSTALL_UTILS=ON
-DLLVM_ENABLE_BINDINGS=OFF
@@ -85,7 +87,7 @@ package_rocm-llvm() {
@@ -85,7 +90,7 @@ package_rocm-llvm() {

# Fix rpath to avoid error when running amdclang and friends
# (error while loading shared libraries: libunwind.so.1: cannot open shared object file: No such file or directory)
Expand All @@ -35,10 +32,10 @@ index 3523ba3..10ce853 100644

# https://bugs.archlinux.org/task/28479
install -d "$pkgdir/opt/rocm/lib/llvm/lib/bfd-plugins"
@@ -119,3 +121,6 @@ package_comgr() {
@@ -119,3 +124,6 @@ package_comgr() {
cd "$pkgbase/amd/comgr"
install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
+
+source+=("rocm-llvm-fix-fp16.patch")
+sha256sums+=('b390b7268843e2e7812baa1e13aeaf62712647596b608476b2cec32bdd05afb6')
+sha256sums+=('a0ed008fcc206ce252e0c5ca9898b768429e8fa8de13d2eb4709d1f6a98d08f5')
13 changes: 0 additions & 13 deletions rocm-llvm/rocm-llvm-fix-fp16.patch
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,6 @@ index f0e4df4bc9e1..65e4d4f85617 100644
${ARGN} "${CMAKE_CURRENT_SOURCE_DIR}/${input}"
-o "${output}"
VERBATIM
diff --git a/amd/hipcc/src/hipBin_amd.h b/amd/hipcc/src/hipBin_amd.h
index 57d009804cfe..f53ee4a4be9e 100644
--- a/amd/hipcc/src/hipBin_amd.h
+++ b/amd/hipcc/src/hipBin_amd.h
@@ -209,7 +209,7 @@ void HipBinAmd::constructCompilerPath() {
} else {
compilerPath = getRoccmPath();
hipClangPath = compilerPath;
- hipClangPath /= "lib/llvm/bin";
+ hipClangPath /= "bin";
}

compilerPath = hipClangPath.string();
diff --git a/clang/include/clang/Basic/Builtins.def b/clang/include/clang/Basic/Builtins.def
index 4dcbaf8a7bea..4fbbd52a92b3 100644
--- a/clang/include/clang/Basic/Builtins.def
Expand Down

0 comments on commit 5f79a20

Please # to comment.