summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/Makefile
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-29 10:26:25 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-29 10:26:25 +0000
commite454093a142e48d242eb9faf960fd2d5621677e7 (patch)
tree405db17dee47e19dfeca2c57fbedc1939624ece1 /libc/sysdeps/linux/common/Makefile
parent1e78eb0bd44caf57a234c49ff9b5193a977b6ad3 (diff)
Create stub crti.o and crtn.o files when UCLIBC_CTOR_DTOR is disabled
-Erik
Diffstat (limited to 'libc/sysdeps/linux/common/Makefile')
-rw-r--r--libc/sysdeps/linux/common/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/libc/sysdeps/linux/common/Makefile b/libc/sysdeps/linux/common/Makefile
index 513625f1d..495754622 100644
--- a/libc/sysdeps/linux/common/Makefile
+++ b/libc/sysdeps/linux/common/Makefile
@@ -34,13 +34,11 @@ 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=$(XWARNINGS) $(OPTIMIZATION) $(XARCH_CFLAGS) $(CPU_CFLAGS) -fno-builtin
ifeq ($(strip $(DOPIC)),y)
SAFECFLAGS+=-fPIC
endif
-endif
OBJ=$(COBJS) $(MOBJ)
@@ -59,6 +57,7 @@ $(COBJS): %.o : %.c
$(CC) $(CFLAGS) -c $< -o $@
$(STRIPTOOL) -x -R .note -R .comment $*.o
+ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
initfini.S: initfini.c
$(CC) $(SAFECFLAGS) -I$(TOPDIR)include -c initfini.c -S -o initfini.S
@@ -78,6 +77,14 @@ crtn.o: crtn.S
$(TOPDIR)lib/crtn.o: crtn.o
mkdir -p $(TOPDIR)lib/
cp crtn.o $(TOPDIR)lib/
+else
+crti.o:
+ mkdir -p $(TOPDIR)lib/
+ $(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
+crtn.o:
+ mkdir -p $(TOPDIR)lib/
+ $(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
+endif
clean:
rm -f *.[oa] *~ core crt[in].* *.S