Tatsuyuki Ishi

Results 351 comments of Tatsuyuki Ishi

I can reproduce this. Let me take a look.

What I know so far: this happens for TLS usage in statically linked libraries and probably has to do with some GNU-related behavior. One of the `.a` symbols look like...

> Could you investigate a bit more about how this package was built and report the problem to Ubuntu? I looked at the same file on Arch and it also...

> > I looked at the same file on Arch and it also has UNIQUE. Maybe Boost is setting such a flag? > > Possibly. I'll see if it has...

I'm very sorry that I made some mistakes during debugging, and ld.bfd was actually used when I said I used lld. I guess it's possibly some bfd specific behavior related...

As for `-fgnu-unique`, looks like it's still the default. Tested on both Arch and Ubuntu. ``` $ gcc --version gcc (GCC) 12.1.0 ... $ gcc -Q --help=common | rg unique...

OK, I figured out whatever nefarious logic gold was using: https://github.com/bminor/binutils-gdb/blob/c8eab1d7c92ad72089c98e5753ebc96419e3674a/gold/resolve.cc#L99-L101 Apparently the GCC linker plugin will emit most of the ltrans symbol as `GLOBAL` even if they were declared...

> Do you mind if I ask you to file a bug against GCC? Sounds good, will do. > As to how to fix the issue, I think it's sensible...

After looking into this again, it turned out that the cause is rather different: GCC LTO plugin does not emit the object file with correct `st_bind` and `st_visibility` attributes, and...

> I think there's another way to fix the issue. Currently, we redo symbol resolution from scratch after LTO, but we don't need to do that. Instead of discarding all...