Files
buildroot/package/meson/0001-Prefer-ext-static-libs-when-default-library-static.patch
Bernd Kuhls eb1f160b7a package/meson: bump version to 1.10.0
Release notes: https://mesonbuild.com/Release-notes-for-1-10-0.html

Rebased and updated patch 0001 to fix build error:

    NameError: name 'env' is not defined

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
2025-12-09 20:42:50 +01:00

58 lines
2.4 KiB
Diff

From c1359a49b61016031287d62f44a363cb76242c91 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>
[Bernd: rebased for 1.10.0]
Signed-off-by: Bernd Kuhls <bernd@kuhls.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 09ad837b1..b7f6b9f22 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -27,6 +27,7 @@
from ... import mlog
from ...linkers.linkers import GnuLikeDynamicLinkerMixin, SolarisDynamicLinker, CompCertDynamicLinker
from ...mesonlib import LibType
+from ...options import OptionKey
from .. import compilers
from ..compilers import CompileCheckMode
from .visualstudio import VisualStudioLikeCompiler
@@ -1045,6 +1046,9 @@ class CLikeCompiler(Compiler):
# TI C28x compilers can use both extensions for static or dynamic libs.
stlibext = ['a', 'lib']
shlibext = ['dll', 'so']
+ elif self.environment.coredata.optstore.get_value_for(OptionKey('default_library')) == 'static':
+ # Linux/BSDs
+ shlibext = ['a']
elif self.info.is_os2():
stlibext = ['_s.lib', '_s.a', 'lib', 'a']
shlibext = ['_dll.lib', '_dll.a', 'lib', 'a', 'dll']
--
2.25.1