summaryrefslogtreecommitdiff
path: root/libc/stdlib/Makefile
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-09-26 17:31:47 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-09-26 17:31:47 +0000
commit9ddd9870a8be521ba9153efad60715149a320f65 (patch)
tree6014258b1ec2071b91d9dbc92e7d82016320e1e0 /libc/stdlib/Makefile
parent9d36ab8993de4cb950f05d038ae645fc8963d5c9 (diff)
Add __cxa_atexit and __cxa_finalize, thanks to Stephen Warren. This patch breaks compatibility with existing binaries, unless the new COMPAT_ATEXIT option is enabled.
Diffstat (limited to 'libc/stdlib/Makefile')
-rw-r--r--libc/stdlib/Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/libc/stdlib/Makefile b/libc/stdlib/Makefile
index 210a2eeba..49d739703 100644
--- a/libc/stdlib/Makefile
+++ b/libc/stdlib/Makefile
@@ -79,7 +79,10 @@ endif
# wcstod wcstof wcstold
MSRC2 = atexit.c
-MOBJ2 = atexit.o on_exit.o __exit_handler.o exit.o
+MOBJ2 = on_exit.o __cxa_atexit.o __cxa_finalize.o __exit_handler.o exit.o
+ifeq ($(COMPAT_ATEXIT),y)
+MOBJ2 += old_atexit.o
+endif
CSRC = \
abort.c getenv.c mkdtemp.c mktemp.c realpath.c mkstemp.c mkstemp64.c \
@@ -95,13 +98,20 @@ COBJS=$(patsubst %.c,%.o, $(CSRC))
OBJS=$(MOBJ) $(MOBJx) $(MOBJ1) $(MOBJ1x) $(MOBJ2) $(COBJS)
+NONSHARED_OBJS=atexit.o
+
OBJ_LIST=../obj.stdlib
-all: $(OBJ_LIST) subdirs
+NONSHARED_OBJ_LIST=../nonshared_obj.stdlib
+
+all: $(OBJ_LIST) $(NONSHARED_OBJ_LIST) subdirs
$(OBJ_LIST): $(OBJS)
echo $(patsubst %, stdlib/%, $(OBJS)) > $(OBJ_LIST)
+$(NONSHARED_OBJ_LIST): $(NONSHARED_OBJS)
+ echo $(patsubst %, stdlib/%, $(NONSHARED_OBJS)) > $(NONSHARED_OBJ_LIST)
+
$(MOBJ): $(MSRC)
$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o
@@ -118,7 +128,7 @@ $(MOBJ1x): $(MSRC1)
$(CC) $(CFLAGS) -DL_$* -D__UCLIBC_DO_XLOCALE $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o
-$(MOBJ2): $(MSRC2)
+$(MOBJ2) atexit.o: $(MSRC2)
$(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
$(STRIPTOOL) -x -R .note -R .comment $*.o