Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (72ae3a7762a9cfd5333687a674ddc8b8ef58d880)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (72ae3a7762a9cfd5333687a674ddc8b8ef58d880)
  • Date: Fri, 23 Sep 2022 14:01:48 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

gnu/gcc/HISTORY
| 6 +

gnu/gcc/patches/0001-libgo-include-asm-ptrace.h-for-pt_regs-definition-on-PowerPC.patch
| 53 ++++++++++
gnu/gcc/patches/0001-libgo-make-match.sh-POSIX-shell-compatible.patch
| 28 +++++
3 files changed, 87 insertions(+)

New commits:
commit 72ae3a7762a9cfd5333687a674ddc8b8ef58d880
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

gcc: Fix powerpc libgo build

commit 82a6b87ad15075659fed10f8c4fc662d78a6cbad
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

gcc: Fix bashism in libgo/match.sh

diff --git a/gnu/gcc/HISTORY b/gnu/gcc/HISTORY
index 32bfb1a..fb25f51 100644
--- a/gnu/gcc/HISTORY
+++ b/gnu/gcc/HISTORY
@@ -1,3 +1,9 @@
+2022-09-23 Ismael Luceno <ismael AT sourcemage.org>
+ * patches/0001-libgo-make-match.sh-POSIX-shell-compatible.patch:
+ fixed bashism in libgo/match.sh
+ *
patches/0001-libgo-include-asm-ptrace.h-for-pt_regs-definition-on-PowerPC.patch:
+ fixed powerpc libgo build
+
2022-08-19 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 12.2.0
* 0042-Fix-attempt-to-use-poisoned-calloc-error-in-libgccji.patch:
deleted
diff --git
a/gnu/gcc/patches/0001-libgo-include-asm-ptrace.h-for-pt_regs-definition-on-PowerPC.patch

b/gnu/gcc/patches/0001-libgo-include-asm-ptrace.h-for-pt_regs-definition-on-PowerPC.patch
new file mode 100644
index 0000000..61875e2
--- /dev/null
+++
b/gnu/gcc/patches/0001-libgo-include-asm-ptrace.h-for-pt_regs-definition-on-PowerPC.patch
@@ -0,0 +1,53 @@
+From cf41d579088e1c0b5c33c93657ad041e797b5905 Mon Sep 17 00:00:00 2001
+From: Sören Tempel <soeren AT soeren-tempel.net>
+Date: Sun, 2 Jan 2022 01:07:03 +0100
+Subject: [PATCH] libgo: include asm/ptrace.h for pt_regs definition on
PowerPC
+
+Both glibc and musl libc declare pt_regs as an incomplete type. This
+type has to be completed by inclusion of another header. On Linux, the
+asm/ptrace.h header file provides this type definition. Without
+including this header file, it is not possible to access the regs member
+of the mcontext_t struct as done in libgo/runtime/go-signal.c. On glibc,
+other headers (e.g. sys/user.h) include asm/ptrace.h but on musl
+asm/ptrace.h is not included by other headers and thus the
+aforementioned files do not compile without an explicit include of
+asm/ptrace.h:
+
+ libgo/runtime/go-signal.c: In function 'getSiginfo':
+ libgo/runtime/go-signal.c:227:63: error: invalid use of undefined
type 'struct pt_regs'
+ 227 | ret.sigpc =
((ucontext_t*)(context))->uc_mcontext.regs->nip;
+ |
+
+Instead of including the asm/ptrace.h header conditionally on PowerPC
+only it would alternatively also be possible to include it
+unconditionally.
+
+See also:
+
+*
https://git.musl-libc.org/cgit/musl/commit/?id=c2518a8efb6507f1b41c3b12e03b06f8f2317a1f
+*
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d57cb31910ca5c200e4172276749a7f8bd17ae3c
+* https://github.com/kaniini/libucontext/issues/36
+
+Signed-off-by: Sören Tempel <soeren AT soeren-tempel.net>
+Origin: Alpine Linux
+---
+ libgo/runtime/go-signal.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libgo/runtime/go-signal.c b/libgo/runtime/go-signal.c
+index 528d9b6d9fe..c67503f0a79 100644
+--- a/libgo/runtime/go-signal.c
++++ b/libgo/runtime/go-signal.c
+@@ -10,6 +10,12 @@
+ #include <sys/time.h>
+ #include <ucontext.h>
+
++// On PowerPC, ucontext.h uses a pt_regs struct as an incomplete
++// type. This type must be completed by including asm/ptrace.h.
++#ifdef __PPC__
++#include <asm/ptrace.h>
++#endif
++
+ #include "runtime.h"
+
+ #ifndef SA_RESTART
diff --git
a/gnu/gcc/patches/0001-libgo-make-match.sh-POSIX-shell-compatible.patch
b/gnu/gcc/patches/0001-libgo-make-match.sh-POSIX-shell-compatible.patch
new file mode 100644
index 0000000..84bca89
--- /dev/null
+++ b/gnu/gcc/patches/0001-libgo-make-match.sh-POSIX-shell-compatible.patch
@@ -0,0 +1,28 @@
+From 75a430f66760802bf1ac5afcd716613e3cf8c77d Mon Sep 17 00:00:00 2001
+From: Sören Tempel <soeren+git AT soeren-tempel.net>
+Date: Tue, 19 Jul 2022 07:15:25 +0200
+Subject: [PATCH] libgo: make match.sh POSIX-shell compatible
+
+The `(( expression ))` syntax is a Bash extension. However, the
+arithmetic expressions used by the gobuild() function can also
+be expressed using Arithmetic POSIX Expansion with `$(( expression ))`.
+Contrary to the Bash expression, the Arithmetic Expansion doesn't set
+the return value if the expression is non-zero but instead just prints
+the expression result. Hence, the expression also needs to be negated.
+---
+ libgo/match.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libgo/match.sh b/libgo/match.sh
+index 7ed587ff794..b355d47429a 100755
+--- a/libgo/match.sh
++++ b/libgo/match.sh
+@@ -111,7 +111,7 @@ gobuild() {
+ if test "$goarch" != "386"; then
+ line=$(echo "$line" | sed -e
"s/\\(${wrap}\\)386\\(${wrap}\\)/\10\2/g")
+ fi
+- (($line))
++ return $((!line))
+ }
+
+ matched=



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (72ae3a7762a9cfd5333687a674ddc8b8ef58d880), Ismael Luceno, 09/23/2022

Archive powered by MHonArc 2.6.24.

Top of Page