CFLAGS += -Wall -Werror -Wextra\r
CXXFLAGS += -Wall -Werror -Wextra\r
ASFLAGS +=\r
-LDFLAGS += -Map map.txt -lc\r
+LDFLAGS += -nostdlib\r
+PRELINK := $(CRTI) $(CRTBEGINS) $(CRT0S)\r
+LIBS += -lc $(LIBGCC_PATH) $(CRTENDS) $(CRTN)\r
+USE_CXX_LINK := yes\r
\r
OBJ = misc.o new.o guard.o cxxabi.o typeinfo.o\r
+OBJ += string.o mutex.o\r
+OBJ += exceptions.o exception_handling.o system_error.o\r
+OBJ += gxx_personality.o\r
+ifeq ($(ARCHDIR),native)\r
+# - Include libgcc_eh (separate in linux), and the linux libc (space avoids hack in Makefile.tpl)\r
+LIBS += -lgcc_eh -l c\r
+endif\r
DEPFILES := $(OBJ:%.o=%.d)\r
BIN = libc++.so\r
ifeq ($(ARCHDIR),native)\r
- OBJ := $(filter-out heap.o,$(OBJ))\r
BIN = libc++_acess.so\r
endif\r
\r