espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.73k stars 741 forks source link

fix PRECOMPILED_OBJS for all SDKs to be .o files like it already is for SDK12 #2510

Closed fanoush closed 3 weeks ago

fanoush commented 3 weeks ago

allows gcc to use default compiler rules = honor ASFLAGS

gfwilliams commented 3 weeks ago

Are you sure this works ok and it does still compile the .S though? I thought we had to explicitly tell it we needed to compile the .S files?

fanoush commented 3 weeks ago

Well, yes, it is already like that for SDK12, see last unmodified line of the patch

PRECOMPILED_OBJS += $(NRF5X_SDK_PATH)/components/toolchain/gcc/gcc_startup_nrf52.o

Not sure why did you put .S into OBJS for other SDKs than 12, maybe that was some kind of workaround for something(?), but for me it seems to work fine with .o. It finds .S file and additionally honors ASFLAGS so the board file can have this

     'ASFLAGS += -D__STARTUP_CLEAR_BSS -D__START=main',
     'LDFLAGS += -nostartfiles',

also for SDKs other than 12.

Also all build checks are green.

gfwilliams commented 3 weeks ago

Ok, great - thanks! Yes, I'm not sure why it got put there either - the name PRECOMPILED_OBJS implies I was expecting the assembly file was already compiled, which obviously it's not...