diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index ccc197f2fbe9..d22a3f15325d 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -1156,6 +1156,10 @@ def get_linker_always_args(self): return basic + ['-Wl,-headerpad_max_install_names'] return basic + def get_symbol_export_file_args(self, path): + if self.compiler_type.is_osx_compiler: + return ['-Wl,-exported_symbols_list', path] + return ['-Wl,--version-script=' + path] class ArmclangCCompiler(ArmclangCompiler, CCompiler): def __init__(self, exelist, version, compiler_type, is_cross, exe_wrapper=None, **kwargs): diff --git a/test cases/common/211 version file/bob-clang.map b/test cases/common/211 version file/bob-clang.map new file mode 100644 index 000000000000..b9dfb800ab4e --- /dev/null +++ b/test cases/common/211 version file/bob-clang.map @@ -0,0 +1 @@ +_bobMcBob diff --git a/test cases/common/211 version file/bob-clang.map.in b/test cases/common/211 version file/bob-clang.map.in new file mode 100644 index 000000000000..47a3d1d60b3d --- /dev/null +++ b/test cases/common/211 version file/bob-clang.map.in @@ -0,0 +1 @@ +_@in@ diff --git a/test cases/common/211 version file/meson.build b/test cases/common/211 version file/meson.build index 7986034536cb..26d2a6a2c9b7 100644 --- a/test cases/common/211 version file/meson.build +++ b/test cases/common/211 version file/meson.build @@ -6,7 +6,7 @@ cc = meson.get_compiler('c') if cc.get_id() == 'msvc' suffix = '.sym' else - suffix = '.map' + suffix = host_machine.system() == 'darwin' ? '-clang.map' : '.map' endif mapfile = 'bob' + suffix diff --git a/test cases/common/211 version file/sub/foo-clang.map b/test cases/common/211 version file/sub/foo-clang.map new file mode 100644 index 000000000000..b9dfb800ab4e --- /dev/null +++ b/test cases/common/211 version file/sub/foo-clang.map @@ -0,0 +1 @@ +_bobMcBob