From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i1q4NVx8cmjM2jIAWB0awg (envelope-from ) for ; Sat, 12 Jul 2025 11:16:44 -0400 Received: by simark.ca (Postfix, from userid 112) id C01831E11C; Sat, 12 Jul 2025 11:16:44 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.0 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 915111E089 for ; Sat, 12 Jul 2025 11:16:43 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 24E653858C78 for ; Sat, 12 Jul 2025 15:16:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 24E653858C78 Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 4B89E3858D26 for ; Sat, 12 Jul 2025 15:16:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B89E3858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4B89E3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752333368; cv=none; b=PRRxLWLb8cTHRtIzCuz8U94yioxGj1jn3g5+wpMQ3mFoWdYdSMUK4NwU/9MwjSFfj8SFLYzTNJxgILDQnpmm9gpI63LR5JpcHUUXxjFN2UOGbrEEDzahfxyLs2wwm1YHBTON3TQks0KCdyw0OzqigfFkGLc9ftAtQEMc7AYhO6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1752333368; c=relaxed/simple; bh=peH8yqHuZrEqQmJVH6mCjfZfpK9QNthLJ3TyG6Fizgw=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=J6lj+hHmcECr9xRkBz9QyQH85PCYNN8PbACZldA8AnKiGvUwX/s9Y5E4SDDEwgNXwws92y2/dPcdMW7gG4kHv5xg5SLuKWSJU7gstVORj3DotskmyrwLO1mFiykTyp/saxRTD6KITtnEUBuW2lsQns/6HC7OAeABJ4iJg22fyNs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B89E3858D26 Received: from mop.sam.mop (unknown [82.8.138.118]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sam) by smtp.gentoo.org (Postfix) with ESMTPSA id D42C2341F66; Sat, 12 Jul 2025 15:16:05 +0000 (UTC) From: Sam James To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/build] Work around GCC ipa-modref bug In-Reply-To: <20250712131649.8372-1-tdevries@suse.de> Organization: Gentoo References: <20250712131649.8372-1-tdevries@suse.de> User-Agent: mu4e 1.12.11; emacs 31.0.50 Date: Sat, 12 Jul 2025 16:16:03 +0100 Message-ID: <87ldotphho.fsf@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Tom de Vries writes: > PR mi/32571 reports the following problem: > ... > $ gdb -q -batch -ex "b bla.c:100" > > Make breakpoint pending on future shared library load? (y or [n]) \ > [answered N; input not from terminal] > ... > while this is expected: > ... > $ gdb -q -batch -ex "b bla.c:100" > No symbol table is loaded. Use the "file" command. > Make breakpoint pending on future shared library load? (y or [n]) \ > [answered N; input not from terminal] > ... > > A few factors in reproducing this are building gdb using gcc 14, > "-O2 -flto=auto" and --disable-nls. For more details, see the PR. > > This turns out to be caused by a GCC PR [1], more specifically a problem in > ipa-modref. > > Work around this by disabling ipa-modref for GCC versions 12-15 and 16.0, > assuming the GCC 16.1 release will contain a fix. > > Tested on aarch64-linux and x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32571 > > [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120987 > --- > gdbsupport/common-defs.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/gdbsupport/common-defs.h b/gdbsupport/common-defs.h > index 07caf3bd7e4..bdf04d9ec09 100644 > --- a/gdbsupport/common-defs.h > +++ b/gdbsupport/common-defs.h > @@ -27,6 +27,14 @@ > #pragma GCC optimize("-fno-hoist-adjacent-loads") > #endif > > +#if defined (__GNUC__) && !defined (__clang__) \ > + && ((__GNUC__ >= 12 && __GNUC__ <= 15) \ > + || (__GNUC__ == 16 && __GNUC_MINOR__ < 1)) > +/* Work around PR gcc/110799 starting gcc 12, and assume it will be fixed in > + the gcc 16.1 release. */ > +#pragma GCC optimize("-fno-ipa-modref") > +#endif > + > #include > > #undef PACKAGE_NAME > > base-commit: 6ab3f09a682adcb4e841faf7fc19dea2671debed LGTM. Thanks for reducing it and digging into this.