linkers: remove is_shared_module argument to get_soname_args

The argument is now unused, drop it.
pull/8996/head
Paolo Bonzini 3 years ago
parent d5535065bc
commit 3efed376c3
  1. 3
      mesonbuild/backend/ninjabackend.py
  2. 5
      mesonbuild/compilers/compilers.py
  3. 6
      mesonbuild/compilers/cuda.py
  4. 5
      mesonbuild/compilers/d.py
  5. 3
      mesonbuild/compilers/mixins/islinker.py
  6. 33
      mesonbuild/linkers/linkers.py

@ -2761,8 +2761,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485'''))
# Add -Wl,-soname arguments on Linux, -install_name on OS X
commands += linker.get_soname_args(
self.environment, target.prefix, target.name, target.suffix,
target.soversion, target.darwin_versions,
isinstance(target, build.SharedModule))
target.soversion, target.darwin_versions)
# This is only visited when building for Windows using either GCC or Visual Studio
if target.vs_module_defs and hasattr(linker, 'gen_vs_module_defs_args'):
commands += linker.gen_vs_module_defs_args(target.vs_module_defs.rel_to_builddir(self.build_to_src))

@ -988,11 +988,10 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str,
darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return self.linker.get_soname_args(
env, prefix, shlib_name, suffix, soversion,
darwin_versions, is_shared_module)
darwin_versions)
def get_target_link_args(self, target: 'BuildTarget') -> T.List[str]:
return target.link_args

@ -650,11 +650,9 @@ class CudaCompiler(Compiler):
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str,
darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return self._to_host_flags(self.host_compiler.get_soname_args(
env, prefix, shlib_name, suffix, soversion, darwin_versions,
is_shared_module), _Phase.LINKER)
env, prefix, shlib_name, suffix, soversion, darwin_versions), _Phase.LINKER)
def get_compile_only_args(self) -> T.List[str]:
return ['-c']

@ -468,10 +468,9 @@ class DmdLikeCompilerMixin(CompilerMixinBase):
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str,
darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
darwin_versions: T.Tuple[str, str]) -> T.List[str]:
sargs = super().get_soname_args(env, prefix, shlib_name, suffix,
soversion, darwin_versions, is_shared_module)
soversion, darwin_versions)
# LDC and DMD actually do use a linker, but they proxy all of that with
# their own arguments

@ -104,8 +104,7 @@ class BasicLinkerIsCompilerMixin(Compiler):
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str,
darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
darwin_versions: T.Tuple[str, str]) -> T.List[str]:
raise MesonException("This linker doesn't support soname args")
def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,

@ -517,8 +517,7 @@ class DynamicLinker(metaclass=abc.ABCMeta):
return ([], set())
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []
@ -613,8 +612,7 @@ class GnuLikeDynamicLinkerMixin:
return self._apply_prefix('--fatal-warnings')
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
m = env.machines[self.for_machine]
if m.is_windows() or m.is_cygwin():
# For PE/COFF the soname argument has no effect
@ -749,8 +747,7 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return self._apply_prefix('-fatal_warnings')
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
install_name = ['@rpath/', prefix, shlib_name]
if soversion is not None:
install_name.append('.' + soversion)
@ -836,8 +833,7 @@ class WASMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna
return ['-s', 'ERROR_ON_UNDEFINED_SYMBOLS=1']
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
raise MesonException(f'{self.id} does not support shared libraries.')
def get_asneeded_args(self) -> T.List[str]:
@ -879,8 +875,7 @@ class CcrxDynamicLinker(DynamicLinker):
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []
@ -919,8 +914,7 @@ class Xc16DynamicLinker(DynamicLinker):
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []
def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
@ -963,8 +957,7 @@ class CompCertDynamicLinker(DynamicLinker):
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
raise MesonException(f'{self.id} does not support shared libraries.')
def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
@ -1062,8 +1055,7 @@ class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []
def get_std_shared_lib_args(self) -> T.List[str]:
@ -1164,8 +1156,7 @@ class VisualStudioLikeLinkerMixin:
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []
def import_library_args(self, implibname: str) -> T.List[str]:
@ -1303,8 +1294,7 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return (self._apply_prefix(f'-rpath,{paths}'), rpath_dirs_to_remove)
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
sostr = '' if soversion is None else '.' + soversion
return self._apply_prefix(f'-soname,{prefix}{shlib_name}.{suffix}{sostr}')
@ -1420,6 +1410,5 @@ class CudaLinker(PosixDynamicLinkerMixin, DynamicLinker):
return []
def get_soname_args(self, env: 'Environment', prefix: str, shlib_name: str,
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str],
is_shared_module: bool) -> T.List[str]:
suffix: str, soversion: str, darwin_versions: T.Tuple[str, str]) -> T.List[str]:
return []

Loading…
Cancel
Save