The libmaple Makefile as provided on GitHub does not build as-is. I haven’t been able to trace this all the way though, but it seems that linking is done via the g++
driver rather than with ld
directly. The LDFLAGS
Makefile variable is where the trouble is; in order to make the build work I needed to change the last bit of the definition:
LDFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR)
-mcpu=cortex-m3 -mthumb -Xlinker
--gc-sections --print-gc-sections --march=armv7-m -Wall
The last bit needs to look like this:
--gc-sections -Wl,-print-gc-sections -Wall
instead.