From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id jokRKNl9m2GucwAAWB0awg (envelope-from ) for ; Mon, 22 Nov 2021 06:24:09 -0500 Received: by simark.ca (Postfix, from userid 112) id 941F51F0CE; Mon, 22 Nov 2021 06:24:09 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 716CC1E940 for ; Mon, 22 Nov 2021 06:24:08 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 93E5C3858027 for ; Mon, 22 Nov 2021 11:24:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 93E5C3858027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1637580247; bh=AW/THcrfYSxTlChSDv9EBRusgteIOZug1anJx8bq6cQ=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=IbFRiG+z4oaMcg256+FPJhEXKTCuF2hzAZNYy7fZpfXLbNh1VX9QyECo+8DFRPPM2 GPQtE4kgn8y4oJaDUdxPNzAMt2uHEspz+vO34U3/7UpQ2bmvtmA2hYiWIV844UWqAg qvt0Ti+66G8iV7iJusoxih1imcXwlczNcNMqf7Ec= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 358C63858D35 for ; Mon, 22 Nov 2021 11:23:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 358C63858D35 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6B894218EF; Mon, 22 Nov 2021 11:23:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 55FFD13C56; Mon, 22 Nov 2021 11:23:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id dsjcE8N9m2GcFgAAMHmgww (envelope-from ); Mon, 22 Nov 2021 11:23:47 +0000 Subject: [pushed][gdb/build] Fix x86_64 x32 build To: Jan Palus References: <20211121194556.nreowfixabal5ebj@pine> <20211122083842.zhqyr2r73lkvahdh@pine> Message-ID: <67c5fad3-52af-b96b-136c-41070352403b@suse.de> Date: Mon, 22 Nov 2021 12:23:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20211122083842.zhqyr2r73lkvahdh@pine> Content-Type: multipart/mixed; boundary="------------2FBA1F0D722673ED6E8B80DB" Content-Language: en-US X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Cc: "gdb-patches@sourceware.org" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This is a multi-part message in MIME format. --------------2FBA1F0D722673ED6E8B80DB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 11/22/21 9:38 AM, Jan Palus wrote: > On 22.11.2021 07:46, Tom de Vries wrote: >> On 11/21/21 8:45 PM, Jan Palus wrote: >>> gdb 11.1 fails during compilation on x32 ABI: >>> >>> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:280:42: error: 'struct compat_x32_siginfo_t::::' has no member named 'si_addr_bnd' >>> 280 | #define cpt_si_lower _sifields._sigfault.si_addr_bnd._lower >>> | ^~~~~~~~~~~ >>> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:337:38: note: in expansion of macro 'cpt_si_lower' >>> 337 | to->cpt_si_lower = from_ptrace.cpt_si_lower; >>> | ^~~~~~~~~~~~ >>> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:281:42: error: 'struct compat_x32_siginfo_t::::' has no member named 'si_addr_bnd' >>> 281 | #define cpt_si_upper _sifields._sigfault.si_addr_bnd._upper >>> | ^~~~~~~~~~~ >>> ../.././gdbserver/../gdb/nat/amd64-linux-siginfo.c:338:38: note: in expansion of macro 'cpt_si_upper' >>> 338 | to->cpt_si_upper = from_ptrace.cpt_si_upper; >>> | ^~~~~~~~~~~~ >>> >>> I believe it is caused by https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=d3d7d1b >> >> Hi, >> >> I've attached a conservative fix, can you check whether that fixes the >> build breaker? > > Thanks. That's essentially the same fix as the temporary workaround I > came up with: > > http://git.pld-linux.org/?p=packages/gdb.git;a=commitdiff;h=9f79cb7 > > and can confirm that it fixes the failure and build is successful on x32. Committed as attached below. Thanks, - Tom --------------2FBA1F0D722673ED6E8B80DB Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-build-Fix-x86_64-x32-build.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-gdb-build-Fix-x86_64-x32-build.patch" [gdb/build] Fix x86_64 x32 build A build error on x86_64 with x32 abi was reported here ( https://sourceware.org/pipermail/gdb/2021-November/049787.html ): ... gdb/nat/amd64-linux-siginfo.c:280:42: error: \ 'struct compat_x32_siginfo_t::::' has no member \ named 'si_addr_bnd' 280 | #define cpt_si_lower _sifields._sigfault.si_addr_bnd._lower | ^~~~~~~~~~~ gdb/nat/amd64-linux-siginfo.c:337:38: note: in expansion of macro 'cpt_si_lower' 337 | to->cpt_si_lower = from_ptrace.cpt_si_lower; | ^~~~~~~~~~~~ ... The problem is that code added in commit d3d7d1ba3bb "[gdb/tdep] Handle si_addr_bnd in compat_siginfo_from_siginfo" doesn't compile on an x86_64 x32 setup, because compat_x32_siginfo_t doesn't have the si_addr_bnd fields. Fix this conservatively by disabling the code for x32. Tested on x86_64-linux. --- gdb/nat/amd64-linux-siginfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c index 342840e5085..fc52b5b6056 100644 --- a/gdb/nat/amd64-linux-siginfo.c +++ b/gdb/nat/amd64-linux-siginfo.c @@ -330,6 +330,9 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from) to->cpt_si_pid = from_ptrace.cpt_si_pid; to->cpt_si_uid = from_ptrace.cpt_si_uid; } +#ifndef __ILP32__ + /* The struct compat_x32_siginfo_t doesn't contain + cpt_si_lower/cpt_si_upper. */ else if (to->si_code == SEGV_BNDERR && to->si_signo == SIGSEGV) { @@ -337,6 +340,7 @@ compat_siginfo_from_siginfo (compat_siginfo_t *to, const siginfo_t *from) to->cpt_si_lower = from_ptrace.cpt_si_lower; to->cpt_si_upper = from_ptrace.cpt_si_upper; } +#endif else if (to->si_code < 0) { to->cpt_si_pid = from_ptrace.cpt_si_pid; --------------2FBA1F0D722673ED6E8B80DB--