Skip to content

Commit

Permalink
elf.cc: if Boost libraries aren't visible to applications, don't repo…
Browse files Browse the repository at this point in the history
…rt them

We have in elf.cc a list of libraries which are already fully included
inside the OSv kernel, so the user doesn't need to load another copy of
them. We have one Boost library in this list, but starting with Boost
version 1.69.0, Boost is compiled with hidden visibility - meaning that
the symbols in this library are *not* available to the application.
So if Boost is 1.69.0 or later, we shouldn't claim that the kernel contains
this library.

Refs #1040.

Signed-off-by: Nadav Har'El <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
nyh authored and wkozaczuk committed Oct 4, 2019
1 parent 58fe5f2 commit 5836333
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/elf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <osv/stubbing.hh>
#include <sys/utsname.h>
#include <osv/demangle.hh>
#include <boost/version.hpp>

#include "arch.hh"

Expand Down Expand Up @@ -1153,11 +1154,19 @@ program::program(void* addr)
"libm.so.6",
#ifdef __x86_64__
"ld-linux-x86-64.so.2",
// As noted in issue #1040 Boost version 1.69.0 and above is
// compiled with hidden visibility, so even if the kernel uses
// this library, it will not be visible for the application and
// it will need to load its own version of this library.
#if BOOST_VERSION < 106900
"libboost_system.so.1.55.0",
#endif
#endif /* __x86_64__ */
#ifdef __aarch64__
"ld-linux-aarch64.so.1",
#if BOOST_VERSION < 106900
"libboost_system-mt.so.1.55.0",
#endif
#endif /* __aarch64__ */
"libpthread.so.0",
"libdl.so.2",
Expand Down

0 comments on commit 5836333

Please sign in to comment.