libcxx/libstdc++: Add libsupc++.defs to support libsupc++

This patch adds support for building libsupc++ (the C++ runtime
support library from GCC's libstdc++-v3).

libsupc++ provides core C++ runtime support including:
- Exception handling (eh_*.cc)
- RTTI (Run-Time Type Information)
- Memory allocation operators (new/delete)
- Type info support

The implementation includes:
- libsupc++.defs for libsupc++ build integration
- support make and cmake build
- Use gthr.h, gthr-posix.h and unwind-pe.h from libgcc
- LIBSTDCXX_VERSION config option with default 14.2.0

Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
This commit is contained in:
cuiziwei
2026-01-20 12:10:57 +08:00
committed by Xiang Xiao
parent e47a0dd228
commit f17b82bd65
6 changed files with 2588 additions and 6 deletions
+8 -6
View File
@@ -45,17 +45,19 @@ ifeq ($(CONFIG_LIBCXXABI),y)
include libcxxabi/Make.defs
else ifeq ($(CONFIG_LIBMINIABI),y)
include libminiabi/Make.defs
else ifeq ($(CONFIG_LIBSUPCXX),y)
include libstdc++/libsupc++.defs
endif
# Object Files
AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))
CXXOBJS = $(CXXSRCS:.cxx=$(OBJEXT))
CPPOBJS = $(CPPSRCS:.cpp=$(OBJEXT))
AOBJS += $(ASRCS:.S=$(OBJEXT))
COBJS += $(CSRCS:.c=$(OBJEXT))
CXXOBJS += $(CXXSRCS:.cxx=$(OBJEXT))
CPPOBJS += $(CPPSRCS:.cpp=$(OBJEXT))
SRCS = $(ASRCS) $(CSRCS) $(CXXSRCS) $(CPPSRCS)
OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) $(CPPOBJS)
SRCS += $(ASRCS) $(CSRCS) $(CXXSRCS) $(CPPSRCS)
OBJS += $(AOBJS) $(COBJS) $(CXXOBJS) $(CPPOBJS)
BIN = libxx$(LIBEXT)