aboutsummaryrefslogtreecommitdiffstats
path: root/package/libs/libcxx/files/g++-libcxx
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2019-12-13 21:07:04 -0800
committerHauke Mehrtens <hauke@hauke-m.de>2019-12-23 00:22:07 +0100
commit856ea2bad3b3eac565215c0ac79f37a4ba4cd5b7 (patch)
tree04e6563e9656f70225650876f95238b9554df856 /package/libs/libcxx/files/g++-libcxx
parentfd211e1677fc653feeef6b0b8b8e8659ac274b3c (diff)
downloadupstream-856ea2bad3b3eac565215c0ac79f37a4ba4cd5b7.tar.gz
upstream-856ea2bad3b3eac565215c0ac79f37a4ba4cd5b7.tar.bz2
upstream-856ea2bad3b3eac565215c0ac79f37a4ba4cd5b7.zip
libcxx: Add package
Currently in OpenWrt, there are two libc++: libstdcpp and uClibc++. The former is huge and the latter supports only C++98 with some basic support for C++11. Those C++ versions seem to be specific to the compiler version libcxx supports C++11 and above while being much smaller than libstdcpp. On mt7621, these are the sizes of the ipks that I get: libstdcpp: 460786 libcxx: 182881 uClibc++:67720 libcxx is faster than uClibc++ and is under active development as part of the LLVM project while uClibc++ is effectively dead. This PR modifies uclibc++.mk to expose the make menuconfig option. Further cleanup is beyond the scope of this PR. What that means is, this is not used by default. A g++-libcxx wrapper based on the uClibc++ one was added. Works the same way. Compile tested with all packages that use uclibc++.mk in their Makefiles under mipsel_24kc. kismet fails compilation but that package needs to be cleaned up and updated. Runtime tested with gddrescue, gdisk, dcwapd, bonnie++, and aircrack-ng on a TP-Link Archer C7v2. Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'package/libs/libcxx/files/g++-libcxx')
-rwxr-xr-xpackage/libs/libcxx/files/g++-libcxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/package/libs/libcxx/files/g++-libcxx b/package/libs/libcxx/files/g++-libcxx
new file mode 100755
index 0000000000..81ca46eb0e
--- /dev/null
+++ b/package/libs/libcxx/files/g++-libcxx
@@ -0,0 +1,19 @@
+#!/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++ -lsupc++ $WRAPPER_LIBS"
+
+exec CXX -fno-builtin -nostdinc++ -DGCC_HASCLASSVISIBILITY "$WRAPPER_INCLUDEDIR" "$@" $WRAPPER_OPTIONS
+