From: whitequark Date: Sun, 26 Jul 2015 09:49:02 +0000 (+0300) Subject: Add a stub C++ standard library. X-Git-Tag: 24jan2021_ls180~2186 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7a9975ab5ae44af0c528a5697da75f03c246ea21;p=litex.git Add a stub C++ standard library. This is necessary to build libunwind. --- diff --git a/software/common.mak b/software/common.mak index 925fafe3..b345bee3 100644 --- a/software/common.mak +++ b/software/common.mak @@ -42,7 +42,7 @@ endif INCLUDES = -I$(MSCDIR)/software/include/base -I$(MSCDIR)/software/include -I$(MSCDIR)/common COMMONFLAGS = -Os $(CPUFLAGS) -Wall -fno-builtin -nostdinc -DMSC_GIT_ID=$(MSC_GIT_ID) $(INCLUDES) CFLAGS = $(COMMONFLAGS) -fexceptions -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -CXXFLAGS = $(COMMONFLAGS) -fexceptions -fno-rtti -ffreestanding +CXXFLAGS = $(COMMONFLAGS) -std=c++11 -I$(MSCDIR)/software/include/basec++ -fexceptions -fno-rtti -ffreestanding LDFLAGS = -nostdlib -nodefaultlibs -L$(MSCDIR)/software/include # compile and generate dependencies, based on diff --git a/software/include/basec++/algorithm b/software/include/basec++/algorithm new file mode 100644 index 00000000..cb9b6142 --- /dev/null +++ b/software/include/basec++/algorithm @@ -0,0 +1,4 @@ +#ifndef __CXX_ALGORITHM +#define __CXX_ALGORITHM + +#endif /* __CXX_ALGORITHM */ diff --git a/software/include/basec++/cstddef b/software/include/basec++/cstddef new file mode 100644 index 00000000..5291f1b6 --- /dev/null +++ b/software/include/basec++/cstddef @@ -0,0 +1,11 @@ +#ifndef __CXX_CSTDDEF +#define __CXX_CSTDDEF + +#include + +namespace std { + using ::size_t; + using ::ptrdiff_t; +} + +#endif /* __CXX_CSTDDEF */ diff --git a/software/include/basec++/cstdlib b/software/include/basec++/cstdlib new file mode 100644 index 00000000..6501ea9f --- /dev/null +++ b/software/include/basec++/cstdlib @@ -0,0 +1,6 @@ +#ifndef __CXX_CSTDLIB +#define __CXX_CSTDLIB + +#include + +#endif /* __CXX_CSTDLIB */ diff --git a/software/include/basec++/memory b/software/include/basec++/memory new file mode 100644 index 00000000..899bb3d4 --- /dev/null +++ b/software/include/basec++/memory @@ -0,0 +1,4 @@ +#ifndef __CXX_MEMORY +#define __CXX_MEMORY + +#endif /* __CXX_MEMORY */ diff --git a/software/include/basec++/new b/software/include/basec++/new new file mode 100644 index 00000000..aa2f1a8d --- /dev/null +++ b/software/include/basec++/new @@ -0,0 +1,9 @@ +#ifndef __CXX_NEW +#define __CXX_NEW + +#include + +inline void* operator new (std::size_t size, void* ptr) noexcept + { return ptr; } + +#endif /* __CXX_NEW */ diff --git a/software/include/basec++/tuple b/software/include/basec++/tuple new file mode 100644 index 00000000..c97a8a11 --- /dev/null +++ b/software/include/basec++/tuple @@ -0,0 +1,4 @@ +#ifndef __CXX_TUPLE +#define __CXX_TUPLE + +#endif /* __CXX_TUPLE */ diff --git a/software/include/basec++/vector b/software/include/basec++/vector new file mode 100644 index 00000000..ec284411 --- /dev/null +++ b/software/include/basec++/vector @@ -0,0 +1,4 @@ +#ifndef __CXX_VECTOR +#define __CXX_VECTOR + +#endif /* __CXX_VECTOR */