Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Ross Burton <ross.burton@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/7] meson: use a sensible default for libdir when cross-compiling
Date: Mon,  7 Jan 2019 16:38:18 +0000	[thread overview]
Message-ID: <20190107163823.31816-2-ross.burton@intel.com> (raw)
In-Reply-To: <20190107163823.31816-1-ross.burton@intel.com>

If --libdir isn't passed to Meson a default is used, but as this default value
changes depending on the host (whether it is Debian-like, or has /usr/lib64)
this isn't appropriate for cross builds.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 meta/recipes-devtools/meson/meson.inc              |  1 +
 .../meson/meson/cross-libdir.patch                 | 41 ++++++++++++++++++++++
 2 files changed, 42 insertions(+)
 create mode 100644 meta/recipes-devtools/meson/meson/cross-libdir.patch

diff --git a/meta/recipes-devtools/meson/meson.inc b/meta/recipes-devtools/meson/meson.inc
index ef8c5aefa52..d37afc3b0dc 100644
--- a/meta/recipes-devtools/meson/meson.inc
+++ b/meta/recipes-devtools/meson/meson.inc
@@ -11,6 +11,7 @@ SRC_URI = "https://github.com/mesonbuild/meson/releases/download/${PV}/meson-${P
            file://0003-native_bindir.patch \
            file://0001-python-module-do-not-manipulate-the-environment-when.patch \
            file://disable-rpath-handling.patch \
+           file://cross-libdir.patch \
            "
 SRC_URI[sha256sum] = "fb0395c4ac208eab381cd1a20571584bdbba176eb562a7efa9cb17cace0e1551"
 SRC_URI[md5sum] = "3c35b91e8040901034809576d54007c6"
diff --git a/meta/recipes-devtools/meson/meson/cross-libdir.patch b/meta/recipes-devtools/meson/meson/cross-libdir.patch
new file mode 100644
index 00000000000..2bd4fb3f9e3
--- /dev/null
+++ b/meta/recipes-devtools/meson/meson/cross-libdir.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From ce24f0d6a9be22ba61d80cd254e0409de2eaffd7 Mon Sep 17 00:00:00 2001
+From: Jussi Pakkanen <jpakkane@gmail.com>
+Date: Thu, 27 Dec 2018 23:43:35 +0200
+Subject: [PATCH] Default libdir is "lib" when cross compiling. Closes #2535.
+
+---
+ docs/markdown/snippets/crosslib.md |  7 +++++++
+ mesonbuild/coredata.py             |  8 ++++++++
+ run_unittests.py                   | 13 +++++++++++++
+ 3 files changed, 28 insertions(+)
+ create mode 100644 docs/markdown/snippets/crosslib.md
+
+diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
+index d70c23038c..4e2f3e008c 100644
+--- a/mesonbuild/coredata.py
++++ b/mesonbuild/coredata.py
+@@ -299,6 +299,7 @@ def __init__(self, options):
+         # Only to print a warning if it changes between Meson invocations.
+         self.pkgconf_envvar = os.environ.get('PKG_CONFIG_PATH', '')
+         self.config_files = self.__load_config_files(options.native_file)
++        self.libdir_cross_fixup()
+ 
+     @staticmethod
+     def __load_config_files(filenames):
+@@ -348,6 +349,13 @@ def __load_cross_file(filename):
+ 
+         raise MesonException('Cannot find specified cross file: ' + filename)
+ 
++    def libdir_cross_fixup(self):
++        # By default set libdir to "lib" when cross compiling since
++        # getting the "system default" is always wrong on multiarch
++        # platforms as it gets a value like lib/x86_64-linux-gnu.
++        if self.cross_file is not None:
++            self.builtins['libdir'].value = 'lib'
++
+     def sanitize_prefix(self, prefix):
+         if not os.path.isabs(prefix):
+             raise MesonException('prefix value {!r} must be an absolute path'
-- 
2.11.0



  reply	other threads:[~2019-01-07 16:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 16:38 [PATCH 1/7] toolchain-scripts: run post-relocate scripts for every environment Ross Burton
2019-01-07 16:38 ` Ross Burton [this message]
2019-01-07 16:38 ` [PATCH 3/7] meson: fix nativesdk-meson for multilib SDKs Ross Burton
2019-01-07 19:03   ` Martin Kelly
2019-01-07 20:02     ` Burton, Ross
2019-01-07 20:07       ` Martin Kelly
2019-01-07 16:38 ` [PATCH 4/7] meson: write correct host endian into SDK cross file Ross Burton
2019-01-07 16:38 ` [PATCH 5/7] oeqa/sdk/cases: clean up DL_DIR handling Ross Burton
2019-01-07 16:38 ` [PATCH 6/7] oeqa/sdk/assimp: cleanup Ross Burton
2019-01-07 16:38 ` [PATCH 7/7] oeqa/sdk: add test to exercise Meson Ross Burton
2019-01-07 16:44   ` Joshua Watt
2019-01-07 16:48     ` Burton, Ross
2019-01-07 17:03 ` ✗ patchtest: failure for "toolchain-scripts: run post-re..." and 6 more Patchwork
2019-01-08 11:01 ` [PATCH 1/7] toolchain-scripts: run post-relocate scripts for every environment Burton, Ross
2019-01-08 13:10   ` Joshua Watt
2019-01-08 13:19     ` Burton, Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190107163823.31816-2-ross.burton@intel.com \
    --to=ross.burton@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox