Closed fanoush closed 1 year ago
targetlibs/nrf5x_12/components/toolchain/gcc/gcc_startup_nrf5(2|1).o files are not cleared on
make clean
also reported here https://github.com/espruino/Espruino/issues/2336#issuecomment-1470638659
Thanks! Sorry I missed this earlier. Looks great - merging now.
Why there are .S files in PRECOMPILED_OBJS ?
I'm not sure!
And btw it saves about 300 bytes in BANGLE build - 1688b free vs 1380b free
Doin gnostartfiles
? Have you tested it? Part of me wonders whether as Tensorflow uses C++, it might need some of the stuff that's in there?
And I'll make sure those .o files get cleaned - thanks! I wonder if that's been affecting my firmware builds - luckily I guess most of the flags are the same usually
CFLAGS are not actually passed to .S files, we need ASFLAGS for that
also there is easier way to use
main()
as_start()
via -D__START=main - this also verifies flags are passed properly otherwise it fails in linker not finding_start
This can be merged as is for microbit1 however there are unclear issues with makefiles.
1.
nrf51 adds .o file to PRECOMPILED_OBJS here https://github.com/espruino/Espruino/blob/master/make/family/NRF51.make#L15 and this works fine, however nrf52 has .S files there in many places like here https://github.com/espruino/Espruino/blob/master/make/family/NRF52.make#L25 except here https://github.com/espruino/Espruino/blob/master/make/family/NRF52.make#L63
When I tried to put .S to nrf51 makefile instead of .o it did not pass ASFLAGS properly (nor CFLAGS) so the .o variant is a good one here.
However when I tried to add same lines
to BANGLEJS board file it worked fine despite .S! Or maybe it uses the
.o
makefile variant here too (?)Why there are .S files in PRECOMPILED_OBJS ?
And btw it saves about 300 bytes in BANGLE build -
1688b free
vs1380b free
2.
targetlibs/nrf5x_12/components/toolchain/gcc/gcc_startup_nrf5(2|1).o files are not cleared on
make clean
so if you try to build locally for two boards with different flags old .o file with different flags gets reused. Won't affect pipeline builds so can be merged for microbit1 despite possible other nrf51 builds not having the flag.