[OpenWrt-Devel] [PATCH] libcxx: fix compilation with platforms needing lssp

Rosen Penev rosenp at gmail.com
Mon Feb 24 19:14:04 EST 2020


Currently this is an issue with powerpc and i386 platforms.

Added extra cxxabi header

It's used by cxxabi.h. Issue discovered when trying to build i2pd.

Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/libcxx/Makefile                 |  2 +-
 package/libs/libcxx/patches/030-cxxabi.patch | 11 +++++++++++
 package/libs/libcxx/patches/040-ssp.patch    | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 package/libs/libcxx/patches/030-cxxabi.patch
 create mode 100644 package/libs/libcxx/patches/040-ssp.patch

diff --git a/package/libs/libcxx/Makefile b/package/libs/libcxx/Makefile
index 8343cbb427..51a49e4e9d 100644
--- a/package/libs/libcxx/Makefile
+++ b/package/libs/libcxx/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcxx
 PKG_VERSION:=9.0.1
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.llvm.org/git/libcxx
diff --git a/package/libs/libcxx/patches/030-cxxabi.patch b/package/libs/libcxx/patches/030-cxxabi.patch
new file mode 100644
index 0000000000..c70400f0c0
--- /dev/null
+++ b/package/libs/libcxx/patches/030-cxxabi.patch
@@ -0,0 +1,11 @@
+--- a/cmake/Modules/HandleLibCXXABI.cmake
++++ b/cmake/Modules/HandleLibCXXABI.cmake
+@@ -84,7 +84,7 @@ if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++" OR
+     "${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libsupc++")
+   set(_LIBSUPCXX_INCLUDE_FILES
+     cxxabi.h bits/c++config.h bits/os_defines.h bits/cpu_defines.h
+-    bits/cxxabi_tweaks.h bits/cxxabi_forced.h
++    bits/cxxabi_tweaks.h bits/cxxabi_forced.h bits/cxxabi_init_exception.h
+     )
+   if ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libstdc++")
+     set(_LIBSUPCXX_DEFINES "-DLIBSTDCXX")
diff --git a/package/libs/libcxx/patches/040-ssp.patch b/package/libs/libcxx/patches/040-ssp.patch
new file mode 100644
index 0000000000..f4f780d33a
--- /dev/null
+++ b/package/libs/libcxx/patches/040-ssp.patch
@@ -0,0 +1,11 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -175,6 +175,8 @@ function(cxx_link_system_libraries target)
+     target_link_libraries(${target} PUBLIC atomic)
+   endif()
+ 
++  target_link_libraries(${target} PUBLIC ssp_nonshared)
++
+   if (MINGW)
+     target_link_libraries(${target} PUBLIC "${MINGW_LIBRARIES}")
+   endif()
-- 
2.24.1


_______________________________________________
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