Re: [OpenWrt-Devel] [PATCH 3/3] curl: add flags to allow gc-sections to strip out unused code
On 7 April 2016 at 18:22, Hauke Mehrtens wrote: > On 04/07/2016 10:21 AM, Dirk Feytons wrote: > > Signed-off-by: Dirk Feytons > > --- > > package/network/utils/curl/Makefile |3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/package/network/utils/curl/Makefile > b/package/network/utils/curl/Makefile > > index 319c0b7..af38ed4 100644 > > --- a/package/network/utils/curl/Makefile > > +++ b/package/network/utils/curl/Makefile > > @@ -99,8 +99,9 @@ define Package/libcurl/config > >source "$(SOURCE)/Config.in" > > endef > > > > -TARGET_CFLAGS += $(FPIC) > > +TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections > > TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM) > > +TARGET_LDFLAGS += -Wl,--gc-sections > > > > CONFIGURE_ARGS += \ > > --disable-debug \ > > > Out of curiosity, have you checked how much memory this saves? > I did :) A basic build of libcurl with only HTTP/HTTPS support (via OpenSSL) is 207828 bytes without --gc-sections and 195348 with. Not bad I would say. For the curl application itself the numbers are 87728 and 86864 bytes, so there the difference is less. Dirk F. ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH 3/3] curl: add flags to allow gc-sections to strip out unused code
On 04/07/2016 10:21 AM, Dirk Feytons wrote: > Signed-off-by: Dirk Feytons > --- > package/network/utils/curl/Makefile |3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/package/network/utils/curl/Makefile > b/package/network/utils/curl/Makefile > index 319c0b7..af38ed4 100644 > --- a/package/network/utils/curl/Makefile > +++ b/package/network/utils/curl/Makefile > @@ -99,8 +99,9 @@ define Package/libcurl/config >source "$(SOURCE)/Config.in" > endef > > -TARGET_CFLAGS += $(FPIC) > +TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections > TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM) > +TARGET_LDFLAGS += -Wl,--gc-sections > > CONFIGURE_ARGS += \ > --disable-debug \ > Out of curiosity, have you checked how much memory this saves? Hauke ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
[OpenWrt-Devel] [PATCH 3/3] curl: add flags to allow gc-sections to strip out unused code
Signed-off-by: Dirk Feytons --- package/network/utils/curl/Makefile |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 319c0b7..af38ed4 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -99,8 +99,9 @@ define Package/libcurl/config source "$(SOURCE)/Config.in" endef -TARGET_CFLAGS += $(FPIC) +TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM) +TARGET_LDFLAGS += -Wl,--gc-sections CONFIGURE_ARGS += \ --disable-debug \ ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel