diff options
| author | Alois Wohlschlager <alois1@gmx-topmail.de> | 2025-07-28 18:59:01 +0200 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-11-11 23:06:40 -0500 |
| commit | 38786d8ac98f53a074008971da8fa328b64806f6 (patch) | |
| tree | 80461e1f568edf5746d89b6dc95eb8dcca692c1f /unittests | |
| parent | 1401b1d2bfe090750b52137dc57ca59ad00ca69b (diff) | |
| download | meson-38786d8ac98f53a074008971da8fa328b64806f6.tar.gz | |
compilers: support prelinking with Clang
Clang supports prelinking using the same `-r` flag as GCC. There has been prior
art in [1], which stalled at the time due to Clang inappropriately trying (and
failing) to link libgcc_s. This issue does not occur any more with versions 14
and higher.
[1] https://github.com/mesonbuild/meson/pull/8883
Diffstat (limited to 'unittests')
| -rw-r--r-- | unittests/linuxliketests.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/unittests/linuxliketests.py b/unittests/linuxliketests.py index c9ba37118..60069acb5 100644 --- a/unittests/linuxliketests.py +++ b/unittests/linuxliketests.py @@ -1759,16 +1759,13 @@ class LinuxlikeTests(BasePlatformTests): self.assertNotIn('-lfoo', content) def test_prelinking(self): - # Prelinking currently only works on recently new GNU toolchains. - # Skip everything else. When support for other toolchains is added, - # remove limitations as necessary. - if 'clang' in os.environ.get('CC', 'dummy') and not is_osx(): - raise SkipTest('Prelinking not supported with Clang.') testdir = os.path.join(self.unit_test_dir, '86 prelinking') env = get_fake_env(testdir, self.builddir, self.prefix) cc = detect_c_compiler(env, MachineChoice.HOST) if cc.id == "gcc" and not version_compare(cc.version, '>=9'): raise SkipTest('Prelinking not supported with gcc 8 or older.') + if cc.id == 'clang' and not version_compare(cc.version, '>=14'): + raise SkipTest('Prelinking not supported with Clang 13 or older.') self.init(testdir) self.build() outlib = os.path.join(self.builddir, 'libprelinked.a') |
