Message ID | 20250306200251.GB15128@lug-owl.de |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77C9D385841E for <patchwork@sourceware.org>; Thu, 6 Mar 2025 20:03:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 77C9D385841E X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from lug-owl.de (lug-owl.de [IPv6:2a03:4000:10:469::]) by sourceware.org (Postfix) with ESMTPS id 54A4A3858D38 for <gdb-patches@sourceware.org>; Thu, 6 Mar 2025 20:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 54A4A3858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=lug-owl.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=lug-owl.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 54A4A3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a03:4000:10:469:: ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741291372; cv=none; b=PSb8TyqlL8gdL2X8NcNFKcTdu6ydijDsY1xbMZVfyTE9lZA8AqYzDy9Esj6Byz3/laLbvTCARJ+OkU10pxV87be9BdvIgxcMSPIUbc8NrgscT8AllhBfLBkO6rQ1CLmLrHDsQIVBP4NDP5pdItttcB+xAcd3ek5Y1w89CnA9zD4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741291372; c=relaxed/simple; bh=xqRGvvzXOQJzqNZwq0ar0DY/4RjPI+CM3+EIrxJs7+Y=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=og+BVRaAqm14BxKrAA1NGmF4a3VWVB1oY0BvTrsCESqMWDRlr+r+v3rgm0Ww7770Aa9udH/+G+MwoyJXHdhAlNeQPtl7B2AzuWP2LqD033/ETxFolRXiAIeiqYqX1wJaPJsqbgjCNFMnSjFG1xP1+TKCxaO9bvI/PeNP0Y5vWlg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 54A4A3858D38 Received: by lug-owl.de (Postfix, from userid 1001) id 50EB0421B1; Thu, 6 Mar 2025 21:02:51 +0100 (CET) Date: Thu, 6 Mar 2025 21:02:51 +0100 From: Jan-Benedict Glaw <jbglaw@lug-owl.de> To: gdb-patches@sourceware.org Subject: [PATCH RFC] sim: Fix signal variable for `sh` Message-ID: <20250306200251.GB15128@lug-owl.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LpQ9ahxlCli8rRTG" Content-Disposition: inline X-Operating-System: Linux chamaeleon 6.4.0-0.deb12.2-amd64 X-gpg-fingerprint: 250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB X-gpg-key: wwwkeys.de.pgp.net X-Echelon-Enable: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-TKUeV: howto poison arsenous mail psychological biological nuclear warfare test the bombastical terror of flooding the spy listeners explosion sex drugs and rock'n'roll X-message-flag: Please send plain text messages only. Do not send HTML emails. Thank you. User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series |
[RFC] sim: Fix signal variable for `sh`
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | warning | Skipped upon request |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | fail | Patch failed to apply |
Commit Message
Jan-Benedict Glaw
March 6, 2025, 8:02 p.m. UTC
Hi! I had a build running with a very recent GCC, which broke due to a mismatched sighandler_t: depbase=`echo sh/interp.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\ /var/lib/laminar/run/gdb-sh-elf/53/local-toolchain-install/bin/gcc -DHAVE_CONFIG_H -I. -I./../gnulib/import -I../gnulib/import -I./.. -I./../include -I../bfd -I.. -Ish -I./sh -DWITH_HW=1 -DHAVE_DV_SOCKSER -DDEFAULT_INLINE=0 -I./common -DSIM_TOPDIR_BUILD -Werror -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wimplicit-fallthrough=5 -Wduplicated-cond -Wshadow=local -Wmissing-declarations -Wdeclaration-after-statement -Wdeprecated-non-prototype -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Wint-conversion -Wmisleading-indentation -Wmissing-parameter-type -Wmissing-prototypes -Wold-style-declaration -Wold-style-definition -Wpointer-sign -Wreturn-mismatch -Wreturn-type -Wshift-negative-value -Wstrict-prototypes -Wno-enum-conversion -Wformat -Wformat-nonliteral -g -O2 -MT sh/interp.o -MD -MP -MF $depbase.Tpo -c -o sh/interp.o sh/interp.c &&\ mv -f $depbase.Tpo $depbase.Po sh/interp.c: In function 'sim_resume': sh/interp.c:1731:12: error: assignment to 'void (*)(void)' from incompatible pointer type '__sighandler_t' {aka 'void (*)(int)'} [-Wincompatible-pointer-types] 1731 | prev_fpe = signal (SIGFPE, SIG_IGN); | ^ In file included from ./../gnulib/import/signal.h:52, from sh/interp.c:27: /usr/include/signal.h:72:16: note: '__sighandler_t' declared here 72 | typedef void (*__sighandler_t) (int); | ^~~~~~~~~~~~~~ sh/interp.c:1867:19: error: passing argument 2 of 'signal' from incompatible pointer type [-Wincompatible-pointer-types] 1867 | signal (SIGFPE, prev_fpe); | ^~~~~~~~ | | | void (*)(void) /usr/include/signal.h:88:57: note: expected '__sighandler_t' {aka 'void (*)(int)'} but argument is of type 'void (*)(void)' 88 | extern __sighandler_t signal (int __sig, __sighandler_t __handler) | ~~~~~~~~~~~~~~~^~~~~~~~~ /usr/include/signal.h:72:16: note: '__sighandler_t' declared here 72 | typedef void (*__sighandler_t) (int); | ^~~~~~~~~~~~~~ make[2]: *** [Makefile:4250: sh/interp.o] Error 1 make[2]: Leaving directory '/var/lib/laminar/run/gdb-sh-elf/53/binutils-gdb/sim' make[1]: *** [Makefile:3235: all] Error 2 make[1]: Leaving directory '/var/lib/laminar/run/gdb-sh-elf/53/binutils-gdb/sim' make: *** [Makefile:10873: all-sim] Error 2 This would fix it: ...or change to sigaction()? And/or go for RETSIGTYPE? Thanks, Jan-Benedict --
Comments
>>>>> "Jan-Benedict" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:
Jan-Benedict> This would fix it:
[...]
This is ok. Thanks. If you have commit access you can check it in.
Approved-By: Tom Tromey <tom@tromey.com>
Jan-Benedict> ...or change to sigaction()? And/or go for RETSIGTYPE?
I'm a little surprised that nothing seems to be using sighandler_t.
Leaving it as signal (and not switching to sigaction) seems fine FWIW.
Tom
On Thu, 2025-03-06 14:13:23 -0700, Tom Tromey <tom@tromey.com> wrote: > >>>>> "Jan-Benedict" == Jan-Benedict Glaw <jbglaw@lug-owl.de> writes: > > Jan-Benedict> This would fix it: > [...] > > This is ok. Thanks. If you have commit access you can check it in. Thanks, committed & pushed. MfG, JBG --
diff --git a/sim/sh/interp.c b/sim/sh/interp.c index 379b44f82ba..c8c2a7429ce 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -1712,7 +1712,7 @@ sim_resume (SIM_DESC sd, int step, int siggnal) register int endianw = global_endianw; int tick_start = get_now (); - void (*prev_fpe) (); + void (*prev_fpe) (int); register unsigned short *jump_table = sh_jump_table;