Skip to content

Commit 9963ad9

Browse files
committed
Fixes in symbol visibility
Don't hide symbols in dependencies built with --build-3rdparty, because it cases linker errors when using static library (libroc.a). Instead, use default visibility for all dependencies, and only hide their symbols when building shared library (libroc.so/libroc.dylib).
1 parent 029119e commit 9963ad9

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

scripts/scons_helpers/build-3rdparty.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,6 @@ def _getvar(var, default):
259259

260260
cc_flags = [
261261
'-fPIC', # -fPIC should be set explicitly in older cmake versions
262-
'-fvisibility=hidden', # hide private symbols
263-
'-fvisibility-inlines-hidden',
264262
]
265263

266264
if ctx.variant == 'debug':
@@ -1047,10 +1045,6 @@ def die(text, *args):
10471045
'libuv-v{ctx.pkg_ver}.tar.gz',
10481046
'libuv-v{ctx.pkg_ver}')
10491047
changedir(ctx, 'src/libuv-v{ctx.pkg_ver}')
1050-
subst_files(
1051-
ctx,
1052-
'include/uv.h',
1053-
from_='__attribute__((visibility("default")))', to='')
10541048
if ctx.prefer_cmake:
10551049
mkpath('build')
10561050
changedir(ctx, 'build')
@@ -1068,7 +1062,7 @@ def die(text, *args):
10681062
execute(ctx, './configure --host={host} {vars} {flags} {opts}'.format(
10691063
host=ctx.toolchain,
10701064
vars=format_vars(ctx),
1071-
flags=format_flags(ctx, cflags='-fvisibility=hidden'),
1065+
flags=format_flags(ctx),
10721066
opts=' '.join([
10731067
'--with-pic',
10741068
'--enable-static',
@@ -1226,7 +1220,7 @@ def die(text, *args):
12261220
host=ctx.toolchain,
12271221
vars=format_vars(ctx),
12281222
# explicitly enable -pthread because libtool doesn't add it on some platforms
1229-
flags=format_flags(ctx, cflags='-fPIC -fvisibility=hidden', pthread=True),
1223+
flags=format_flags(ctx, cflags='-fPIC', pthread=True),
12301224
opts=' '.join([
12311225
'--disable-external-libs',
12321226
'--disable-shared',
@@ -1249,7 +1243,7 @@ def die(text, *args):
12491243
execute(ctx, './configure --host={host} {vars} {flags} {opts}'.format(
12501244
host=ctx.toolchain,
12511245
vars=format_vars(ctx),
1252-
flags=format_flags(ctx, cflags='-fvisibility=hidden'),
1246+
flags=format_flags(ctx),
12531247
opts=' '.join([
12541248
'--disable-openmp',
12551249
'--disable-shared',
@@ -1435,7 +1429,7 @@ def die(text, *args):
14351429
])),
14361430
host=ctx.toolchain,
14371431
vars=format_vars(ctx),
1438-
flags=format_flags(ctx, cflags='-w -fPIC -fvisibility=hidden'),
1432+
flags=format_flags(ctx, cflags='-w -fPIC'),
14391433
opts=' '.join([
14401434
'--enable-static',
14411435
'--disable-shared',

0 commit comments

Comments
 (0)