From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id fmh2HogTSWE/HAAAWB0awg (envelope-from ) for ; Mon, 20 Sep 2021 19:04:40 -0400 Received: by simark.ca (Postfix, from userid 112) id 6C4AE1EE25; Mon, 20 Sep 2021 19:04:40 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=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 85EDE1EE14 for ; Mon, 20 Sep 2021 19:04:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0DDDC385841C for ; Mon, 20 Sep 2021 23:04:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DDDC385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1632179079; bh=2p3Db59ehCVklzViwWiEu/OHjbpo+n4hPfz6wkKLdx0=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PlntGGQM/WX5GrsKIGx2w5gF0cQyWjiph1clC84R4DLaeZjvC8alzk6CWdbnAe3sA YGu9cI1ipZtKghkTQv8cgcYR0WjzDUGUz1Otgy4LPVetOd0f4LoKsrhbj/GeI8tlJI tgATiQ0lqC7+pLZabrc0Ofj3Pt3sFVekxaLHVqSg= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 922E43858D3C for ; Mon, 20 Sep 2021 23:04:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 922E43858D3C 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 C32EA220BE; Mon, 20 Sep 2021 23:04:19 +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 A291613B38; Mon, 20 Sep 2021 23:04:19 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Qzn3JXMTSWH1YAAAMHmgww (envelope-from ); Mon, 20 Sep 2021 23:04:19 +0000 Subject: [PING][PATCH, master+11][gdb/build] Add CXX_DIALECT to CXX To: gdb-patches@sourceware.org References: <20210908121519.GA17723@delia> Message-ID: Date: Tue, 21 Sep 2021 01:04:19 +0200 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: <20210908121519.GA17723@delia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US 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 Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/8/21 2:15 PM, Tom de Vries wrote: > Hi, > > The problem reported in PR28318 is that when using a gcc version that (while > supporting c++11) does not support c++11 by default, the configure test for > std::thread support will fail. > > If gdb would use the default AX_CXX_COMPILE_STDCXX from autoconf, then we'd > have: > ... > CXX="g++ -std=gnu++11" > ... > and the test for std::thread support would succeed. > > Instead, gdb uses a custom AX_CXX_COMPILE_STDCXX (see commit 0bcda685399) > which does: > ... > CXX=g++ > CXX_DIALECT=-std=gnu++11 > ... > > We could add $CXX_DIALECT to the test for std::thread support, but that would > have to be repeated for each added c++ support test. > > Instead, fix this by doing: > ... > CXX="g++ -std=gnu++11" > CXX_DIALECT=-std=gnu++11 > ... > > The code added in gdb/ax_cxx_compile_stdcxx.m4 is copied from the default > AX_CXX_COMPILE_STDCXX from autoconf. > > Tested on x86_64-linux. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28318 > > Any comments? > Ping. Thanks, - Tom > [gdb/build] Add CXX_DIALECT to CXX > > --- > gdb/ax_cxx_compile_stdcxx.m4 | 8 ++++++++ > gdb/configure | 8 ++++++++ > gdbserver/configure | 8 ++++++++ > gdbsupport/configure | 8 ++++++++ > 4 files changed, 32 insertions(+) > > diff --git a/gdb/ax_cxx_compile_stdcxx.m4 b/gdb/ax_cxx_compile_stdcxx.m4 > index 413755a2e88..29d8e10bcc4 100644 > --- a/gdb/ax_cxx_compile_stdcxx.m4 > +++ b/gdb/ax_cxx_compile_stdcxx.m4 > @@ -94,6 +94,10 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl > CXX="$ac_save_CXX"]) > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > @@ -118,6 +122,10 @@ AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl > CXX="$ac_save_CXX"]) > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > diff --git a/gdb/configure b/gdb/configure > index f0b1af4a6ea..98badb46cfd 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -5841,6 +5841,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > @@ -6160,6 +6164,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > diff --git a/gdbserver/configure b/gdbserver/configure > index b227167e270..f05c1a9b976 100755 > --- a/gdbserver/configure > +++ b/gdbserver/configure > @@ -5625,6 +5625,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > @@ -5944,6 +5948,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > diff --git a/gdbsupport/configure b/gdbsupport/configure > index a9dd02c5b72..ae6047865ae 100755 > --- a/gdbsupport/configure > +++ b/gdbsupport/configure > @@ -6520,6 +6520,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi > @@ -6839,6 +6843,10 @@ eval ac_res=\$$cachevar > $as_echo "$ac_res" >&6; } > if eval test x\$$cachevar = xyes; then > CXX_DIALECT="$switch" > + CXX="$CXX $switch" > + if test -n "$CXXCPP" ; then > + CXXCPP="$CXXCPP $switch" > + fi > ac_success=yes > break > fi >