This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] libstdc++/70503 Ensure std::thread helpers have internal linkage
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: Tom de Vries <Tom_deVries at mentor dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 Apr 2016 15:42:03 +0200
- Subject: Re: [patch] libstdc++/70503 Ensure std::thread helpers have internal linkage
- Authentication-results: sourceware.org; auth=none
- References: <20160405133701 dot GH5814 at redhat dot com> <20160405172341 dot GI5814 at redhat dot com> <5706604E dot 7050306 at mentor dot com> <20160407133451 dot GT5814 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Apr 07, 2016 at 02:34:51PM +0100, Jonathan Wakely wrote:
> On 07/04/16 15:27 +0200, Tom de Vries wrote:
> >FYI, this testcase fails for me as follows:
> >...
> >/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only
> >handles version 2 and 3 information.^M
> >/tmp/ccMBMHB5.o: In function `main':^M
> >70503.cc:(.text.startup.main+0x5): undefined reference to
> >`execute_native_thread_routine'^M
> >/usr/bin/ld: Dwarf Error: found dwarf version '0', this reader only
> >handles version 2 and 3 information.^M
> >70503.cc:(.text.startup.main+0xa): undefined reference to
> >`execute_native_thread_routine_compat'^M
> >collect2: error: ld returned 1 exit status^M
> >compiler exited with status 1
> >output is:
> >/usr/bin/ld: Dwarf Error: found dwarf version '4', this reader only
> >handles version 2 and 3 information.^M
> >/tmp/ccMBMHB5.o: In function `main':^M
> >70503.cc:(.text.startup.main+0x5): undefined reference to
> >`execute_native_thread_routine'^M
> >/usr/bin/ld: Dwarf Error: found dwarf version '0', this reader only
> >handles version 2 and 3 information.^M
> >70503.cc:(.text.startup.main+0xa): undefined reference to
> >`execute_native_thread_routine_compat'^M
> >collect2: error: ld returned 1 exit status^M
> >
> >FAIL: 30_threads/thread/70503.cc (test for errors, line 31)
> >FAIL: 30_threads/thread/70503.cc (test for errors, line 32)
> >FAIL: 30_threads/thread/70503.cc (test for excess errors)
>
> Hmm, I'm not sure whether it's better to use -gdwarf-2 or add
> { dg-prune-output "dwarf version" }
Or perhaps instead change the test, so that instead of testing for
undefined symbols it provides some definition of those 2 symbols
and makes sure libstdc++.a(thread.o) is linked in too (such as
using std::thread::detach or similar somewhere).
Then in the buggy libstdc++ case, because those old definitions
were strong rather than weak, it should fail to link, while with
fixed libstdc++ succeed.
Jakub