c++freebsdlibstdc++openbsd

libstdc++ system libraries not stripped on OpenBSD and FreeBSD


I am doing some research whether to compile C++ libraries static or dynamic for a new project. (I have read this answer, also). I saw that on OpenBSD and FreeBSD the system libraries are a lot bigger (5-7 MB) than on Linux (1.5 MB) because they are not stripped. So I have 2 questions:

  1. The OpenBSD libestdc++.so is any different than libstdc++.so? I didn't find any info on it, google just corrects me, removing the "e" letter from the word.
  2. Why these libraries are so big on BSD? If I would like to deploy or statically link them they will be huge. Is there a workaround for this?

Thank you.


Solution

  • On OpenBSD, libstdc++ is the base c++ library (GCC 4.2), libestdc++ is installed from ports (GCC 4.9 or 6). The libraries are installed with symbols on OpenBSD, you can strip the symbols with strip -s libwhatever.so.