[source] mbedtls: add --function-sections and --data-sections to CFLAGS

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 1 11:38:08 PST 2017


jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/2e8545333a356a413c44fd8c673039807b780c42

commit 2e8545333a356a413c44fd8c673039807b780c42
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Feb 21 14:33:14 2017 +0100

    mbedtls: add --function-sections and --data-sections to CFLAGS
    
    This allows binaries that links these libraries statically to be reduced
    by using --gc-sections on link
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/libs/mbedtls/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile
index 12b97da..a7d698c 100644
--- a/package/libs/mbedtls/Makefile
+++ b/package/libs/mbedtls/Makefile
@@ -48,6 +48,8 @@ endef
 
 PKG_INSTALL:=1
 
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+
 CMAKE_OPTIONS += \
 	-DCMAKE_BUILD_TYPE:String="Release" \
 	-DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \



More information about the lede-commits mailing list