summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/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/sysdeps/linux/common/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/sysdeps/linux/common/Makefile')
-rw-r--r--libc/sysdeps/linux/common/Makefile15
1 files changed, 9 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index f66c09f31..8e0ed9485 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -24,11 +24,6 @@
TOPDIR=../../../../
include $(TOPDIR)Rules.mak
-SAFECFLAGS=$(WARNINGS) $(CPU_CFLAGS-y) $(OPTIMIZATION) -fno-builtin
-ifeq ($(strip $(DOPIC)),y)
-SAFECFLAGS+=-fPIC
-endif
-
CSRC= waitpid.c getdnnm.c gethstnm.c getcwd.c \
mkfifo.c setegid.c wait.c getpagesize.c seteuid.c \
wait3.c setpgrp.c getdtablesize.c create_module.c ptrace.c \
@@ -44,13 +39,21 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
MSRC=syscalls.c
MOBJ=$(shell ./list_syscalls.sh)
+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
+CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+SAFECFLAGS=$(WARNINGS) $(CPU_CFLAGS-y) $(OPTIMIZATION) -fno-builtin
+ifeq ($(strip $(DOPIC)),y)
+SAFECFLAGS+=-fPIC
+endif
+endif
+
OBJ=$(COBJS) $(MOBJ)
all: $(STR_SYSCALLS) $(OBJ) $(LIBC)
$(LIBC): ar-target
-ar-target: $(OBJ) $(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+ar-target: $(OBJ) $(CTOR_TARGETS)
$(AR) $(ARFLAGS) $(LIBC) $(OBJ)
(cd $(TOPDIR)lib/; ln -fs crt0.o crt1.o)