diff --git a/Makefile b/Makefile index 32e95d48327b..5c93e6145457 100644 --- a/Makefile +++ b/Makefile @@ -290,9 +290,9 @@ ifeq ($(STATIC),1) # For MacOS, Jacob Rapoport changed this to: # -L/usr/local/lib -lsqlite3 -lz -Wl,-lm -lpthread -ldl $(COVFLAGS) # But that doesn't static link. -LDLIBS = -L$(CPATH) -Wl,-dn $(SQLITE3_LDLIBS) -Wl,-dy -lm -lpthread -ldl $(COVFLAGS) +LDLIBS = -L$(CPATH) -Wl,-dn $(SQLITE3_LDLIBS) -Wl,-dy -lm -lpthread -ldl $(COVFLAGS) -Wl,--gc-sections else -LDLIBS = -L$(CPATH) -lm $(SQLITE3_LDLIBS) $(COVFLAGS) +LDLIBS = -L$(CPATH) -lm $(SQLITE3_LDLIBS) $(COVFLAGS) -Wl,--gc-sections endif # If we have the postgres client library we need to link against it as well @@ -1107,6 +1107,7 @@ ccan-rune-coding.o: $(CCANDIR)/ccan/rune/coding.c @$(call VERBOSE, "cc $<", $(CC) $(CFLAGS) -c -o $@ $<) print-binary-sizes: $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) - @find $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) -printf '%p\t%s\n' - @echo 'Total program size: '`find $(ALL_PROGRAMS) -printf '%s\n' | awk '{TOTAL+= $$1} END {print TOTAL}'` - @echo 'Total tests size: '`find $(ALL_TEST_PROGRAMS) -printf '%s\n' | awk '{TOTAL+= $$1} END {print TOTAL}'` + @echo User programs: + @size -t $(PKGLIBEXEC_PROGRAMS) $(filter-out tools/reckless,$(BIN_PROGRAMS)) $(PLUGINS) + @echo All programs: + @size -t $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS) | tail -n1 diff --git a/configure b/configure index f69dc1573a3b..243017b472db 100755 --- a/configure +++ b/configure @@ -46,8 +46,9 @@ usage_with_default() # Given DEBUGBUILD, what COPTFLAGS do we default to. default_coptflags() { + printf "%s" "-ffunction-sections" if [ "$1" = 0 ]; then - echo "-Og" + echo " -Og" fi }