Skip to content

Commit

Permalink
feat: strip libcmt libraries to reduce its size
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Oct 22, 2024
1 parent 92adcb9 commit 97a39b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sys-utils/libcmt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down

0 comments on commit 97a39b9

Please sign in to comment.