Skip to content

Commit 5eb25e7

Browse files
committed
Enable function and data sections for newlib.
Reduces size of hello in freedom-e-sdk by ~10 kb (20%), if also linking with --gc-sections.
1 parent 5dd4633 commit 5eb25e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ stamps/build-newlib: $(srcdir)/riscv-newlib stamps/build-gcc-newlib-stage1
384384
--enable-newlib-io-long-double \
385385
--enable-newlib-io-long-long \
386386
--enable-newlib-io-c99-formats \
387-
CFLAGS_FOR_TARGET="-Os $(CFLAGS_FOR_TARGET)"
387+
CFLAGS_FOR_TARGET="-Os -ffunction-sections -fdata-sections $(CFLAGS_FOR_TARGET)"
388388
$(MAKE) -C $(notdir $@)
389389
$(MAKE) -C $(notdir $@) install
390390
mkdir -p $(dir $@) && touch $@

0 commit comments

Comments
 (0)