From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OJ8QNjE5yGLelQ4AWB0awg (envelope-from ) for ; Fri, 08 Jul 2022 10:03:29 -0400 Received: by simark.ca (Postfix, from userid 112) id DAAD61E22D; Fri, 8 Jul 2022 10:03:29 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=MK1WtikL; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from 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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6BF6E1E220 for ; Fri, 8 Jul 2022 10:03:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A4CA3850226 for ; Fri, 8 Jul 2022 14:03:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A4CA3850226 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657289009; bh=Y1I+1W3+wttl06Y/ywNGmoRiG1RgwsP+Xg0OcdpZnvk=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MK1WtikL00cSlGnItGHGdexegdJvjcHRMU4FutdFgoVSBDE2Ly+ndWVmOT2PLhWs4 ywLMnL/jnMH3sJkNgZMpo+wCuCkEjeaS+qv4IJp6UdBejB1m2yvCjaob57ot/1tFvp rqDqf3NDcYQ92Wlw0B1hSjL7gNud+xD+Ug8c0JMQ= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 4DF2538582BA for ; Fri, 8 Jul 2022 14:03:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DF2538582BA 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-out2.suse.de (Postfix) with ESMTPS id 7F5E21FE03; Fri, 8 Jul 2022 14:03:05 +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 6725C13A7D; Fri, 8 Jul 2022 14:03:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id DYwYGBk5yGL6TAAAMHmgww (envelope-from ); Fri, 08 Jul 2022 14:03:05 +0000 Message-ID: Date: Fri, 8 Jul 2022 16:03:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: [committed][gdb/build] Handle deprecation of scm_install_gmp_memory_functions Content-Language: en-US To: gdb-patches@sourceware.org References: <20220707075809.GA16313@delia> In-Reply-To: <20220707075809.GA16313@delia> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: =?UTF-8?Q?Ludovic_Court=c3=a8s?= Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 7/7/22 09:58, Tom de Vries wrote: > Hi, > > When building gdb with guile 3.0.8, we run into: > ... > gdb/guile/guile.c: In function \ > 'void gdbscm_initialize(const extension_language_defn*)': > gdb/guile/guile.c:680:5: error: 'scm_install_gmp_memory_functions' is \ > deprecated [-Werror=deprecated-declarations] > 680 | scm_install_gmp_memory_functions = 0; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > In file included from /usr/include/guile/3.0/libguile.h:128, > from gdb/guile/guile-internal.h:30, > from gdb/guile/guile.c:36: > /usr/include/guile/3.0/libguile/deprecated.h:164:20: note: declared here > 164 | SCM_DEPRECATED int scm_install_gmp_memory_functions; > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1plus: all warnings being treated as errors > make[1]: *** [Makefile:1896: guile/guile.o] Error 1 > ... > > The variable has been deprecated because it no longer has any effect. > > Fix this by disabling the specific deprecation warning. > > Also handle upcoming guile versions > 3.0, in which the variable will be > removed, by limiting the usage of the variable to guile versions <= 3.0. > > This does not break anything. The variable was merely used to address a > problem present in guile versions <= v3.0.5. > > Note that we don't limit the usage of the variable to guile versions <= 3.0.5, > because we want to support f.i. building against 3.0.6 and then using a shared > lib with 3.0.5. > > Tested on x86_64-linux. > > Co-Authored-By: Tom de Vries > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28994 > > Any comments? > Committed. Thanks, - Tom > [gdb/build] Handle deprecation of scm_install_gmp_memory_functions > > --- > gdb/guile/guile.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gdb/guile/guile.c b/gdb/guile/guile.c > index 14b191ded62..e5565b627d9 100644 > --- a/gdb/guile/guile.c > +++ b/gdb/guile/guile.c > @@ -677,7 +677,17 @@ gdbscm_initialize (const struct extension_language_defn *extlang) > "double free or corruption (out)" error. > Work around the libguile bug by disabling the installation of the > libgmp memory functions by guile initialization. */ > + > + /* The scm_install_gmp_memory_functions variable should be removed after > + version 3.0, so limit usage to 3.0 and before. */ > +#if SCM_MAJOR_VERSION < 3 || (SCM_MAJOR_VERSION == 3 && SCM_MINOR_VERSION == 0) > + /* This variable is deprecated in Guile 3.0.8 and later but remains > + available in the whole 3.0 series. */ > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > scm_install_gmp_memory_functions = 0; > +#pragma GCC diagnostic pop > +#endif > > /* scm_with_guile is the most portable way to initialize Guile. Plus > we need to initialize the Guile support while in Guile mode (e.g.,