diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-07-25 09:56:52 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-07-25 15:36:59 -0700 |
commit | d6b9d431ec071f54796c5ed3173efa5ad1b86db3 (patch) | |
tree | a8232e4ba45366efd098d15e950112ddf345632b | |
parent | 5b2f921d524657605daf0ddedc4d6088c5726056 (diff) | |
download | meson-d6b9d431ec071f54796c5ed3173efa5ad1b86db3.zip meson-d6b9d431ec071f54796c5ed3173efa5ad1b86db3.tar.gz meson-d6b9d431ec071f54796c5ed3173efa5ad1b86db3.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.py | 3 | ||||
-rw-r--r-- | mesonbuild/linkers/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/linkers/linkers.py | 7 |
3 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 5306e87..063439f 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, @@ -343,7 +344,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' |