From f7d7a3a18b1f1d1fdcf5b05f4ab1af6b8fc2ce1e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 5 Dec 2020 01:21:05 -0800 Subject: [PATCH] libcxx[abi]: remove This is a neat project, but offers no benefit to OpenWrt. The initial reason for it was to be a replacement for libstdcpp as it is smaller and lacks compatibility for C++98. Unfortunately, compiling several packages with it results in larger ipk sizes. While not a member of the packages feed, this will be moved to packages-abandoned to keep it somewhere. Signed-off-by: Rosen Penev --- config/Config-build.in | 4 -- include/uclibc++.mk | 12 +--- package/libs/libcxx/Makefile | 66 ------------------ package/libs/libcxx/files/g++-libcxx | 19 ------ package/libs/libcxx/patches/010-ssp.patch | 13 ---- package/libs/libcxxabi/Makefile | 71 -------------------- package/libs/libcxxabi/patches/010-arm.patch | 27 -------- 7 files changed, 2 insertions(+), 210 deletions(-) delete mode 100644 package/libs/libcxx/Makefile delete mode 100755 package/libs/libcxx/files/g++-libcxx delete mode 100644 package/libs/libcxx/patches/010-ssp.patch delete mode 100644 package/libs/libcxxabi/Makefile delete mode 100644 package/libs/libcxxabi/patches/010-arm.patch diff --git a/config/Config-build.in b/config/Config-build.in index a54df11566..cfefa4eed3 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -215,10 +215,6 @@ menu "Global build settings" config USE_UCLIBCXX bool "uClibc++" - config USE_LIBCXX - bool "libc++" - depends on !USE_UCLIBC - config USE_LIBSTDCXX bool "libstdc++" endchoice diff --git a/include/uclibc++.mk b/include/uclibc++.mk index 27533279c9..a1a61f26d4 100644 --- a/include/uclibc++.mk +++ b/include/uclibc++.mk @@ -4,8 +4,8 @@ ifndef DUMP endif endif -PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX CONFIG_USE_LIBCXX -CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBCXX:libcxx +USE_LIBSTDCXX:libstdcpp +PKG_PREPARED_DEPENDS += CONFIG_USE_UCLIBCXX +CXX_DEPENDS = +USE_UCLIBCXX:uclibcxx +USE_LIBSTDCXX:libstdcpp ifneq ($(CONFIG_USE_UCLIBCXX),) ifneq ($(CONFIG_CCACHE),) @@ -14,11 +14,3 @@ ifneq ($(CONFIG_USE_UCLIBCXX),) TARGET_CXX=g++-uc endif endif - -ifneq ($(CONFIG_USE_LIBCXX),) - ifneq ($(CONFIG_CCACHE),) - TARGET_CXX_NOCACHE=g++-libcxx - else - TARGET_CXX=g++-libcxx - endif -endif diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile deleted file mode 100644 index 3809bea651..0000000000 --- a/package/libs/libcxx/Makefile +++ /dev/null @@ -1,66 +0,0 @@ - -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=libcxx -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:=270f8a3f176f1981b0f6ab8aa556720988872ec2b48ed3b605d0ced8d09156c7 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src - -PKG_MAINTAINER:=Rosen Penev -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=LICENSE.txt - -PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=libcxxabi -CMAKE_BINARY_SUBDIR:=build - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/libcxx - SECTION:=libs - CATEGORY:=Libraries - TITLE:=LLVM libstdc++ - URL:=https://libcxx.llvm.org/ - DEPENDS:=+libatomic +libpthread -endef - -define Package/libcxx/description - libc++ is an implementation of the C++ standard library, targeting C++11, C++14 and above. -endef - -CMAKE_OPTIONS += \ - -DLIBCXX_CXX_ABI="libcxxabi" \ - -DLIBCXX_ENABLE_ASSERTIONS=OFF \ - -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF \ - -DLIBCXX_INCLUDE_BENCHMARKS=OFF \ - -DLIBCXX_INCLUDE_DOCS=OFF \ - -DLIBCXX_INCLUDE_TESTS=OFF \ - -DLIBCXX_LIBDIR_SUFFIX="" \ - -DLIBCXX_STANDALONE_BUILD=ON \ - -DLIBCXX_HAS_MUSL_LIBC=$(if $(CONFIG_USE_MUSL),ON,OFF) - -TARGET_CXXFLAGS += -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -Wno-attributes -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed - -define Build/InstallDev - $(call Build/InstallDev/cmake,$(1)) - $(CP) files/g++-libcxx $(TOOLCHAIN_DIR)/bin/ - $(SED) 's,CXX,$(TARGET_CXX),g' $(TOOLCHAIN_DIR)/bin/g++-libcxx -endef - -define Package/libcxx/install - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libc++.so.* $(1)/usr/lib/ -endef - -$(eval $(call BuildPackage,libcxx)) diff --git a/package/libs/libcxx/files/g++-libcxx b/package/libs/libcxx/files/g++-libcxx deleted file mode 100755 index 88b3e7da01..0000000000 --- a/package/libs/libcxx/files/g++-libcxx +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -WRAPPER_INCLUDEDIR="-I$STAGING_DIR/usr/include/c++/v1" -WRAPPER_LIBDIR="-L$STAGING_DIR/usr/lib" -WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared" - -WRAPPER_OPTIONS="" -WRAPPER_INCLIB="Y" -for arg -do - case "$arg" in - -c|-E|-S) WRAPPER_INCLIB="N" ;; - -static) [ "$WRAPPER_LIBS" != "-lc -lgcc_s -lssp_nonshared -lgcc_eh" ] && WRAPPER_LIBS="-lc -lgcc_s -lssp_nonshared -lgcc_eh" ;; - esac -done -[ "$WRAPPER_INCLIB" = "Y" ] && WRAPPER_OPTIONS="-nodefaultlibs $WRAPPER_LIBDIR -lc++ -lc++abi $WRAPPER_LIBS" - -exec CXX -nostdinc++ -DGCC_HASCLASSVISIBILITY "$WRAPPER_INCLUDEDIR" "$@" $WRAPPER_OPTIONS - diff --git a/package/libs/libcxx/patches/010-ssp.patch b/package/libs/libcxx/patches/010-ssp.patch deleted file mode 100644 index f83c7b9b56..0000000000 --- a/package/libs/libcxx/patches/010-ssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -760,6 +760,10 @@ function(cxx_link_system_libraries targe - target_link_libraries(${target} PRIVATE atomic) - endif() - -+ if (LIBCXX_HAS_MUSL_LIBC) -+ target_link_libraries(${target} PRIVATE ssp_nonshared) -+ endif() -+ - if (MINGW) - target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}") - endif() diff --git a/package/libs/libcxxabi/Makefile b/package/libs/libcxxabi/Makefile deleted file mode 100644 index 90547561b2..0000000000 --- a/package/libs/libcxxabi/Makefile +++ /dev/null @@ -1,71 +0,0 @@ - -# -# 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:=e71bac75a88c9dde455ad3f2a2b449bf745eafd41d2d8432253b2964e0ca14e1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION).src - -PKG_MAINTAINER:=Rosen Penev -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 \ - -DLIBCXXABI_LIBCXX_SRC_DIR=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src \ - -DLIBCXXABI_LIBCXX_INCLUDES=$(BUILD_DIR)/libcxx-$(PKG_VERSION).src/include - -TARGET_CXXFLAGS += -flto -TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed - -define Build/Prepare - $(MAKE) -C $(TOPDIR)/package/libs/libcxx prepare - $(call Build/Prepare/Default) -endef - -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)) diff --git a/package/libs/libcxxabi/patches/010-arm.patch b/package/libs/libcxxabi/patches/010-arm.patch deleted file mode 100644 index b14609dc62..0000000000 --- a/package/libs/libcxxabi/patches/010-arm.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/src/cxa_exception.h -+++ b/src/cxa_exception.h -@@ -27,6 +27,13 @@ _LIBCXXABI_HIDDEN uint64_t __getExceptio - _LIBCXXABI_HIDDEN void __setExceptionClass ( _Unwind_Exception*, uint64_t); - _LIBCXXABI_HIDDEN bool __isOurExceptionClass(const _Unwind_Exception*); - -+#if defined(__arm__) && defined(__GNUC__) -+// missing values from _Unwind_Reason_Code enum -+#define _URC_FATAL_PHASE2_ERROR ((_Unwind_Reason_Code)2) -+#define _URC_FATAL_PHASE1_ERROR ((_Unwind_Reason_Code)3) -+#define _URC_NORMAL_STOP ((_Unwind_Reason_Code)4) -+#endif -+ - struct _LIBCXXABI_HIDDEN __cxa_exception { - #if defined(__LP64__) || defined(_WIN64) || defined(_LIBCXXABI_ARM_EHABI) - // Now _Unwind_Exception is marked with __attribute__((aligned)), ---- a/src/cxa_personality.cpp -+++ b/src/cxa_personality.cpp -@@ -1108,7 +1108,7 @@ __gxx_personality_v0(_Unwind_State state - - // Check the undocumented force unwinding behavior - bool is_force_unwinding = state & _US_FORCE_UNWIND; -- state &= ~_US_FORCE_UNWIND; -+ state = (_Unwind_State)(state & ~_US_FORCE_UNWIND); - - scan_results results; - switch (state) {