package/meson: force ext static libs when BR2_STATIC_LIBS
authorMatt Weber <matthew.weber@rockwellcollins.com>
Sat, 26 Oct 2019 15:30:06 +0000 (10:30 -0500)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 26 Oct 2019 17:02:00 +0000 (19:02 +0200)
commitf1cb8ca218aa0980efb88a472be719538c030260
treea1a88fe55cd41ae0f9619c9a3028b1d5838b37b1
parent05484f621c1c2f80b2d735b2f4694996baad4a61
package/meson: force ext static libs when BR2_STATIC_LIBS

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/

Cc: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Matthew Weber <matthew.weber@rockwellcollins.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/meson/0003-Prefer-ext-static-libs-when-default-library-static.patch [new file with mode: 0644]