Discussion:
initialization problem w/ thread-specific .tbss data on i386
Phil Shafer
2018-05-08 21:31:57 UTC
Permalink
Also, try to link in libpthread.
This was interesting, not that I'm sure what it means:

% env LD_PRELOAD=/usr/lib/libpthread.so /tmp/uptime
5:26PM up 4 days, 9:22, 3 users, load averages: 0.55, 0.52, 0.51

(where /tmp/uptime is a symlink to /usr/obj/.../w/w).
(see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227552)

Does the mean that the use of __thread requires -lpthread? My
understanding was that the startup code handled thread-specific
data for the main thread of execution.

Thanks,
Phil
Phil Shafer
2018-05-08 21:48:02 UTC
Permalink
No, try to compile libc with e.g. clang 5 and see if it also fixes
libxo.
See PR 227552 comment 20, where Dimitry Andric says:

Hmm, now that we've identified .tbss as a contributor to the
problem, it looks relevant that the r331838 version of libxo.so.0
(compiled with the clang 6.0.0 update) does NOT have a "section
to segment mapping" for .tbss:
...

Before clang-6, it was working fine.

Thanks,
Phil

Loading...