public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org> To: gdb-prs@sourceware.org Subject: [Bug build/28318] [gdb/build] std::thread support configure check does not use CXX_DIALECT Date: Mon, 04 Oct 2021 16:56:46 +0000 [thread overview] Message-ID: <bug-28318-4717-YcAqOIQqVa@http.sourceware.org/bugzilla/> (raw) In-Reply-To: <bug-28318-4717@http.sourceware.org/bugzilla/> https://sourceware.org/bugzilla/show_bug.cgi?id=28318 --- Comment #5 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> --- The gdb-11-branch branch has been updated by Tom de Vries <vries@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9b4d030ed52b52fe208edaa8be640f4dd359defc commit 9b4d030ed52b52fe208edaa8be640f4dd359defc Author: Tom de Vries <tdevries@suse.de> Date: Mon Oct 4 18:56:42 2021 +0200 [gdb/build] Add CXX_DIALECT to CXX Say we use a gcc version that (while supporting c++11) does not support c++11 by default, and needs an -std setting to enable it. If gdb would use the default AX_CXX_COMPILE_STDCXX from autoconf-archive, then we'd have: ... CXX="g++ -std=gnu++11" ... That mechanism however has the following problem (quoting from commit 0bcda685399): ... the top level Makefile passes CXX down to subdirs, and that overrides whatever gdb/Makefile may set CXX to. The result would be that a make invocation from the build/gdb/ directory would use "g++ -std=gnu++11" as expected, while a make invocation at the top level would not. ... Commit 0bcda685399 fixes this by using a custom AX_CXX_COMPILE_STDCXX which does: ... CXX=g++ CXX_DIALECT=-std=gnu++11 ... The problem reported in PR28318 is that using the custom instead of the default AX_CXX_COMPILE_STDCXX makes the configure test for std::thread support fail. We could simply 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 ... This is somewhat awkward, since it results in -std=gnu++11 occuring twice in some situations: ... $ touch src/gdb/dwarf2/read.c $ ( cd build/gdb; make V=1 dwarf2/read.o ) g++-4.8 -std=gnu++11 -x c++ -std=gnu++11 ... ... However, both settings are needed: - the switch in CXX for the std::thread tests (and other tests) - the switch in CXX_DIALECT so it can be appended in Makefiles, to counteract the fact that the top-level Makefile overrides CXX The code added in gdb/ax_cxx_compile_stdcxx.m4 is copied from the default AX_CXX_COMPILE_STDCXX from autoconf-archive. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28318 gdb/ChangeLog: 2021-10-04 Tom de Vries <tdevries@suse.de> PR build/28318 * ax_cxx_compile_stdcxx.m4: Add CXX_DIALECT to CXX. * configure: Regenerate. gdbserver/ChangeLog: 2021-10-04 Tom de Vries <tdevries@suse.de> PR build/28318 * configure: Regenerate. gdbsupport/ChangeLog: 2021-10-04 Tom de Vries <tdevries@suse.de> PR build/28318 * configure: Regenerate. -- You are receiving this mail because: You are on the CC list for the bug.
next prev parent reply other threads:[~2021-10-04 16:56 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-08 7:49 [Bug build/28318] New: [gdb/build] std::thread support configure check does not used CXX_DIALECT vries at gcc dot gnu.org 2021-09-08 8:04 ` [Bug build/28318] [gdb/build] std::thread support configure check does not use CXX_DIALECT vries at gcc dot gnu.org 2021-09-08 8:48 ` vries at gcc dot gnu.org 2021-09-08 8:51 ` vries at gcc dot gnu.org 2021-09-08 12:16 ` vries at gcc dot gnu.org 2021-10-04 16:56 ` cvs-commit at gcc dot gnu.org [this message] 2021-10-04 16:58 ` vries at gcc dot gnu.org 2021-10-04 18:31 ` brobecker at gnat dot com 2021-10-04 18:58 ` vries at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-28318-4717-YcAqOIQqVa@http.sourceware.org/bugzilla/ \ --to=sourceware-bugzilla@sourceware.org \ --cc=gdb-prs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).