Open afbjorklund opened 1 year ago
Adding C++ adds some 20M to the sdk, which is OK (+30%) But libstdc++.so adds 1.5 M to base OS, which is not (+150%)
Solution is to delete it from the sysroot, and only .a in toolchain. Make a separate tarball, with the removed files - for a new layer.
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.a
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++fs.a
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++fs.la*
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.la*
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.so@
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.so.6@
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.so.6.0.28*
./output/host/x86_64-buildroot-linux-uclibc/lib64/libstdc++.so.6.0.28-gdb.py
./output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libstdc++.a
./output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libstdc++.so@
./output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libstdc++.so.6@
./output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libstdc++.so.6.0.28*
./output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/lib/libstdc++.so.6.0.28-gdb.py
./output/target/usr/lib/libstdc++.so@
./output/target/usr/lib/libstdc++.so.6@
./output/target/usr/lib/libstdc++.so.6.0.28*
./output/target/usr/lib/libstdc++.so.6.0.28-gdb.py
BR2_INSTALL_LIBSTDCPP=y
# BR2_TOOLCHAIN_BUILDROOT_CXX is not set
The main concern about enabling C++ support, is that it will also install the standard library (libstdc++.so).
This will increase (double) the size of the rootfs, but it is possible to delete it and only use static libstdc++.a