From ae35d725cf586347b2adb1a6fe4216e70fce16cf Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 27 Nov 2002 23:34:07 +0000 Subject: Make support for global constructors and global destructors be configurable, so people who do not need or want ctor/dtor support can disable it and make their binaries a little bit smaller. -Erik --- libc/Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libc/Makefile') diff --git a/libc/Makefile b/libc/Makefile index 595f69e4a..4a5110f0e 100644 --- a/libc/Makefile +++ b/libc/Makefile @@ -30,6 +30,12 @@ TOPDIR=../ include $(TOPDIR)Rules.mak +ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y) +CRTOBJS="../../lib/crti.o ../../lib/crt0.o ../../lib/crtn.o" +else +CRTOBJS="../../lib/crt0.o" +endif + DIRS = misc pwd_grp stdio string termios inet signal stdlib sysdeps unistd # Check if the target architecture has a version script for @@ -49,7 +55,8 @@ shared: $(TOPDIR)lib/$(LIBNAME) @rm -rf tmp @mkdir tmp $(AR) rv ./tmp/libgcc-need.a - @(cd tmp && CC=$(CC) LD=$(LD) LDFLAGS=$(CPU_LDFLAGS-y) NM=$(NM) AR=$(AR) LIBGCC=$(LIBGCC) \ + @(cd tmp && CC=$(CC) LD=$(LD) LDFLAGS=$(CPU_LDFLAGS-y) NM=$(NM) AR=$(AR) \ + LIBGCC=$(LIBGCC) CRTOBJS=$(CRTOBJS) \ /bin/sh $(TOPDIR)../extra/scripts/get-needed-libgcc-objects.sh) $(LD) $(LDFLAGS) $(VERSION_SCRIPT) -soname=$(SHARED_MAJORNAME) -o $(SHARED_FULLNAME) \ --whole-archive ./tmp/libgcc-need.a $(LIBNAME) --no-whole-archive \ -- cgit v1.2.3