From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by sourceware.org (Postfix) with ESMTPS id F364C3858D34 for ; Tue, 7 Sep 2021 16:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F364C3858D34 Received: by mail-qv1-xf2d.google.com with SMTP id p17so6108331qvo.8 for ; Tue, 07 Sep 2021 09:13:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=h2ZTLr3VhdlFSuzXRskniGzDmhOmbHUBmYUraueF6C8=; b=gIpe26AmOHZrhSF8YE7fgTNXaMYOXfPvcCWV320kqabLybEqerqsEOzqcUUK72e6Dp ggUFc/hO8flnV+YtIsLg0nC2Tp+VnWKa52/vk1dE67GrumVEaBtyEDPH/xGxfVs6p9Ng PTcbrgECb4rjwox3wDpA+pctEkn9r4cOi9HRPqoDmO1F4NkzxggBJVkrYMagHKVWyWoD E8+BtSSsO5x5Cx2VOCUkHXi8r09C+vb1yoPXMMRGfWWJYpTYQXkBGvM1ArEwzlOgj64r 66oXC0IgdB++CilW7NU+4GukAadPn0OTcMOpGFKiQ01ibopXCkYK3pFeY2w2uRC4Gdx0 Fg3g== X-Gm-Message-State: AOAM531coRGelwx/qqbFVslULVtdFFjsmxwubFAc9z5gSh/IIMI5nnNG mEipgJc4WD7ShIKUTMD9C4k5A8ZpjmjOLIPnFb2AOA== X-Google-Smtp-Source: ABdhPJzuMG3ovEo6qT2ZDZ6omTMFamqPtwSwGipgbCu9IAnnXLV90QAddVjsJERTDkLgG2D4HUNkiN/4cyWfoVYID+g= X-Received: by 2002:a0c:aa55:: with SMTP id e21mr18415569qvb.41.1631031199440; Tue, 07 Sep 2021 09:13:19 -0700 (PDT) MIME-Version: 1.0 References: <20210907145006.GA4878@delia> In-Reply-To: From: Christian Biesinger Date: Tue, 7 Sep 2021 12:12:41 -0400 Message-ID: Subject: Re: [PATCH][gdb/build] Fix build with undefined CXX_STD_THREAD To: Tom de Vries Cc: gdb-patches , Tom Tromey Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-18.1 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 07 Sep 2021 16:13:21 -0000 BTW, it seems https://sourceware.org/bugzilla/show_bug.cgi?id=3D28312 was filed for this. Christian On Tue, Sep 7, 2021 at 11:22 AM Tom de Vries via Gdb-patches wrote: > > 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 =E2=80=98void maintenance_show_worker_threads = \ > > (ui_file*, int, cmd_list_element*, const char*)=E2=80=99: > > gdb/maint.c:877:14: error: =E2=80=98gdb::thread_pool=E2=80=99 has not b= een 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=3D'-std=3Dgnu++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=3Dc++11 or -std=3Dgnu++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: $? =3D 1 > ... > > It could be that: > ... > $ g++ -std=3Dgnu++11 -c -pthread -Wall -O2 -g conftest.cpp > ... > actually would succeed. > > Thanks, > - Tom >