From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gKd5HXepOGEpWQAAWB0awg (envelope-from ) for ; Wed, 08 Sep 2021 08:15:51 -0400 Received: by simark.ca (Postfix, from userid 112) id 75E271EE22; Wed, 8 Sep 2021 08:15:51 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 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 5C45C1EE20 for ; Wed, 8 Sep 2021 08:15:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A48438618AF for ; Wed, 8 Sep 2021 12:15:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A48438618AF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631103346; bh=awmGqx8I1iOu+QX/7ZiI8YIPQAAdgcm3NItwOXUN5sA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=M1UoopvxaIFVVebzntV5SkToV2MT//s9I4AFLp5xe36iQyXWXf3B5UlITqUuO9sw3 efXM9qlvvu9fS5E9MTMNQVXJWE4Pc1oUDQWPa4kNVnrzcN2ixrrGjSGLItmvyPCOJf AmSShu2v6t1CnFGxmIELijAjv27QMGM73io4rRL0= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 0B71E3861878 for ; Wed, 8 Sep 2021 12:15:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B71E3861878 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 38ECC20139; Wed, 8 Sep 2021 12:15:26 +0000 (UTC) Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (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 imap1.suse-dmz.suse.de (Postfix) with ESMTPS id 1F31F13A89; Wed, 8 Sep 2021 12:15:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id mPU5Bl6pOGGcEgAAGKfGzw (envelope-from ); Wed, 08 Sep 2021 12:15:26 +0000 Date: Wed, 8 Sep 2021 14:15:24 +0200 To: gdb-patches@sourceware.org Subject: [PATCH, master+11][gdb/build] Add CXX_DIALECT to CXX Message-ID: <20210908121519.GA17723@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) 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" 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? 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