ease the use of G++ as LD when needed

Use this forum for requesting small changes in ChibiOS. Large changes should be discussed in the development forum. This forum is NOT for support.
Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

ease the use of G++ as LD when needed

Post by alex31 »

Hello,

Before 21.11, the compiler settings where done in the top level makefile.
Now, it's done in arm-none-eabi.mk sub makefile included at the end of the top level makefile.

Some project need to link with G++ (example : when there is global objects with virtual constructor / destructor)

I propose that, at least for LD, the setting be done only if LD is empty, or left to the non arm-none-eabi one :

Code: Select all

ifeq (,$(findstring $(TRGT),$(LD)))
LD   = $(TRGT)gcc
endif


So far, if one puts his own definition in the compiler option section of the makefile (which is before the include of arm-none-eabi.mk), his own LD definition will not be overwritten.

Alexandre
Post Reply