g++ 5.3 AIX call_once issues

Brian Groose brian@groose.com
Mon Oct 30 14:22:00 GMT 2017


Hi Bob,

Yes, I have -pthread, in fact, it won't even compile (much less try to
link) because the declaration isn't visible without -pthread.
I verified that the linker is looking at the pthread version of libstdc++.a
as well, which shows the type "L" AIX TLS symbols when I run nm on it.

I've tried compiling gcc without and without --enable-tls, which doesn't
seem to make any difference.


On Mon, Oct 30, 2017 at 6:55 AM, Bob Wilkinson <bob.wilkinson@cristie.com>
wrote:

> On Sun, Oct 29, 2017 at 12:14:59PM -0400, Brian Groose wrote:
> > I'm hitting what looks like pr67478 (which is fixed by pr 68192).
> >
> > The example in PR67478 fails with the same error.  However, I'm running
> g++
> > 5.3.0, so the issue should be fixed with my compiler.
> >
> > I can see the symbols in libstdc++.a as type L as expected.
> >
> > Do I need to compile g++ with some special option for this?
> >
> > TLS using the thread_local keyword works fine, it's just that the linker
> > can't seem to find the symbols for call once:
> > ld: 0711-317 ERROR: Undefined symbol: std::__once_callable
> > ld: 0711-317 ERROR: Undefined symbol: std::__once_call
> > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> > information.
> > collect2: error: ld returned 8 exit status
> >
> > Thanks!
>
> Hello Brian
>
> Do you have the flag '-pthread' set while compiling?
>
> Bob
>



More information about the Gcc-help mailing list