mbedtls: add --function-sections and --data-sections to CFLAGS
[openwrt/openwrt.git] / package / libs / mbedtls / Makefile
index 990aabe066578b33180b9eb63227dcdf3cbf15c1..a7d698c4fc53ca511a9ef1d2f9c27e7bfeefca71 100644 (file)
@@ -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 \
@@ -59,6 +61,7 @@ define Build/InstallDev
        $(CP) $(PKG_INSTALL_DIR)/usr/include/mbedtls $(1)/usr/include/
        $(INSTALL_DIR) $(1)/usr/lib
        $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.so* $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.a $(1)/usr/lib/
 endef
 
 define Package/libmbedtls/install