On Jun 22, 2023, at 10:35 PM, Alexandre Oliva <ol...@adacore.com> wrote:
> 
> This patch documents a glitch in gcc.misc-tests/outputs.exp: it checks
> whether the linker is GNU ld, and uses that to decide whether to
> expect collect2 to create .ld1_args files under -save-temps, but
> collect2 bases that decision on whether HAVE_GNU_LD is set, which may
> be false zero if the linker in use is GNU ld.  Configuring
> --with-gnu-ld fixes this misalignment.  Without that, atsave tests are
> likely to fail, because without HAVE_GNU_LD, collect2 won't use @file
> syntax to run the linker (so it won't create .ld1_args files).
> 
> Long version: HAVE_GNU_LD is set when (i) DEFAULT_LINKER is set during
> configure, pointing at GNU ld; (ii) --with-gnu-ld is passed to
> configure; or (iii) config.gcc sets gnu_ld=yes.  If a port doesn't set
> gnu_ld, and the toolchain isn't configured so as to assume GNU ld,
> configure and thus collect2 conservatively assume the linker doesn't
> support @file arguments.
> 
> But outputs.exp can't see how configure set HAVE_GNU_LD (it may be
> used to test an installed compiler), and upon finding that the linker
> used by the compiler is GNU ld, it will expect collect2 to use @file
> arguments when running the linker.  If that assumption doesn't hold,
> atsave tests will fail.
> 
> Does it make sense to put this in?  I'd like to preserve this knowledge
> somehow, and I suppose this would be most useful for someone observing
> these failures and trying to figure out why they come about, so this
> seems the best place for them.  Ok to install?

Ok.

Reply via email to