Skip to content

Commit 5836333

Browse files
nyhwkozaczuk
authored andcommitted
elf.cc: if Boost libraries aren't visible to applications, don't report 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]>
1 parent 58fe5f2 commit 5836333

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

core/elf.cc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <osv/stubbing.hh>
2727
#include <sys/utsname.h>
2828
#include <osv/demangle.hh>
29+
#include <boost/version.hpp>
2930

3031
#include "arch.hh"
3132

@@ -1153,11 +1154,19 @@ program::program(void* addr)
11531154
"libm.so.6",
11541155
#ifdef __x86_64__
11551156
"ld-linux-x86-64.so.2",
1157+
// As noted in issue #1040 Boost version 1.69.0 and above is
1158+
// compiled with hidden visibility, so even if the kernel uses
1159+
// this library, it will not be visible for the application and
1160+
// it will need to load its own version of this library.
1161+
#if BOOST_VERSION < 106900
11561162
"libboost_system.so.1.55.0",
1163+
#endif
11571164
#endif /* __x86_64__ */
11581165
#ifdef __aarch64__
11591166
"ld-linux-aarch64.so.1",
1167+
#if BOOST_VERSION < 106900
11601168
"libboost_system-mt.so.1.55.0",
1169+
#endif
11611170
#endif /* __aarch64__ */
11621171
"libpthread.so.0",
11631172
"libdl.so.2",

0 commit comments

Comments
 (0)