public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Stephan Bergmann <sbergman@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Avoid redundant checks in std::use_facet [PR103755]
Date: Sat, 12 Nov 2022 02:47:18 +0000	[thread overview]
Message-ID: <CACb0b4nJ8AEjdgAQef3yoJ8jjW070EokVu7HZdVpreDUXSzOZg@mail.gmail.com> (raw)
In-Reply-To: <ec586283-36b3-14c5-83ea-5096901ebd29@redhat.com>

On Fri, 11 Nov 2022 at 21:00, Stephan Bergmann <sbergman@redhat.com> wrote:
>
> On 11/11/22 06:30, Jonathan Wakely via Gcc-patches wrote:
> > As discussed in the PR, this makes it three times faster to construct
> > iostreams objects.
> >
> > Tested x86_64-linux. Pushed to trunk.
>
> I haven't yet tried to track down what's going on, but with various
> versions of Clang (e.g. clang-15.0.4-1.fc37.x86_64):
>
> > $ cat test.cc
> > #include <regex>
> > int main(int, char ** argv) {
> >     std::regex_traits<char>().transform(argv[0], argv[0] + 1);
> > }
>
> > $ clang++ --gcc-toolchain=... -fsanitize=undefined -O2 test.cc
> > /usr/bin/ld: /tmp/test-c112b1.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::__cxx11::regex_traits<char>::transform<char*>(char*, char*) const':
> > test.cc:(.text._ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_[_ZNKSt7__cxx1112regex_traitsIcE9transformIPcEENS_12basic_stringIcSt11char_traitsIcESaIcEEET_S9_]+0x1b): undefined reference to `std::__cxx11::collate<char> const* std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&)'
> > clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

That should be present, andis present in my builds:

_ZSt15__try_use_facetINSt7__cxx117collateIcEEEPKT_RKSt6locale
std::__cxx11::collate<char> const*
std::__try_use_facet<std::__cxx11::collate<char> >(std::locale const&)
version status: compatible
GLIBCXX_3.4.31
type: function
status: added

Was this a clean build, or incremental? I'm guessing the latter.

The makefile deps for libstdc++ don't really support incremental
builds. More precisely, the lack of deps. That symbol should be
defined in src/c++11/cxx11-locale-inst.o which wasn't changed by the
patch, but it includes src/c++11/locale-inst.cc which was changed. So
an incremental rebuild will only rebuild the latter, and so you won't
get the new symbols that should be in the former.

But if you're seeing that with a clean build I'll have to investigate.


  reply	other threads:[~2022-11-12  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11  5:30 Jonathan Wakely
2022-11-11 21:00 ` Stephan Bergmann
2022-11-12  2:47   ` Jonathan Wakely [this message]
2022-11-13 19:22     ` Stephan Bergmann
2022-11-13 19:38       ` Jonathan Wakely

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=CACb0b4nJ8AEjdgAQef3yoJ8jjW070EokVu7HZdVpreDUXSzOZg@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=sbergman@redhat.com \
    /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: link
Be 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).