<div dir="ltr">Sorry but no<br><div><br></div><div># These all start with e so 'make clean' can find them.<br>ALL_EMULATION_SOURCES = \<br> eaix5ppc.c \<br> eaix5rs6.c \<br> eaixppc.c \<br> eaixrs6.c \<br> ealpha.c \<br> eelf32simplecpu.c \ <br><br>and in order to make it works for me I just added mkdir -p ldscripts in genscripts.h<br><div style="color:rgb(187,190,191);background-color:rgb(18,19,20);font-family:"Droid Sans Mono",monospace;font-size:14px;line-height:19px;white-space:pre"><br><div><span style="color:rgb(139,148,158)"># Create scripts using different settings of the LD_FLAG variable</span></div><div><span style="color:rgb(255,166,87)">mkdir</span> <span style="color:rgb(86,156,214)">-p</span> <span style="color:rgb(165,214,255)">ldscripts</span></div><div><span style="color:rgb(201,209,217)">LD_FLAG</span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(165,214,255)">r</span></div><div><span style="color:rgb(201,209,217)"></span></div></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sun, Aug 16, 2026 at 5:05 AM Alan Modra <<a href="mailto:amodra@gmail.com">amodra@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Aug 15, 2026 at 12:51:26PM +0200, A B C wrote:<br>
> Hi everyone,<br>
> <br>
> While working on adding a new target/architecture to GNU ld, I ran into a<br>
> build issue where genscripts.sh fails with errors like:<br>
> Plaintext<br>
> <br>
> ../../ld/genscripts.sh: line 322: ldscripts/elf32simplecpu.xr: No such<br>
> file or directory<br>
> cat: ldscripts/dyntmp.73640: No such file or directory<br>
> sed: can't read ldscripts/elf32simplecpu.x: No such file or directory<br>
<br>
You neglected to add your new target to ALL_EMULATION_SOURCES, no<br>
other changes needed.<br>
<br>
> *Issue Description:* The failure happens because the ldscripts/ directory<br>
> does not exist at the time genscripts.sh is executed. Because the output<br>
> files cannot be created in ldscripts/, the resulting C variables in<br>
> e${EMULATION_NAME}.c end up empty/corrupted (e.g. generating broken<br>
> statements like return ; instead of returning the script string), which<br>
> subsequently fails during C compilation.<br>
> <br>
> *Root Cause:* In ld/Makefile.am, the rule responsible for generating<br>
> emulation C sources:<br>
> Makefile<br>
> <br>
> e%.c:<br>
> $(AM_V_GEN)${GENSCRIPTS} $* "$(tdir_$*)"<br>
> <br>
> does not explicitly depend on ldscripts/stamp (or $(GEN_DEPENDS)).<br>
> Consequently, under certain conditions (such as parallel builds with make -j<br>
> or when adding a custom target before running a full re-configuration),<br>
> Make attempts to run genscripts.sh before the rule creating ldscripts/ has<br>
> been executed.<br>
> <br>
> *Proposed Fix:* Adding $(GEN_DEPENDS) or ldscripts/stamp as a prerequisite<br>
> for e%.c ensures the destination directory is always created beforehand:<br>
> Makefile<br>
> <br>
> e%.c: $(GEN_DEPENDS)<br>
> $(AM_V_GEN)${GENSCRIPTS} $* "$(tdir_$*)"<br>
> <br>
> Alternatively, ensuring genscripts.sh implicitly creates ldscripts/ before<br>
> attempting file redirections could also prevent this failure.<br>
> <br>
> Thanks for your time and for maintaining Binutils!<br>
> <br>
> Best regards,<br>
> <br>
> Daniel<br>
<br>
-- <br>
Alan Modra<br>
</blockquote></div>