7f428bdb7e
- update patch 0001-Prefer-ext-static-libs-when-default-library-static.patch (use get_option(OptionKey()) instead of get_builtin_option()) - rebase patch 0002-mesonbuild-dependencies-base.py-add-pkg_config_stati.patch For details see [1]. [1] https://mesonbuild.com/Release-notes-for-0-57-0.html Signed-off-by: Peter Seiderer <ps.report@gmx.net> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
48 lines
1.9 KiB
Diff
48 lines
1.9 KiB
Diff
From cf9ad9b79a924081ce3d1e045bba3544815ea5f8 Mon Sep 17 00:00:00 2001
|
|
From: Matt Weber <matthew.weber@rockwellcollins.com>
|
|
Date: Sat, 26 Oct 2019 09:17:29 -0500
|
|
Subject: [PATCH] Prefer ext static libs when --default-library=static
|
|
|
|
This patch adds a case in the library pattern logic to prefer static
|
|
libraries when the Meson Core option for "default_library" is set to
|
|
solely static.
|
|
|
|
The existing library search order makes sense for cases of shared and
|
|
shared / static mixed. However if using a prebuilt cross-toolchain,
|
|
they usually provide both a static and shared version of sysroot
|
|
libraries. This presents a problem in a complete static build where
|
|
there won't be shared libraries at runtime and during build time there
|
|
are failures like "ld: attempted static link of dynamic object".
|
|
|
|
Bug:
|
|
https://github.com/mesonbuild/meson/issues/6108
|
|
|
|
Fixes:
|
|
http://autobuild.buildroot.net/results/db1740b4777f436324218c52bc7b08e5c21b667d/
|
|
http://autobuild.buildroot.net/results/c17/c17bbb12d9deadd64a441b36e324cfbbe8aba5be/
|
|
|
|
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
|
|
[Updated for 0.57.1 - get_builtin_option() vs. get_option(OptionKey())]
|
|
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
|
---
|
|
mesonbuild/compilers/mixins/clike.py | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
|
|
index ad3bfae..4733910 100644
|
|
--- a/mesonbuild/compilers/mixins/clike.py
|
|
+++ b/mesonbuild/compilers/mixins/clike.py
|
|
@@ -999,6 +999,9 @@ class CLikeCompiler(Compiler):
|
|
elif env.machines[self.for_machine].is_cygwin():
|
|
shlibext = ['dll', 'dll.a']
|
|
prefixes = ['cyg'] + prefixes
|
|
+ elif env.coredata.get_option(OptionKey('default_library')) == 'static':
|
|
+ # Linux/BSDs
|
|
+ shlibext = ['a']
|
|
else:
|
|
# Linux/BSDs
|
|
shlibext = ['so']
|
|
--
|
|
2.30.1
|
|
|