Message ID | 21980174.4csPzL39Zc@fomalhaut |
---|---|
State | New |
Headers | show |
Series | [Ada] Fix PR ada/118247 | expand |
On Mon, 6 Jan 2025, Eric Botcazou wrote: > This is a regression introduced by > https://gcc.gnu.org/pipermail/gcc-cvs/2024-July/405522.html > in the form of a spurious relinking of the gnatbind executable for the install > target of cross Ada compilers. The fix feels hackish and I wonder how other frontends handle this, but overall thank you for taking care of this peculiarity. Maciej
> The fix feels hackish and I wonder how other frontends handle this, but > overall thank you for taking care of this peculiarity. You're welcome. The main Makefile does the same for xgcc -> gcc-cross and, as this example shows, every change is this area is almost guaranteed to break something, so the simpler, the better.
On Tue, 7 Jan 2025, Eric Botcazou wrote: > > The fix feels hackish and I wonder how other frontends handle this, but > > overall thank you for taking care of this peculiarity. > > You're welcome. The main Makefile does the same for xgcc -> gcc-cross and, > as this example shows, every change is this area is almost guaranteed to break > something, so the simpler, the better. Thank you for the clarification, I can see the Makefile fragment now and I agree it was the right choice to follow it. I think such explanatory notes are best placed in the change description though, for the benefit of people coming across it in the future. Maciej
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in index 1d8f0970980..b0c568ad60b 100644 --- a/gcc/ada/gcc-interface/Make-lang.in +++ b/gcc/ada/gcc-interface/Make-lang.in @@ -833,10 +833,14 @@ gnatlib gnatlib-sjlj gnatlib-zcx gnatlib-shared: force gnattools-cross-mv: $(GNATTOOLS_CROSS_MV) +# gnatbind$(exeext) is a prerequisite of the ada target and +# thus needs to be copied instead of moved. GNATTOOLS_CROSS_MV=\ - for tool in $(ADA_TOOLS) ; do \ - if [ -f $$tool$(exeext) ] ; \ - then \ + if [ -f gnatbind$(exeext) ] ; then \ + $(CP) gnatbind$(exeext) gnatbind-cross$(exeext); \ + fi; \ + for tool in $(filter-out gnatbind, $(ADA_TOOLS)) ; do \ + if [ -f $$tool$(exeext) ] ; then \ $(MV) $$tool$(exeext) $$tool-cross$(exeext); \ fi; \ done