compilers: return as-needed args as a list

pull/5700/head
Dylan Baker 6 years ago committed by Nirbheek Chauhan
parent 24c4c079e7
commit 5d7395673d
  1. 2
      mesonbuild/compilers/compilers.py
  2. 6
      mesonbuild/compilers/mixins/gnu.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

@ -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:

Loading…
Cancel
Save