summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Pierre <benoit.pierre@gmail.com>2023-09-10 17:22:16 +0200
committerDylan Baker <dylan@pnwbakers.com>2024-08-09 11:35:18 -0700
commit8ef4e34cae956cb48cf0d22667c6e18af1340519 (patch)
tree48654af97b19f333b0e980d3d393894163272e9e
parent81b151f61138357950330f26b601e0b345bf77fa (diff)
downloadmeson-8ef4e34cae956cb48cf0d22667c6e18af1340519.tar.gz
linkers: fix LLD linker response file handling
Correct base classes so GNU-like linkers all default to supporting response files.
-rw-r--r--mesonbuild/linkers/linkers.py6
-rw-r--r--unittests/allplatformstests.py9
2 files changed, 12 insertions, 3 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index d00fd7a4b..0b8927359 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -606,6 +606,9 @@ class GnuLikeDynamicLinkerMixin(DynamicLinkerBase):
"boot_application": "16",
}
+ def get_accepts_rsp(self) -> bool:
+ return True
+
def get_pie_args(self) -> T.List[str]:
return ['-pie']
@@ -849,9 +852,6 @@ class GnuDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dynam
"""Representation of GNU ld.bfd and ld.gold."""
- def get_accepts_rsp(self) -> bool:
- return True
-
class GnuGoldDynamicLinker(GnuDynamicLinker):
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 726252611..e790ca493 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -5010,3 +5010,12 @@ class AllPlatformTests(BasePlatformTests):
# The first supported std should be selected
self.setconf('-Dcpp_std=c++11,gnu++11,vc++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)