[OpenWrt-Devel] [PATCH 1/2] libcxxabi: add
Rosen Penev
rosenp at gmail.com
Wed Jun 3 16:55:07 EDT 2020
On Wed, Jun 3, 2020 at 1:33 PM Ian Cooper <iancooper at hotmail.com> wrote:
>
Use Reply All to get this posted to the mailing list.
>
> I got your libcxx-abi compiled. I just put together a quick hack so I didn't have to create new package makefiles for llvm-project or worry too much about versions in the name of the libcxx source, so it's up to you to create the dependencies and make sure the sources are available in the right location at package build time.
>
> It needs the llvm-project source and location of the libcxx source and includes. The llvm-project source is a gigantic 2GB git repo.
That's a no go.
>
> $ du -h -d 1 .
> 2.0G ./llvm-project
>
> Adding the three lines at the bottom to the CMAKE_OPTIONS got it to compile.
>
> CMAKE_OPTIONS += \
> -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
> -DLIBCXXABI_ENABLE_PEDANTIC=OFF \
> -DLIBCXXABI_ENABLE_PIC=ON \
> -DLIBCXXABI_ENABLE_WERROR=OFF \
> -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
> -DLIBCXXABI_USE_COMPILER_RT=OFF \
> -DLIBCXXABI_ENABLE_THREADS=ON \
> -DLIBCXXABI_HAS_PTHREAD_API=ON \
> -DLIBCXXABI_INCLUDE_TESTS=OFF \
> -DLIBCXXABI_LIBDIR_SUFFIX="" \
> -DLIBCXXABI_INSTALL_LIBRARY=ON \
> -DLIBCXXABI_ENABLE_SHARED=OFF \
> -DLLVM_PATH=$(TOPDIR)/ian/llvm-project \
I don't think this is needed.
> -DLIBCXXABI_LIBCXX_SRC_DIR=$(BUILD_DIR)/libcxx-10.0.0.src \
> -DLIBCXXABI_LIBCXX_INCLUDES=$(BUILD_DIR)/libcxx-10.0.0.src/include
This sounds like it can work. However, libcxx depends on libcxxabi. I
think the way to get around this is to make a junk HostBuild that
places the headers in staging_dir.
>
>
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org]
> > On Behalf Of Rosen Penev
> > Sent: 02 June 2020 23:54
> > To: openwrt-devel at lists.openwrt.org
> > Subject: [OpenWrt-Devel] [PATCH 1/2] libcxxabi: add
> >
> > This will be used for libcxx.
> >
> > Signed-off-by: Rosen Penev <rosenp at gmail.com>
> > ---
> > package/libs/libcxxabi/Makefile | 64
> > +++++++++++++++++++++++++++++++++
> > 1 file changed, 64 insertions(+)
> > create mode 100644 package/libs/libcxxabi/Makefile
> >
> > diff --git a/package/libs/libcxxabi/Makefile b/package/libs/libcxxabi/Makefile
> > new file mode 100644 index 0000000000..bde77c250a
> > --- /dev/null
> > +++ b/package/libs/libcxxabi/Makefile
> > @@ -0,0 +1,64 @@
> > +
> > +#
> > +# This is free software, licensed under the GNU General Public License v2.
> > +# See /LICENSE for more information.
> > +#
> > +
> > +include $(TOPDIR)/rules.mk
> > +
> > +PKG_NAME:=libcxxabi
> > +PKG_VERSION:=10.0.0
> > +PKG_RELEASE:=1
> > +
> > +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz
> > +PKG_SOURCE_URL:=https://github.com/llvm/llvm-
> > project/releases/download/
> > +llvmorg-$(PKG_VERSION)
> > +PKG_HASH:=e71bac75a88c9dde455ad3f2a2b449bf745eafd41d2d8432253b2
> > 964e0ca1
> > +4e1 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src
> > +
> > +PKG_MAINTAINER:=Rosen Penev <rosenp at gmail.com>
> > PKG_LICENSE:=MIT
> > +PKG_LICENSE_FILES:=LICENSE.txt
> > +
> > +PKG_BUILD_PARALLEL:=1
> > +CMAKE_BINARY_SUBDIR:=build
> > +
> > +include $(INCLUDE_DIR)/package.mk
> > +include $(INCLUDE_DIR)/cmake.mk
> > +
> > +define Package/libcxxabi
> > + SECTION:=libs
> > + CATEGORY:=Libraries
> > + TITLE:=LLVM lib++abi
> > + URL:=https://libcxxabi.llvm.org/
> > + DEPENDS:=+libpthread
> > + BUILDONLY:=1
> > +endef
> > +
> > +define Package/libcxxabi/description
> > + libc++abi is a new implementation of low level support for a standard C++
> > library.
> > +endef
> > +
> > +CMAKE_OPTIONS += \
> > + -DLIBCXXABI_ENABLE_EXCEPTIONS=ON \
> > + -DLIBCXXABI_ENABLE_PEDANTIC=OFF \
> > + -DLIBCXXABI_ENABLE_PIC=ON \
> > + -DLIBCXXABI_ENABLE_WERROR=OFF \
> > + -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \
> > + -DLIBCXXABI_USE_COMPILER_RT=OFF \
> > + -DLIBCXXABI_ENABLE_THREADS=ON \
> > + -DLIBCXXABI_HAS_PTHREAD_API=ON \
> > + -DLIBCXXABI_INCLUDE_TESTS=OFF \
> > + -DLIBCXXABI_LIBDIR_SUFFIX="" \
> > + -DLIBCXXABI_INSTALL_LIBRARY=ON \
> > + -DLIBCXXABI_ENABLE_SHARED=OFF
> > +
> > +TARGET_CXXFLAGS += -flto
> > +TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
> > +
> > +define Build/InstallDev
> > + $(call Build/InstallDev/cmake,$(1))
> > + $(INSTALL_DIR) $(1)/usr/include/
> > + $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/*.h $(1)/usr/include/
> > endef
> > +
> > +$(eval $(call BuildPackage,libcxxabi))
> > --
> > 2.26.2
> >
> >
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel at lists.openwrt.org
> > https://lists.openwrt.org/mailman/listinfo/openwrt-devel
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list