On 29/05/2020 01:00, Alexandre Oliva wrote:
I understand the problem, and I'm tempted to say it was a latent
preexisting problem.
gcn-hsa.h defines -mlocal-symbol-id=%b in CC1_SPEC.
This is a target option not marked as pch_ignore, so
option_affects_pch_p returns true for it, and default_pch_valid_p in
targhooks.c compares the saved option in the PCH file with the active
option in the current compilation.
Thank you for the careful analysis. I would have struggled to get there
myself.
That option is the vestige of a horrible, ugly workaround for an ELF
loader bug in the GPU drivers, in which it would refuse to load a binary
that had the same local symbol defined multiple times (e.g. from linking
together .o files each containing the same local name).
That bug has been fixed in the driver, and I don't think the name
mangling was ever committed to the upstream toolchain, but the (now
inactive) option remains. I don't recall why; it may have been for
backward compatibility, or it may have been an unintentional omission.
Either way, I don't think we need it in GCC 11, so I can just rip it out.
Thanks again
Andrew