From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/files/, sys-devel/gdb/
Date: Mon, 25 Oct 2021 12:03:41 +0000 (UTC) [thread overview]
Message-ID: <1635163392.5c048cebb13af66c8e1d6306a5f5491552e3a44f.sam@gentoo> (raw)
commit: 5c048cebb13af66c8e1d6306a5f5491552e3a44f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 25 12:02:58 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Oct 25 12:03:12 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c048ceb
sys-devel/gdb: backport glibc-2.34 build failure patch
... although I don't actually recall hitting this.
Closes: https://bugs.gentoo.org/813831
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch | 110 ++++++++++++++++++++++
sys-devel/gdb/gdb-11.1.ebuild | 1 +
2 files changed, 111 insertions(+)
diff --git a/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch b/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch
new file mode 100644
index 00000000000..15ab45f278f
--- /dev/null
+++ b/sys-devel/gdb/files/gdb-11.1-glibc-2.34-sim.patch
@@ -0,0 +1,110 @@
+https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=39d53d04357606a15efd400147fa7369d71baf2c;hp=46039d3632e32d9a404c1f18cf55f14c894e4627
+https://bugs.gentoo.org/813831
+
+From 39d53d04357606a15efd400147fa7369d71baf2c Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 3 Oct 2021 12:02:53 -0400
+Subject: [PATCH 1/1] sim: filter out SIGSTKSZ [PR sim/28302]
+
+We map target signals to host signals so we can propagate signals
+between the host & simulated worlds. That means we need to know
+the symbolic names & values of all signals that might be sent.
+
+The tools that generate that list use signal.h and include all
+symbols that start with "SIG" so as to automatically include any
+new symbols that the C library might add. Unfortunately, this
+also picks up "SIGSTKSZ" which is not actually a signal itself,
+but a signal related setting -- it's the size of the stack when
+a signal is handled.
+
+By itself this doesn't super matter as we will never see a signal
+with that same value (since the range of valid signals tend to be
+way less than 1024, and the size of the default signal stack will
+never be that small). But with recent glibc changes that make this
+into a dynamic value instead of a compile-time constant, some users
+see build failures when building the sim.
+
+As suggested by Adam Sampson, update our scripts to ignore this
+symbol to simplify everything and avoid the build failure.
+
+Bug: https://sourceware.org/PR28302
+---
+ sim/bfin/linux-targ-map.h | 5 +----
+ sim/common/gennltvals.py | 6 ++++--
+ sim/common/nltvals.def | 1 -
+ 3 files changed, 5 insertions(+), 7 deletions(-)
+
+diff --git a/sim/bfin/linux-targ-map.h b/sim/bfin/linux-targ-map.h
+index e9c8c8f273b..0340ed54764 100644
+--- a/sim/bfin/linux-targ-map.h
++++ b/sim/bfin/linux-targ-map.h
+@@ -30,6 +30,7 @@ echo
+ # XXX: nothing uses this ?
+ echo '#include <signal.h>' | \
+ bfin-uclinux-gcc -E -dD -P - | \
++grep -v SIGSTKSZ | \
+ sed -r -n \
+ -e '1istatic CB_TARGET_DEFS_MAP cb_linux_signal_map[] = {' \
+ -e '$i\ \ { 0, -1, -1 }\n};' \
+@@ -1987,10 +1988,6 @@ static CB_TARGET_DEFS_MAP cb_linux_signal_map[] =
+ #ifdef SIG_SETMASK
+ # define TARGET_LINUX_SIG_SETMASK 2
+ { "SIG_SETMASK", SIG_SETMASK, TARGET_LINUX_SIG_SETMASK },
+-#endif
+-#ifdef SIGSTKSZ
+-# define TARGET_LINUX_SIGSTKSZ 8192
+- { "SIGSTKSZ", SIGSTKSZ, TARGET_LINUX_SIGSTKSZ },
+ #endif
+ { 0, -1, -1 }
+ };
+diff --git a/sim/common/gennltvals.py b/sim/common/gennltvals.py
+index db3ff641d40..955ace34311 100755
+--- a/sim/common/gennltvals.py
++++ b/sim/common/gennltvals.py
+@@ -67,6 +67,7 @@ FILE_HEADER = f"""\
+ def gentvals(output: TextIO, cpp: str, srctype: str, srcdir: Path,
+ headers: Iterable[str],
+ pattern: str,
++ filter: str = r'^$',
+ target: str = None):
+ """Extract constants from the specified files using a regular expression.
+
+@@ -94,12 +95,13 @@ def gentvals(output: TextIO, cpp: str, srctype: str, srcdir: Path,
+ srcfile = ''.join(f'#include <{x}>\n' for x in headers)
+ syms = set()
+ define_pattern = re.compile(r'^#\s*define\s+(' + pattern + ')')
++ filter_pattern = re.compile(filter)
+ for header in headers:
+ with open(srcdir / header, 'r', encoding='utf-8') as fp:
+ data = fp.read()
+ for line in data.splitlines():
+ m = define_pattern.match(line)
+- if m:
++ if m and not filter_pattern.search(line):
+ syms.add(m.group(1))
+ for sym in sorted(syms):
+ srcfile += f'#ifdef {sym}\nDEFVAL {{ "{sym}", {sym} }},\n#endif\n'
+@@ -129,7 +131,7 @@ def gen_common(output: TextIO, newlib: Path, cpp: str):
+ ('errno.h', 'sys/errno.h'), 'E[A-Z0-9]*')
+
+ gentvals(output, cpp, 'signal', newlib / 'newlib/libc/include',
+- ('signal.h', 'sys/signal.h'), r'SIG[A-Z0-9]*')
++ ('signal.h', 'sys/signal.h'), r'SIG[A-Z0-9]*', filter=r'SIGSTKSZ')
+
+ gentvals(output, cpp, 'open', newlib / 'newlib/libc/include',
+ ('fcntl.h', 'sys/fcntl.h', 'sys/_default_fcntl.h'), r'O_[A-Z0-9]*')
+diff --git a/sim/common/nltvals.def b/sim/common/nltvals.def
+index 8ae88397249..8bc6ae59026 100644
+--- a/sim/common/nltvals.def
++++ b/sim/common/nltvals.def
+@@ -116,7 +116,6 @@
+ { "SIGPROF", 27 },
+ { "SIGQUIT", 3 },
+ { "SIGSEGV", 11 },
+- { "SIGSTKSZ", 8192 },
+ { "SIGSTOP", 17 },
+ { "SIGSYS", 12 },
+ { "SIGTERM", 15 },
+--
+2.27.0
+
diff --git a/sys-devel/gdb/gdb-11.1.ebuild b/sys-devel/gdb/gdb-11.1.ebuild
index 8b1a81f909e..bcd3ce89b95 100644
--- a/sys-devel/gdb/gdb-11.1.ebuild
+++ b/sys-devel/gdb/gdb-11.1.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}"/${PN}-8.3.1-verbose-build.patch
+ "${FILESDIR}"/${P}-glibc-2.34-sim.patch
)
pkg_setup() {
next reply other threads:[~2021-10-25 12:03 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 12:03 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-03-19 21:52 [gentoo-commits] repo/gentoo:master commit in: sys-devel/gdb/files/, sys-devel/gdb/ Sam James
2022-12-03 6:06 Sam James
2022-08-10 7:43 Sam James
2022-05-03 0:01 Sam James
2022-04-17 18:20 Sam James
2021-07-30 15:25 Sergei Trofimovich
2021-04-25 20:57 Sergei Trofimovich
2021-01-09 11:55 Sergei Trofimovich
2020-08-21 7:21 Sergei Trofimovich
2020-03-29 10:11 Sergei Trofimovich
2020-01-21 8:24 Sergei Trofimovich
2019-09-30 21:52 Sergei Trofimovich
2019-08-09 20:50 Andreas K. Hüttel
2019-03-14 22:49 Sergei Trofimovich
2019-01-28 22:01 Sergei Trofimovich
2018-10-21 16:27 Sergei Trofimovich
2018-06-30 11:06 Sergei Trofimovich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1635163392.5c048cebb13af66c8e1d6306a5f5491552e3a44f.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox