https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80531

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ah, so even on this testcase and with cross, it uses without -fPIC
GOMP_atomic_start in the GLOBAL_* symbol name.
But with -fPIC, checking or release-checking, cross or native, it creates those
symbol names with random seed in it, because notice_global_symbol has:
  /* We win when global object is found, but it is useful to know about weak
     symbol as well so we can produce nicer unique names.  */
  if (DECL_WEAK (decl) || DECL_ONE_ONLY (decl) || flag_shlib)
    t = &weak_global_object_name;
and so for -fPIC we never register a hard symbol name (because it can be
overridden in another shared library?).
What is weird is that this doesn't seem to be anything new, nor anything to do
with --enable-checking.
So I wonder why you weren't getting such bootstrap comparison failures on AIX
since forever (other targets typically have support for file
constructor/destructor that doesn't require any global symbols and thus don't
suffer from this).
A fix can be not use bootstrap comparison on AIX or make sure all shared
libraries that are bootstrapped are compiled with -frandom-seed= option.

Apparently libstdc++ is built with -frandom-seed=$@
libgomp/configure.tgt has:
# PA 32 HP-UX needs -frandom-seed for bootstrap compare.
XCFLAGS="${XCFLAGS} -frandom-seed=fixed-seed"
but nothing similar for AIX.  Guess we should just add something like that
there, better with $@ as the string, but I'll need to figure out what kind of
quoting is needed for that.

Reply via email to