aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2023-05-03 21:32:58 -0400
committerEli Schwartz <eschwartz@archlinux.org>2023-06-26 13:10:33 -0400
commit6fad02db04534519e96f1ba66a178c6c9735554f (patch)
treedd3b5158fd1484569798a9d97fd95a2a3839f626
parent3c5d46267f68b01119ecfbe592a3c0d7ba116b62 (diff)
downloadmeson-6fad02db04534519e96f1ba66a178c6c9735554f.zip
meson-6fad02db04534519e96f1ba66a178c6c9735554f.tar.gz
meson-6fad02db04534519e96f1ba66a178c6c9735554f.tar.bz2
fix regression in handling output overwriting for ar-like linkers
Linkers that aren't actually ar, were refactored into a base class in commit 253ff71e6b801786290b6ecb23aea61dcfeebeca, which however didn't take into account that we were doing checks for this.
-rw-r--r--mesonbuild/backend/ninjabackend.py4
-rw-r--r--mesonbuild/linkers/__init__.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index c60143b..b6b8599 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -37,7 +37,7 @@ from .. import mlog
from .. import compilers
from ..arglist import CompilerArgs
from ..compilers import Compiler
-from ..linkers import ArLinker, RSPFileSyntax
+from ..linkers import ArLikeLinker, RSPFileSyntax
from ..mesonlib import (
File, LibType, MachineChoice, MesonException, OrderedSet, PerMachine,
ProgressBar, quote_arg
@@ -2272,7 +2272,7 @@ class NinjaBackend(backends.Backend):
# them out to fix this properly on Windows. See:
# https://github.com/mesonbuild/meson/issues/1517
# https://github.com/mesonbuild/meson/issues/1526
- if isinstance(static_linker, ArLinker) and not mesonlib.is_windows():
+ if isinstance(static_linker, ArLikeLinker) and not mesonlib.is_windows():
# `ar` has no options to overwrite archives. It always appends,
# which is never what we want. Delete an existing library first if
# it exists. https://github.com/mesonbuild/meson/issues/1355
diff --git a/mesonbuild/linkers/__init__.py b/mesonbuild/linkers/__init__.py
index ff50d69..b9df8d7 100644
--- a/mesonbuild/linkers/__init__.py
+++ b/mesonbuild/linkers/__init__.py
@@ -25,6 +25,7 @@ from .linkers import (
VisualStudioLinker,
IntelVisualStudioLinker,
AppleArLinker,
+ ArLikeLinker,
ArLinker,
ArmarLinker,
DLinker,
@@ -92,6 +93,7 @@ __all__ = [
'VisualStudioLikeLinker',
'VisualStudioLinker',
'IntelVisualStudioLinker',
+ 'ArLikeLinker',
'ArLinker',
'ArmarLinker',
'DLinker',