summaryrefslogtreecommitdiff
path: root/dev-util/hipcc/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-11-19 05:02:03 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-11-19 05:02:03 +0000
commitf9a583991092848eb54269744b512063a4d59de0 (patch)
treed5a2138990dac6dca951c93dbd3640fa530e6268 /dev-util/hipcc/files
parent62fedf7d848a64953dc84844e401364176b10da7 (diff)
gentoo auto-resync : 19:11:2023 - 05:02:03
Diffstat (limited to 'dev-util/hipcc/files')
-rw-r--r--dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch13
-rw-r--r--dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch42
2 files changed, 55 insertions, 0 deletions
diff --git a/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch b/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch
new file mode 100644
index 000000000000..c46420265005
--- /dev/null
+++ b/dev-util/hipcc/files/hipcc-5.7.1-fno-stack-protector.patch
@@ -0,0 +1,13 @@
+Related bug: https://bugs.gentoo.org/890377
+--- a/bin/hipcc.pl
++++ b/bin/hipcc.pl
+@@ -552,6 +552,9 @@ if ($buildDeps and $HIP_PLATFORM eq 'amd') {
+ # pass-through CPP mode.
+
+ if ($HIP_PLATFORM eq "amd") {
++ # Append -fno-stack-protector due to stack protection for HIP is not supported
++ $HIPCXXFLAGS .= " -fno-stack-protector";
++ $HIPCFLAGS .= " -fno-stack-protector";
+ # Set default optimization level to -O3 for hip-clang.
+ if ($optArg eq "") {
+ $HIPCXXFLAGS .= " -O3";
diff --git a/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch b/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch
new file mode 100644
index 000000000000..fa00d44d912e
--- /dev/null
+++ b/dev-util/hipcc/files/hipcc-5.7.1-hipcc-hip-version.patch
@@ -0,0 +1,42 @@
+Edit from:
+https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/759b0773bd848ff9471fa8cdecd9ee21010bc29c/debian/patches/0013-hipcc-hip-version.patch
+`--hip-version` is required for correclty including __clang_hip_runtime_wrapper.h
+=================================================================================
+Description: enforce --hip-version option within hipcc call.
+ This change is needed since the normal mechanism in ROCm relies on
+ reading a .hipVersion hidden configuration file which has no proper
+ equivalent in a FHS compliant tree, as of ROCm 5.0.
+Author: Cordell Bloor <cgmb-deb@slerp.xyz>
+Bug: https://github.com/ROCm-Developer-Tools/HIP/pull/2937
+Forwarded: not-needed
+Reviewed-by: Étienne Mollier <emollier@debian.org>
+Last-Update: 2022-07-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: HIP/bin/hipcc.pl
+===================================================================
+--- HIP.orig/bin/hipcc.pl
++++ HIP/bin/hipcc.pl
+@@ -121,6 +121,9 @@ $HIP_PATH = $hipvars::HIP_PATH;
+ $ROCM_PATH = $hipvars::ROCM_PATH;
+ $HIP_VERSION = $hipvars::HIP_VERSION;
+ $HIP_ROCCLR_HOME = $hipvars::HIP_ROCCLR_HOME;
++$HIP_VERSION_MAJOR = $hipvars::HIP_VERSION_MAJOR;
++$HIP_VERSION_MINOR = $hipvars::HIP_VERSION_MINOR;
++$HIP_VERSION_PATCH = $hipvars::HIP_VERSION_PATCH;
+
+ if ($HIP_PLATFORM eq "amd") {
+ $HIP_INCLUDE_PATH = "$HIP_ROCCLR_HOME/include";
+@@ -188,6 +191,12 @@ if ($HIP_PLATFORM eq "amd") {
+ ## Allow __fp16 as function parameter and return type.
+ $HIPCXXFLAGS .= " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1";
+ }
++
++ # Gentoo: there is no FHS compliant location for .hipVersion where clang will still be
++ # able to find it, so .hipVersion has been omitted and the hip version is passed explicitly
++ $HIPCXXFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
++ $HIPCFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
++ $HIPLDFLAGS .= " --hip-version=$HIP_VERSION_MAJOR.$HIP_VERSION_MINOR.$HIP_VERSION_PATCH";
+ } elsif ($HIP_PLATFORM eq "nvidia") {
+ $CUDA_PATH=$ENV{'CUDA_PATH'} // '/usr/local/cuda';
+ $HIP_INCLUDE_PATH = "$HIP_PATH/include";