aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-07-25 09:56:52 -0700
committerNirbheek Chauhan <nirbheek@centricular.com>2022-08-08 19:10:32 +0530
commitee16f01b6abc06c474ab8a91e19fa75e1253e132 (patch)
treecabb4898d01778487b0a5ad46c6b026dd8e9803f
parentfadf7ccf47a0825685e19cbd6042b1ccf1c7ae9c (diff)
downloadmeson-ee16f01b6abc06c474ab8a91e19fa75e1253e132.zip
meson-ee16f01b6abc06c474ab8a91e19fa75e1253e132.tar.gz
meson-ee16f01b6abc06c474ab8a91e19fa75e1253e132.tar.bz2
linkers: Add a representation for the Apple AR Linker
Which is old and annoying and doesn't expose global symbols by default, so we need a work around. see: https://github.com/mesonbuild/meson/pull/10587 see: https://lists.gnu.org/archive/html/libtool/2002-07/msg00025.html
-rw-r--r--mesonbuild/compilers/detect.py3
-rw-r--r--mesonbuild/linkers/__init__.py2
-rw-r--r--mesonbuild/linkers/linkers.py7
3 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 962bc16..fb09f52 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -24,6 +24,7 @@ from ..linkers import (
guess_win_linker,
guess_nix_linker,
AIXArLinker,
+ AppleArLinker,
ArLinker,
ArmarLinker,
ArmClangDynamicLinker,
@@ -344,7 +345,7 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
if p.returncode == 0:
return ArLinker(compiler.for_machine, linker)
if p.returncode == 1 and err.startswith('usage'): # OSX
- return ArLinker(compiler.for_machine, linker)
+ return AppleArLinker(compiler.for_machine, linker)
if p.returncode == 1 and err.startswith('Usage'): # AIX
return AIXArLinker(linker)
if p.returncode == 1 and err.startswith('ar: bad option: --'): # Solaris
diff --git a/mesonbuild/linkers/__init__.py b/mesonbuild/linkers/__init__.py
index 3cc3fc4..23fc82b 100644
--- a/mesonbuild/linkers/__init__.py
+++ b/mesonbuild/linkers/__init__.py
@@ -24,6 +24,7 @@ from .linkers import (
VisualStudioLikeLinker,
VisualStudioLinker,
IntelVisualStudioLinker,
+ AppleArLinker,
ArLinker,
ArmarLinker,
DLinker,
@@ -93,6 +94,7 @@ __all__ = [
'C2000Linker',
'TILinker',
'AIXArLinker',
+ 'AppleArLinker',
'PGIStaticLinker',
'NvidiaHPC_StaticLinker',
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py
index 589e816..e262eca 100644
--- a/mesonbuild/linkers/linkers.py
+++ b/mesonbuild/linkers/linkers.py
@@ -215,6 +215,13 @@ class ArLinker(ArLikeLinker):
return self.std_args
+class AppleArLinker(ArLinker):
+
+ # mostly this is used to determine that we need to call ranlib
+
+ id = 'applear'
+
+
class ArmarLinker(ArLikeLinker):
id = 'armar'