linkers: fix LLD linker response file handling

Correct base classes so GNU-like linkers all default to supporting response files.
pull/13359/head
Benoit Pierre 1 year ago committed by Dylan Baker
parent 81b151f611
commit 8ef4e34cae
  1. 6
      mesonbuild/linkers/linkers.py
  2. 9
      unittests/allplatformstests.py

@ -606,6 +606,9 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
"boot_application": "16", "boot_application": "16",
} }
def get_accepts_rsp(self) -> bool:
return True
def get_pie_args(self) -> T.List[str]: def get_pie_args(self) -> T.List[str]:
return ['-pie'] return ['-pie']
@ -849,9 +852,6 @@ class GnuDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dynam
"""Representation of GNU ld.bfd and ld.gold.""" """Representation of GNU ld.bfd and ld.gold."""
def get_accepts_rsp(self) -> bool:
return True
class GnuGoldDynamicLinker(GnuDynamicLinker): class GnuGoldDynamicLinker(GnuDynamicLinker):

@ -5010,3 +5010,12 @@ class AllPlatformTests(BasePlatformTests):
# The first supported std should be selected # The first supported std should be selected
self.setconf('-Dcpp_std=c++11,gnu++11,vc++11') self.setconf('-Dcpp_std=c++11,gnu++11,vc++11')
self.assertEqual(self.getconf('cpp_std'), 'c++11') self.assertEqual(self.getconf('cpp_std'), 'c++11')
def test_rsp_support(self):
env = get_fake_env()
cc = detect_c_compiler(env, MachineChoice.HOST)
has_rsp = cc.linker.id in {
'ld.bfd', 'ld.gold', 'ld.lld', 'ld.mold', 'ld.qcld', 'ld.wasm',
'link', 'lld-link', 'mwldarm', 'mwldeppc', 'optlink', 'xilink',
}
self.assertEqual(cc.linker.get_accepts_rsp(), has_rsp)

Loading…
Cancel
Save