diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 4ab4dc661..417e0e94a 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -360,7 +360,7 @@ def get_base_link_args(options, linker, is_shared_module): args.append('-Wl,-bitcode_bundle') elif as_needed: # -Wl,-dead_strip_dylibs is incompatible with bitcode - args.append(linker.get_asneeded_args()) + args.extend(linker.get_asneeded_args()) try: crt_val = options['b_vscrt'].value buildtype = options['buildtype'].value diff --git a/mesonbuild/compilers/mixins/gnu.py b/mesonbuild/compilers/mixins/gnu.py index c5750450e..56473390b 100644 --- a/mesonbuild/compilers/mixins/gnu.py +++ b/mesonbuild/compilers/mixins/gnu.py @@ -188,15 +188,15 @@ class GnuLikeCompiler(metaclass=abc.ABCMeta): # All GCC-like backends can do assembly self.can_compile_suffixes.add('s') - def get_asneeded_args(self) -> str: + def get_asneeded_args(self) -> typing.List[str]: # GNU ld cannot be installed on macOS # https://github.com/Homebrew/homebrew-core/issues/17794#issuecomment-328174395 # Hence, we don't need to differentiate between OS and ld # for the sake of adding as-needed support if self.compiler_type.is_osx_compiler: - return '-Wl,-dead_strip_dylibs' + return ['-Wl,-dead_strip_dylibs'] else: - return '-Wl,--as-needed' + return ['-Wl,--as-needed'] def get_pic_args(self) -> typing.List[str]: if self.compiler_type.is_osx_compiler or self.compiler_type.is_windows_compiler: