I would like to suggest a small adjustment to GCC/ld/rules.ld file (patch attached), against the current svn. The point is that this makes it possible to use custom ld scripts without extra hassle of copying over rules* ld files as well.
Explanation: if rules* files do not reside in the same directory as the main ld script (e.g. STM32F042x4.ld which doesn't come with the mainline ChibiOS - so I put it in the project directory) then the INCLUDE commands can't find the rules_*.ld files in the main ChibiOS tree. It's because the search paths passed normally to linker are 1) wherever the main ld script is; and 2) os/common/startup/ARMCMx/compilers/GCC
However the rules_* ld files are not there, they're in the 'ld' subdirectory of 2).
With this patch, I can 'INCLUDE ld/rules.ld' in my main project ld script, and then the nested INCLUDEs in the rules.ld find the rules_*.ld correctly.
This makes no change to the demos/ldscripts included in the mainline ChibiOS because of 2) above.
GCC/ld/rules.ld adjustment
Moderators: RoccoMarco, lbednarz, tfAteba
-
flabbergast
- Posts: 71
- Joined: Sat Aug 22, 2015 1:22 pm
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: GCC/ld/rules.ld adjustment
Hi,
I modified rules.mk instead, now the library path is $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld, this should fix the problem. Having a library path to $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC was pointless because ld files moved all under ./ld.
Giovanni
I modified rules.mk instead, now the library path is $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/ld, this should fix the problem. Having a library path to $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC was pointless because ld files moved all under ./ld.
Giovanni
-
flabbergast
- Posts: 71
- Joined: Sat Aug 22, 2015 1:22 pm