From 9ddd9870a8be521ba9153efad60715149a320f65 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Mon, 26 Sep 2005 17:31:47 +0000 Subject: 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. --- libc/stdlib/Makefile | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libc/stdlib/Makefile') 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 -- cgit v1.2.3