From 97a39b9535118ccf6a208bc466ef84c77982e3da Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Tue, 22 Oct 2024 18:38:10 -0300 Subject: [PATCH] feat: strip libcmt libraries to reduce its size --- sys-utils/libcmt/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys-utils/libcmt/Makefile b/sys-utils/libcmt/Makefile index 52484e8..a6c07d5 100644 --- a/sys-utils/libcmt/Makefile +++ b/sys-utils/libcmt/Makefile @@ -19,6 +19,7 @@ TARGET_PREFIX ?= $(PREFIX) TOOLCHAIN_PREFIX ?= riscv64-linux-gnu- TARGET_CC := $(TOOLCHAIN_PREFIX)gcc TARGET_AR := $(TOOLCHAIN_PREFIX)ar +TARGET_STRIP := $(TOOLCHAIN_PREFIX)strip COMMON_CFLAGS := -Wvla -O2 -g -Wall -pedantic -Wextra -Iinclude \ -fno-strict-aliasing -fno-strict-overflow -fPIC TARGET_CFLAGS := $(COMMON_CFLAGS) -ftrivial-auto-var-init=zero -Wstrict-aliasing=3 @@ -77,10 +78,12 @@ libcmt: $(libcmt_LIB) $(libcmt_SO) install-run: $(libcmt_SO) mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib cp -f $(libcmt_SO) $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib + $(TARGET_STRIP) -S -x $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib/libcmt.so install: $(libcmt_LIB) build/ffi.h mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib cp -f $(libcmt_LIB) $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib + $(TARGET_STRIP) -S $(TARGET_DESTDIR)$(TARGET_PREFIX)/lib/libcmt.a mkdir -p $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ cp -f include/libcmt/*.h $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/ cp -f build/ffi.h $(TARGET_DESTDIR)$(TARGET_PREFIX)/include/libcmt/