summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyang Wu <xgreenlandforwyy@gmail.com>2023-02-06 10:48:10 +0800
committerSam James <sam@gentoo.org>2023-02-06 03:58:49 +0000
commit488879eeea7979b54150b096a326a33c62e5efe2 (patch)
tree08d446aaf756127d3e0ce120381941aa3142dedc /dev-util/hip/files/hip-5.3.3-correct-ldflag.patch
parentapp-text/lowdown: add 1.0.0 (diff)
downloadgentoo-488879eeea7979b54150b096a326a33c62e5efe2.tar.gz
gentoo-488879eeea7979b54150b096a326a33c62e5efe2.tar.bz2
gentoo-488879eeea7979b54150b096a326a33c62e5efe2.zip
dev-util/hip: add back patch to strip -rpath in hipcc
This fixes hipcc adding -rpath in compilation, which causes QA issue for building ROCm libraries, and linking the incorrect BLAS/LAPACK implementation to rocblas-test, which may cause testing performance degrade. Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/29443 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/hip/files/hip-5.3.3-correct-ldflag.patch')
-rw-r--r--dev-util/hip/files/hip-5.3.3-correct-ldflag.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch b/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch
new file mode 100644
index 000000000000..20d117841c2b
--- /dev/null
+++ b/dev-util/hip/files/hip-5.3.3-correct-ldflag.patch
@@ -0,0 +1,20 @@
+This removes ldflag -L"/usr/lib" and -Wl,-rpath=/usr/lib:/usr/lib which
+causes `ld: skipping incompatible /usr/lib/libm.so when searching for -lm`
+Reference: https://github.com/justxi/rocm/issues/8#issuecomment-1166193820
+===================================================================
+Index: HIP-rocm-5.3.3/bin/hipcc.pl
+===================================================================
+--- HIP-rocm-5.3.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.3.3/bin/hipcc.pl
+@@ -711,9 +711,9 @@ if ($HIP_PLATFORM eq "amd") {
+
+ if (not $isWindows and not $compileOnly) {
+ if ($linkType eq 0) {
+- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
++ $toolArgs = " -lamdhip64 -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+ } else {
+- $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
++ $toolArgs = ${toolArgs} . " -Wl,--enable-new-dtags -lamdhip64 ";
+ }
+ # To support __fp16 and _Float16, explicitly link with compiler-rt
+ $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";