summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyang Wu <xgreenlandforwyy@gmail.com>2023-01-20 18:12:16 +0800
committerSam James <sam@gentoo.org>2023-01-21 03:32:16 +0000
commitbb6386121107a5a6f108a429e6042a237e07e371 (patch)
tree3670fa68f4dafacd3b8ac10696107daf174aa52d /dev-util/hip
parentnet-misc/rsync: handle ubsan (diff)
downloadgentoo-bb6386121107a5a6f108a429e6042a237e07e371.tar.gz
gentoo-bb6386121107a5a6f108a429e6042a237e07e371.tar.bz2
gentoo-bb6386121107a5a6f108a429e6042a237e07e371.zip
dev-util/hip: append -fno-stack-protector for hipcc
Closes: https://bugs.gentoo.org/890377 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/29188 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/hip')
-rw-r--r--dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch16
-rw-r--r--dev-util/hip/hip-5.1.3-r3.ebuild (renamed from dev-util/hip/hip-5.1.3-r2.ebuild)1
-rw-r--r--dev-util/hip/hip-5.3.3-r1.ebuild (renamed from dev-util/hip/hip-5.3.3.ebuild)1
3 files changed, 18 insertions, 0 deletions
diff --git a/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch b/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch
new file mode 100644
index 000000000000..c5957edba734
--- /dev/null
+++ b/dev-util/hip/files/hip-5.1.3-fno-stack-protector.patch
@@ -0,0 +1,16 @@
+Since 1e9b3a08b9243daae1bebd6bac3da939d924df1f /etc/clang/gentoo-hardened.cfg
+has -fstack-protector-strong which may cause build issues for HIP programs (bug
+#890377) Disable this by adding -fno-stack-protector into c/cxx flags in hipcc.
+===================================================================
+--- HIP-rocm-5.3.3.orig/bin/hipcc.pl
++++ HIP-rocm-5.3.3/bin/hipcc.pl
+@@ -687,6 +687,9 @@ if ($rdc and !$compileOnly and $HIP_PLAT
+ # 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/hip/hip-5.1.3-r2.ebuild b/dev-util/hip/hip-5.1.3-r3.ebuild
index 34d925ed2342..56090c5077df 100644
--- a/dev-util/hip/hip-5.1.3-r2.ebuild
+++ b/dev-util/hip/hip-5.1.3-r3.ebuild
@@ -100,6 +100,7 @@ src_prepare() {
eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
eapply "${FILESDIR}/${PN}-5.0.2-correct-ldflag.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \
diff --git a/dev-util/hip/hip-5.3.3.ebuild b/dev-util/hip/hip-5.3.3-r1.ebuild
index 7ec79ed705eb..07b7709afbc2 100644
--- a/dev-util/hip/hip-5.3.3.ebuild
+++ b/dev-util/hip/hip-5.3.3-r1.ebuild
@@ -92,6 +92,7 @@ src_prepare() {
pushd ${HIP_S} || die
eapply "${FILESDIR}/${PN}-5.1.3-clang-include-path.patch"
eapply "${FILESDIR}/${PN}-5.1.3-rocm-path.patch"
+ eapply "${FILESDIR}/${PN}-5.1.3-fno-stack-protector.patch"
# Setting HSA_PATH to "/usr" results in setting "-isystem /usr/include"
# which makes "stdlib.h" not found when using "#include_next" in header files;
sed -e "/FLAGS .= \" -isystem \$HSA_PATH/d" \