[OpenWrt-Devel] [PATCH] libevent2: Add -Wl, --gc-sections to reduce size a little.

Rosen Penev rosenp at gmail.com
Tue Feb 19 16:01:57 EST 2019


Saves ~4KB. Also reorganized configure arguments to improve compilation
speed.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/libevent2/Makefile | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile
index f7223a01d6..c264fed0c4 100644
--- a/package/libs/libevent2/Makefile
+++ b/package/libs/libevent2/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libevent2
 PKG_VERSION:=2.1.8
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_SOURCE:=libevent-$(PKG_VERSION)-stable.tar.gz
 PKG_SOURCE_URL:=https://github.com/libevent/libevent/releases/download/release-$(PKG_VERSION)-stable
@@ -108,15 +108,16 @@ define Package/libevent2-pthreads/description
 	threading & locking.
 endef
 
-TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,--gc-sections
 
 CONFIGURE_ARGS += \
 	--enable-shared \
 	--enable-static \
-	--disable-debug-mode
-
-MAKE_FLAGS += \
-	CFLAGS="$(TARGET_CFLAGS)"
+	--disable-debug-mode \
+	--disable-gcc-warnings \
+	--disable-libevent-regress \
+	--disable-samples \
+	--with-pic
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include
-- 
2.17.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list