linkers: Don't build thin archives on illumos or Solaris

The system linkers don't support this particular GNU extension on
these OS'es, so don't build them there.

Based on an OpenIndiana patch created by @alarcher. Closes #9882.
pull/10961/head
Alan Coopersmith 2 years ago committed by Nirbheek Chauhan
parent a2cac72d9b
commit 8ee4660788
  1. 8
      mesonbuild/linkers/linkers.py

@ -208,8 +208,12 @@ class ArLinker(ArLikeLinker):
return self.can_rsp
def get_std_link_args(self, env: 'Environment', is_thin: bool) -> T.List[str]:
# FIXME: osx ld rejects this: "file built for unknown-unsupported file format"
if is_thin and not env.machines[self.for_machine].is_darwin():
# Thin archives are a GNU extension not supported by the system linkers
# on Mac OS X, Solaris, or illumos, so don't build them on those OSes.
# OS X ld rejects with: "file built for unknown-unsupported file format"
# illumos/Solaris ld rejects with: "unknown file type"
if is_thin and not env.machines[self.for_machine].is_darwin() \
and not env.machines[self.for_machine].is_sunos():
return self.std_thin_args
else:
return self.std_args

Loading…
Cancel
Save