summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-20 00:03:55 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-20 00:03:55 +0000
commit430e386b9e69bf3a71c0e2cc06b7094d53ab6501 (patch)
tree0b17aafc4019eb779c9ed96bcf063c676a6b0a16 /libc/sysdeps/linux
parent9b7d191055ade5069c6325fa857e007b4c658b14 (diff)
Strip all object files of all non global symbols and .note and
.comment, saving a lot of space in the resultant binaries... -Erik
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/common/Makefile4
-rw-r--r--libc/sysdeps/linux/i386/Makefile17
2 files changed, 17 insertions, 4 deletions
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index 6ab1ff90b..06f4651b9 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -37,7 +37,9 @@ $(LIBC): ar-target
ar-target: $(OBJ)
$(AR) $(ARFLAGS) $(LIBC) $(OBJ)
-$(OBJ): Makefile
+$(COBJS):
+ $(CC) $(CFLAGS) $< -c $*.c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
clean:
rm -f *.[oa] *~ core
diff --git a/libc/sysdeps/linux/i386/Makefile b/libc/sysdeps/linux/i386/Makefile
index 695450961..4ec84b3be 100644
--- a/libc/sysdeps/linux/i386/Makefile
+++ b/libc/sysdeps/linux/i386/Makefile
@@ -31,9 +31,13 @@ ASMOBJS=$(shell ./list_syscalls.sh)
SSRC=_start.S setjmp.S longjmp.S #fork.S #clone.S
SOBJS=$(patsubst %.S,%.o, $(SSRC))
+MSRC=syscalls.c
+MOBJ=read.o write.o __open.o close.o
+
CSRC=readdir.c #select.c
COBJS=$(patsubst %.c,%.o, $(CSRC))
-OBJS=$(SOBJS) $(ASMOBJS) $(COBJS)
+
+OBJS=$(SOBJS) $(ASMOBJS) $(COBJS) $(MOBJ)
all: $(OBJS) $(LIBC)
@@ -45,12 +49,19 @@ ar-target: $(OBJS)
$(ASMOBJS): $(ASMSRC)
$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
$(SOBJS): $(SSRC)
+ $(CC) $(CFLAGS) $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
-$(COBJS): $(CSRC)
+$(MOBJ): $(MSRC)
+ $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
-$(OBJS): Makefile
+$(COBJS):
+ $(CC) $(CFLAGS) $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
clean:
rm -f *.[oa] *~ core