Commit 254588c8 authored by Alex Samorukov's avatar Alex Samorukov Committed by Alex Samorukov
Browse files

Fix darwin/clang map

parent a29bd875
Pipeline #127440 passed with stage
in 2 minutes and 19 seconds
......@@ -4,6 +4,12 @@ subdir('base')
python = import('python').find_installation()
version_script = 'babl.map'
version_script_clang = 'babl.map.clang'
babl_gnu_sym_path = join_paths(meson.current_source_dir(), 'test-gnu.map')
babl_clang_sym_path = join_paths(meson.current_source_dir(), 'test-clang.map')
export_symbols = join_paths(meson.source_root(), 'export-symbols')
version_script_target = custom_target(version_script,
input : [ export_symbols, ] ,
......@@ -24,9 +30,14 @@ babl_c_args = [
]
# Linker arguments
babl_link_args = [
'-Wl,--version-script,' + version_script,
]
if cc.links('', name: '-Wl,--version-script', args: ['-shared', '-Wl,--version-script=' + babl_gnu_sym_path])
babl_link_args = ['-Wl,--version-script,' + version_script]
elif host_machine.system() == 'darwin' and cc.has_multi_link_arguments('-Wl,-exported_symbols_list', babl_clang_sym_path)
# Clang on Darwin
babl_link_args = ['-Wl,-exported_symbols_list',version_script_clang]
else
error('Linker doesn\'t support --version-script or -exported_symbols_list')
endif
if platform_win32
babl_link_args += '-Wl,--no-undefined'
endif
......
{
global:
babl_*;
local:
*;
};
......@@ -2,6 +2,7 @@ import sys
export_symbols=sys.argv[1]
version_file=sys.argv[2]
version_file_clang=sys.argv[2] + ".clang"
with open(export_symbols, 'r') as syms, \
open(version_file, 'w') as version:
......@@ -9,3 +10,8 @@ with open(export_symbols, 'r') as syms, \
for sym in syms:
version.write(" {};\n".format(sym.strip()))
version.write(" local:\n *;\n};\n")
with open(export_symbols, 'r') as syms, \
open(version_file_clang, 'w') as version:
for sym in syms:
version.write("_{}\n".format(sym.strip()))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment