commit:     35045208b613bd86d21415331da51d235ee5e6e7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 10 05:07:05 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 10 05:07:05 2024 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=35045208

15.0.0: add nvptx bashism patch

Bug: https://gcc.gnu.org/PR117854
Bug: https://bugs.gentoo.org/945296
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...tx-fix-bashisms-with-gen-copyright.sh-use.patch | 68 ++++++++++++++++++++++
 15.0.0/gentoo/README.history                       |  1 +
 2 files changed, 69 insertions(+)

diff --git 
a/15.0.0/gentoo/76_all_PR117854-config-nvptx-fix-bashisms-with-gen-copyright.sh-use.patch
 
b/15.0.0/gentoo/76_all_PR117854-config-nvptx-fix-bashisms-with-gen-copyright.sh-use.patch
new file mode 100644
index 0000000..6011313
--- /dev/null
+++ 
b/15.0.0/gentoo/76_all_PR117854-config-nvptx-fix-bashisms-with-gen-copyright.sh-use.patch
@@ -0,0 +1,68 @@
+From f6959883aecd1500698ea969de631ffa010ce833 Mon Sep 17 00:00:00 2001
+Message-ID: 
<f6959883aecd1500698ea969de631ffa010ce833.1733807152.git....@gentoo.org>
+From: Sam James <[email protected]>
+Date: Fri, 6 Dec 2024 09:11:11 +0000
+Subject: [PATCH] config: nvptx: fix bashisms with gen-copyright.sh use
+
+Providing parameters to `.` when sourcing is a bashism and not supported
+by POSIX shell which causes a build failure when compiling a toolchain
+for nvptx-none with dash as /bin/sh.
+
+gen-copyright.sh takes a parameter for the format of copyright notice
+required. Switch that to using an environment variable `NVPTX_GEN_COPYRIGHT`,
+although this could be changed to a function if desired (just more churn
+in gen-copyright.sh then).
+
+gcc/ChangeLog:
+       PR target/117854
+
+       * config/nvptx/gen-copyright.sh: Read NVPTX_GEN_COPYRIGHT envvar.
+       * config/nvptx/gen-h.sh: Set NVPTX_GEN_COPYRIGHT.
+       * config/nvptx/gen-opt.sh: Ditto.
+---
+ gcc/config/nvptx/gen-copyright.sh | 2 +-
+ gcc/config/nvptx/gen-h.sh         | 2 +-
+ gcc/config/nvptx/gen-opt.sh       | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gcc/config/nvptx/gen-copyright.sh 
b/gcc/config/nvptx/gen-copyright.sh
+index d0a86acb832c..b140de0eb76d 100644
+--- a/gcc/config/nvptx/gen-copyright.sh
++++ b/gcc/config/nvptx/gen-copyright.sh
+@@ -18,7 +18,7 @@
+ # along with GCC; see the file COPYING3.  If not see
+ # <http://www.gnu.org/licenses/>.
+ 
+-style="$1"
++style="${1:-${NVPTX_GEN_COPYRIGHT}}"
+ case $style in
+     opt)
+     ;;
+diff --git a/gcc/config/nvptx/gen-h.sh b/gcc/config/nvptx/gen-h.sh
+index bc4ce9af1e2a..a5c18d864504 100644
+--- a/gcc/config/nvptx/gen-h.sh
++++ b/gcc/config/nvptx/gen-h.sh
+@@ -36,7 +36,7 @@ EOF
+ # Separator.
+ echo
+ 
+-. $gen_copyright_sh c
++NVPTX_GEN_COPYRIGHT=c . $gen_copyright_sh
+ 
+ # Separator.
+ echo
+diff --git a/gcc/config/nvptx/gen-opt.sh b/gcc/config/nvptx/gen-opt.sh
+index 103bcddc02b5..40c949425f27 100644
+--- a/gcc/config/nvptx/gen-opt.sh
++++ b/gcc/config/nvptx/gen-opt.sh
+@@ -40,7 +40,7 @@ EOF
+ # Separator.
+ echo
+ 
+-. $gen_copyright_sh opt
++NVPTX_GEN_COPYRIGHT=opt . $gen_copyright_sh
+ 
+ # Not emitting the following here (in addition to having it in 'nvptx.opt'), 
as
+ # we'll otherwise run into:
+-- 
+2.47.1

diff --git a/15.0.0/gentoo/README.history b/15.0.0/gentoo/README.history
index 048d96a..adc1fef 100644
--- a/15.0.0/gentoo/README.history
+++ b/15.0.0/gentoo/README.history
@@ -2,6 +2,7 @@
 
        + 
74_all_PR117724-Fix-type-compatibility-for-types-with-flexible-array.patch
        + 75_all_PR117724-testsuite-fix-LTO-flags-in-pr112716.c.patch
+       + 
76_all_PR117854-config-nvptx-fix-bashisms-with-gen-copyright.sh-use.patch
 
 30     8 December 2024
 

Reply via email to