summaryrefslogtreecommitdiff
path: root/libc/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-27 23:34:07 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-27 23:34:07 +0000
commitae35d725cf586347b2adb1a6fe4216e70fce16cf (patch)
tree9fcdb86297695c3324e386e483e85db53133b412 /libc/Makefile
parent44c91e654102116f99f80635c483db49126730e8 (diff)
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
Diffstat (limited to 'libc/Makefile')
-rw-r--r--libc/Makefile9
1 files changed, 8 insertions, 1 deletions
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 \