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/sysdeps/linux/common/Makefile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libc/sysdeps/linux/common') 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) -- cgit v1.2.3