Browse Source

Add Makefile for libc++

It's limited to work only for our Raspberry Pi 3
for now.
csk 6 years ago
parent
commit
f1c8990f8d
2 changed files with 77 additions and 0 deletions
  1. 58 0
      package/libcxx/Makefile
  2. 19 0
      package/libcxx/files/cxxabi.h

+ 58 - 0
package/libcxx/Makefile

@@ -0,0 +1,58 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(ADK_TOPDIR)/rules.mk
+
+# always use tab spaces as separator, no spaces
+PKG_NAME:=		libcxx
+PKG_VERSION:=		32cdadb563e8be0dd38cdf2cb065fab9029e6ccb
+PKG_RELEASE:=		1
+PKG_DESCR:=		LLVM C++ standard library
+PKG_SECTION:=		base/libs
+PKG_BUILDDEP:=		cmake-host
+PKG_URL:=		https://llvm.org/
+PKG_SITES:=		git@github.com:AbletonAppDev/libcxx.git
+PKG_SYSTEM_DEPENDS:=	raspberry-pi3
+
+WRKBUILD=		$(WRKDIR)/build
+
+
+include $(ADK_TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBCXX,libcxx,$(PKG_VERSION)-$(PKG_RELEASE),$(PKG_DEPENDS),$(PKG_DESCR),$(PKG_SECTION)))
+
+CONFIG_STYLE:=		manual
+BUILD_STYLE:=		manual
+INSTALL_STYLE:=		manual
+
+# Flags are hard coded to match the Raspberry PI 3 system
+CMAKE_FLAGS+=		-DCMAKE_BUILD_TYPE=Release \
+			-DCMAKE_BUILD_WITH_INSTALL_RPATH=1 \
+			-DCMAKE_C_COMPILER=$(TARGET_CC_NO_CCACHE) \
+			-DCMAKE_CXX_COMPILER=$(TARGET_CXX_NO_CCACHE) \
+			-DCMAKE_C_FLAGS="$(TARGET_CFLAGS)" \
+			-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS)" \
+			-DCMAKE_SYSTEM_NAME=Linux \
+			-DCMAKE_SYSTEM_PROCESSOR=$(ADK_TARGET_ARCH) \
+			-DLLVM_DEFAULT_TARGET_TRIPLE=arm-openadk-linux-gnueabihf \
+			-DLLVM_TARGET_ARCH=ARM \
+			-DLLVM_TARGETS_TO_BUILD=ARM \
+			-DLIBCXX_CXX_ABI=libstdc++
+
+do-configure:
+	(cd ${WRKBUILD} && PATH='${HOST_PATH}' \
+	cmake -Wno-dev -DCMAKE_INSTALL_PREFIX:PATH=/usr ${CMAKE_FLAGS} ${WRKSRC})
+
+do-build:
+	(cd ${WRKBUILD} && make ${MAKE_FLAGS} cxx)
+
+do-install:
+	(cd ${WRKBUILD} && ${MAKE} install-cxx DESTDIR='${WRKINST}')
+	$(CP) ./files/cxxabi.h ${WRKINST}/usr/include/c++/v1/
+
+libcxx-install:
+	${INSTALL_DIR} ${IDIR_LIBCXX}/usr/lib
+	${CP} ${WRKINST}/usr/lib/libc++.so* ${IDIR_LIBCXX}/usr/lib
+
+# please remove ALL above comments, before commiting
+include $(ADK_TOPDIR)/mk/pkg-bottom.mk

+ 19 - 0
package/libcxx/files/cxxabi.h

@@ -0,0 +1,19 @@
+// libc++ is compiled with the abi of libstdc++ and doesn't come with a cxxabi.h
+// The symbols however are available and can be forwarded, as it's used by
+// googletest and boost.
+
+#ifdef __cplusplus
+namespace __cxxabiv1 {
+extern "C" {
+#endif
+
+char *__cxa_demangle(const char *, char *, size_t *, int *);
+
+#ifdef __cplusplus
+}
+} // namespace __cxxabiv1
+#endif
+
+namespace abi {
+using __cxxabiv1::__cxa_demangle;
+}