Message ID | 20190314222828.28798-1-slyfox@gentoo.org |
---|---|
State | New, archived |
Headers |
Received: (qmail 40343 invoked by alias); 14 Mar 2019 22:28:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 40285 invoked by uid 89); 14 Mar 2019 22:28:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=helmut, cxxld, CXXLD, HContent-Transfer-Encoding:8bit X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Mar 2019 22:28:36 +0000 Received: from sf.home (trofi-1-pt.tunnel.tserv1.lon2.ipv6.he.net [IPv6:2001:470:1f1c:a0f::2]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id 3E38F335CC0; Thu, 14 Mar 2019 22:28:35 +0000 (UTC) Received: by sf.home (Postfix, from userid 1000) id 8C54B2379E4C8; Thu, 14 Mar 2019 22:28:31 +0000 (GMT) From: Sergei Trofimovich <slyfox@gentoo.org> To: gdb-patches@sourceware.org Cc: Sergei Trofimovich <slyfox@gentoo.org> Subject: [PATCH] gdb: unconditionally define _initialize_string_view_selftests Date: Thu, 14 Mar 2019 22:28:28 +0000 Message-Id: <20190314222828.28798-1-slyfox@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit |
Commit Message
Sergei Trofimovich
March 14, 2019, 10:28 p.m. UTC
The build failure was noticed by Helmut Jarausch in
https://bugs.gentoo.org/680232:
$ ./configure CXXFLAGS='-std=c++17 -Os'
...
CXXLD gdb
ld: init.o: in function `initialize_all_files()':
init.c:(.text+0x113): undefined reference to `_initialize_string_view_selftests()'
It happens because '_initialize_string_view_selftests()' is
conditionally defined based on C++ default.
The change defines '_initialize_string_view_selftests()'
unconditionally and leaves implementation a no-op on c++17
compilers.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
---
gdb/unittests/string_view-selftests.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
>>>>> "Sergei" == Sergei Trofimovich <slyfox@gentoo.org> writes:
Sergei> The build failure was noticed by Helmut Jarausch in
Sergei> https://bugs.gentoo.org/680232:
Sergei> $ ./configure CXXFLAGS='-std=c++17 -Os'
Sergei> ...
Sergei> CXXLD gdb
Sergei> ld: init.o: in function `initialize_all_files()':
Sergei> init.c:(.text+0x113): undefined reference to `_initialize_string_view_selftests()'
Sergei> It happens because '_initialize_string_view_selftests()' is
Sergei> conditionally defined based on C++ default.
Sergei> The change defines '_initialize_string_view_selftests()'
Sergei> unconditionally and leaves implementation a no-op on c++17
Sergei> compilers.
Thank you. This is OK with a ChangeLog entry.
Let me know if you need me to check it in for you.
thanks,
Tom
On Fri, 15 Mar 2019 08:24:17 -0600 Tom Tromey <tom@tromey.com> wrote: > >>>>> "Sergei" == Sergei Trofimovich <slyfox@gentoo.org> writes: > > Sergei> The build failure was noticed by Helmut Jarausch in > Sergei> https://bugs.gentoo.org/680232: > Sergei> $ ./configure CXXFLAGS='-std=c++17 -Os' > Sergei> ... > Sergei> CXXLD gdb > Sergei> ld: init.o: in function `initialize_all_files()': > Sergei> init.c:(.text+0x113): undefined reference to `_initialize_string_view_selftests()' > > Sergei> It happens because '_initialize_string_view_selftests()' is > Sergei> conditionally defined based on C++ default. > > Sergei> The change defines '_initialize_string_view_selftests()' > Sergei> unconditionally and leaves implementation a no-op on c++17 > Sergei> compilers. > > Thank you. This is OK with a ChangeLog entry. > Let me know if you need me to check it in for you. Thank you for the quick review! Yes, I need someone to check the change in for me. Should I indicate it the patch email next time? I'll send a follow-up v2 with ChangeLog added and author email matching the company which has agreement already signed with FSF.
On Sunday, March 17 2019, Sergei Trofimovich wrote: > On Fri, 15 Mar 2019 08:24:17 -0600 > Tom Tromey <tom@tromey.com> wrote: > >> >>>>> "Sergei" == Sergei Trofimovich <slyfox@gentoo.org> writes: >> >> Sergei> The build failure was noticed by Helmut Jarausch in >> Sergei> https://bugs.gentoo.org/680232: >> Sergei> $ ./configure CXXFLAGS='-std=c++17 -Os' >> Sergei> ... >> Sergei> CXXLD gdb >> Sergei> ld: init.o: in function `initialize_all_files()': >> Sergei> init.c:(.text+0x113): undefined reference to `_initialize_string_view_selftests()' >> >> Sergei> It happens because '_initialize_string_view_selftests()' is >> Sergei> conditionally defined based on C++ default. >> >> Sergei> The change defines '_initialize_string_view_selftests()' >> Sergei> unconditionally and leaves implementation a no-op on c++17 >> Sergei> compilers. >> >> Thank you. This is OK with a ChangeLog entry. >> Let me know if you need me to check it in for you. > > Thank you for the quick review! Yes, I need someone to check the > change in for me. Should I indicate it the patch email next time? Either that, or you can request commit access to the repository here: https://sourceware.org/cgi-bin/pdw/ps_form.cgi I'm not a global maintainer, but I believe Tom wouldn't mind if you put him as the person who approved the request. Thanks,
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
Sergio> I'm not a global maintainer, but I believe Tom wouldn't mind if you put
Sergio> him as the person who approved the request.
Indeed. The rule is you need one accepted patch to get
write-after-review access. If you go this route then you should send
and commit a patch to update the MAINTAINERS file to add your name.
thanks,
Tom
diff --git a/gdb/unittests/string_view-selftests.c b/gdb/unittests/string_view-selftests.c index 21a10e65af..b2a2bf7f2e 100644 --- a/gdb/unittests/string_view-selftests.c +++ b/gdb/unittests/string_view-selftests.c @@ -170,10 +170,12 @@ run_tests () } /* namespace string_view */ } /* namespace selftests */ +#endif /* __cplusplus < 201703L */ + void _initialize_string_view_selftests () { +#if defined(GDB_STRING_VIEW) selftests::register_test ("string_view", selftests::string_view::run_tests); +#endif } - -#endif /* __cplusplus < 201703L */