https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100152
--- Comment #41 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Richard Biener from comment #40) > (In reply to Richard Biener from comment #39) > > (In reply to Iain Sandoe from comment #38) > > > (In reply to Richard Biener from comment #37) > > > > Oh, and FYI a cc1 cross from x86_64 to x86_64-apple-darwin19.6.0 > > > > doesn't seem > > > > to reproduce the issue with the reduced testcase (I seee no call to > > > > ___UTF_8_put remaining with -O3 -fPIC -fno-strict-aliasing -fwrapv). > > code. But then ___UTF_8_put isn't interposable so I wonder why the linker > > even has to resolve anything. Adding -fPIC OTOH should definitely make the > > symbol interposable but the same code is still generated ... Darwin x86_64 is always PIC (fPIC is a NOP, and is added if no other PIC mode is given). user-mode code is invalid without it. > > breaking on darwin_binds_local_p I see ___UTF_8_put is considered binding > > local even with -fPIC. So GCC thinks there will be no linker stub involved. which is the immediate bug here... > flag_shlib != 0 || force_overridable I want to check on the indirection rules to be sure [they are not exactly the same as Linux] (and that flag_shlib is set appropriately). The other possible bug might be irrelevant (missing information to IPA about the lazy resolver) - but I still need to think about the various cases.