On 11/10/2015 11:20 PM, Jeff Law wrote: > On 11/10/2015 11:16 AM, Andris Pavenis wrote: >> One may need to execute extra steps after linking program. This is required >> for example for DJGPP to run stubify.exe on file generated by linker. >> >> The only way how to achieve was to use LINK_COMMAND_SPEC. It would be >> much easier >> and less error prone to use new macro POST_LINK_SPEC introduced in this >> patch. >> >> Andris >> >> ChangeLog entry >> >> 2015 Nov 10 Andris Pavenis >> >> * gcc.c: new macro POST_LINK_SPEC >> * doc/tm.texi.in: document POST_LINK_SPEC >> * doc/tm.texi: regenerate >> > Can you also include the changes to djgpp.h which exploit this capability? > > Jeff OK. I'm only sending changes for djgpp.h. There are required changes to other files not included, so djgpp.h patch currently to illustrate use of POST_LINK_SPEC only not committing. In short: - earlier entire LINK_COMMAND_SPEC was redefined in djgpp.h (copy/paste from trunk) #undef LINK_COMMAND_SPEC #define LINK_COMMAND_SPEC \ "%{!fsyntax-only: \ %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l " LINK_COMPRESS_DEBUG_SPEC \ "%X %{o*} %{e*} %{N} %{n} \ \t%{r} %{s} %{t} %{u*} %{z} %{Z}\ \t%{!nostdlib:%{!nostartfiles:%S}}\ \t%{static:} %{L*} %D %o\ \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\ \t%{!nostdlib:%{!nostartfiles:%E}}\ \t-Tdjgpp.djl %{T*}}}}}}}\n\ %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}" One needed to update it each time when LINK_COMMAND_SPEC changes in gcc.c - use of linker script djgpp.djl has actually done long ago (mentioned in comments for LINK_COMMAND_SPEC override). The other reason: running stubify after linker has remain - in new version I only need #undef POST_LINK_SPEC #define POST_LINK_SPEC "stubify %{v} %{o*:%*} %{!o*:a.out}" instead, which is much simpler. About DJGPP related changes accumulated in rather many years. There were changes to generic files which are highly unlikely to be accepted (like use #ifdef __DJGPP__ in system independent files). I have to remove such ifdefs from system independent files and re-implement it differently where possible. That will take some time and testing Andris