From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wGSKD5SDN2EdOAAAWB0awg (envelope-from ) for ; Tue, 07 Sep 2021 11:21:56 -0400 Received: by simark.ca (Postfix, from userid 112) id 3D1081EE22; Tue, 7 Sep 2021 11:21:56 -0400 (EDT) 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=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham 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 765E01EDF0 for ; Tue, 7 Sep 2021 11:21:55 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D44C1385C418 for ; Tue, 7 Sep 2021 15:21:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D44C1385C418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1631028114; bh=koUyxOhvuLNfnPjKn1bbg8OHMYKzzbheh9z2QtXPM/E=; 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=LEtntfxnGp+8itxdxhK0wQqv8qHcpuafMB7uoWZmhlfvHmIN1lfuUa6RFX51k/Z8E XJ+1fhaEGcdwNI79P1x47OC4VYQaPPAzSae7dGbQAamK2XYKXk1hkAiMimcQKmhv3f G0N7z7NtDM29RxaFeOr1tgDzICUzkT/lZoeYfB8o= Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 7A2A8385EC59 for ; Tue, 7 Sep 2021 15:19:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A2A8385EC59 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-out1.suse.de (Postfix) with ESMTPS id AF861220E1; Tue, 7 Sep 2021 15:19:23 +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 9343C13A3E; Tue, 7 Sep 2021 15:19:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id FuxhIvuCN2EsGQAAGKfGzw (envelope-from ); Tue, 07 Sep 2021 15:19:23 +0000 Subject: Re: [PATCH][gdb/build] Fix build with undefined CXX_STD_THREAD To: gdb-patches@sourceware.org References: <20210907145006.GA4878@delia> Message-ID: Date: Tue, 7 Sep 2021 17:19:23 +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: <20210907145006.GA4878@delia> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit 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: Tom Tromey Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 9/7/21 4:50 PM, Tom de Vries via Gdb-patches wrote: > Hi, > > When building gdb on openSUSE Leap 42.3, we trigger the case that > CXX_STD_THREAD is undefined, and run into: > ... > gdb/maint.c: In function ‘void maintenance_show_worker_threads \ > (ui_file*, int, cmd_list_element*, const char*)’: > gdb/maint.c:877:14: error: ‘gdb::thread_pool’ has not been declared > gdb::thread_pool::g_thread_pool->thread_count ()); > ^ > Makefile:1647: recipe for target 'maint.o' failed > make[1]: *** [maint.o] Error 1 > ... > > Fix this by handling the undefined CXX_STD_THREAD case in > maintenance_show_worker_threads, such that we get: > ... > $ gdb -q -batch -ex "maint show worker-thread" > The number of worker threads GDB can use is 0. > ... > > Tested on x86_64-linux. > > Any comments? > Btw, I just found a related issue. I find: ... CXX_DIALECT='-std=gnu++11' ... in the config.log, but that setting is not used when checking for CXX_STD_THREAD, so we have: ... configure:14614: checking for std::thread configure:14631: g++ -c -pthread -Wall -O2 -g conftest.cpp >&5 In file included from /usr/include/c++/4.8/thread:35:0, from conftest.cpp:167: /usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support for the \ ^ conftest.cpp: In function 'int main()': conftest.cpp:172:1: error: 'thread' is not a member of 'std' std::thread t(callback); ^ conftest.cpp:172:13: error: expected ';' before 't' std::thread t(callback); ^ configure:14631: $? = 1 ... It could be that: ... $ g++ -std=gnu++11 -c -pthread -Wall -O2 -g conftest.cpp ... actually would succeed. Thanks, - Tom