From 2509bc0045e26b0933621cf8c39a63cedd4f9da2 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Mon, 5 Dec 2016 20:40:34 +0900 Subject: [PATCH] Strip shared libs if building CDs --- Makefile | 2 ++ util/make-cdrom.sh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c94a6482..b78318f2 100644 --- a/Makefile +++ b/Makefile @@ -230,6 +230,7 @@ define user-c-rule $1: $2 $(shell util/auto-dep.py --deps $2) $(LIBC) @${BEG} "CCSO" "$$<" @${CC} -o $$@ $(USER_CFLAGS) -shared -fPIC $$(shell util/auto-dep.py --cflags $$<) $$< $$(shell util/auto-dep.py --libs $$<) -lc ${ERRORS} + @if [ "$(STRIP_LIBS)" -eq "1" ]; then i686-pc-toaru-strip $$@; fi @${END} "CCSO" "$$<" endef $(foreach file,$(USER_LIBFILES),$(eval $(call user-c-rule,$(patsubst %.c,hdd/usr/lib/libtoaru-%.so,$(notdir ${file})),${file}))) @@ -279,6 +280,7 @@ define basic-so-wrapper hdd/usr/lib/lib$(1).so: ${TOOLCHAIN}/lib/lib$(1).a @${BEG} "SO" "$$@" @${CC} -shared -Wl,-soname,lib$(1).so -o hdd/usr/lib/lib$(1).so -Lhdd/usr/lib -Wl,--whole-archive ${TOOLCHAIN}/lib/lib$(1).a -Wl,--no-whole-archive $2 + @if [ "$(STRIP_LIBS)" -eq "1" ]; then i686-pc-toaru-strip $$@; fi @${END} "SO" "$$@" endef diff --git a/util/make-cdrom.sh b/util/make-cdrom.sh index ec4cc715..97defc38 100755 --- a/util/make-cdrom.sh +++ b/util/make-cdrom.sh @@ -26,7 +26,7 @@ BLACKLIST="userspace/tests/* hdd/usr/share/wallpapers/{grandcanyon,paris,southba echo "Rebuilding... (ignore warnings about time skew, this is intentional)" eval rm $BLACKLIST touch -d tomorrow toaruos-disk.img -make +make STRIP_LIBS=1 i686-pc-toaru-strip hdd/bin/* echo "Cloning CD source directory..."