Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpiod.so is much too big #980

Closed
nyh opened this issue Jun 10, 2018 · 1 comment
Closed

cpiod.so is much too big #980

nyh opened this issue Jun 10, 2018 · 1 comment

Comments

@nyh
Copy link
Contributor

nyh commented Jun 10, 2018

The stripped cpiod.so is around 300KB. Currently, it appears twice in every image (inside the kernel as bootfs, and in the zfs disk image).
But cpiod is a fairly trivial program and should not be anywhere this large...

I suspect the problem is in the Boost libraries that we use... nm -D build/release.x64/tools/cpiod/cpiod.so shows almost a thousand ridiculously long symbol names for boost asio and program_options, date manipulation, streams and other stuff we don't really need because... well... cpiod is such a trivial program. We could have done it easily with standard C++ code without the Boost stuff.

@geraldo-netto
Copy link
Contributor

Hello @nyh ,

Doing a quick check, we use the following headers from boost:
osv/tools/cpiod/cpiod.cc:
#include <boost/asio.hpp>
#include <boost/program_options.hpp>

osv/tools/cpiod/cpio.cc:
#include <boost/lexical_cast.hpp>
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/restrict.hpp>

Kind Regards,
Geraldo Netto

wkozaczuk added a commit to wkozaczuk/osv that referenced this issue Oct 3, 2019
@nyh nyh closed this as completed in 1dbb579 Oct 3, 2019
wkozaczuk pushed a commit to wkozaczuk/osv that referenced this issue Oct 3, 2019
libboost_program_options caused us a various problems such as
differences in visibility between versions (issue cloudius-systems#1040),
significant code size (issue cloudius-systems#980) and others, so in the
previous patches we removed all its uses in OSv and its
small utility applications (like cpiod and httpserver).
Now that it's no longer used, we can stop compiling it into
the kernel, or pretending (in elf.cc) that it is included
in the kernel.

Signed-off-by: Nadav Har'El <[email protected]>
Message-Id: <[email protected]>
wkozaczuk pushed a commit that referenced this issue Oct 4, 2019
libboost_program_options caused us a various problems such as
differences in visibility between versions (issue #1040),
significant code size (issue #980) and others, so in the
previous patches we removed all its uses in OSv and its
small utility applications (like cpiod and httpserver).
Now that it's no longer used, we can stop compiling it into
the kernel, or pretending (in elf.cc) that it is included
in the kernel.

Signed-off-by: Nadav Har'El <[email protected]>
Message-Id: <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants