Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/3] package/pkg-meson.mk: explicitly specify pkg-config settings
Date: Wed, 19 Feb 2020 21:38:41 +0100	[thread overview]
Message-ID: <20200219213841.3a1fb7a5@windsurf> (raw)
In-Reply-To: <20200205103304.2515942-3-arnout@mind.be>

Hello Arnout,

On Wed,  5 Feb 2020 11:33:04 +0100
"Arnout Vandecappelle (Essensium/Mind)" <arnout@mind.be> wrote:

> meson is able to distinguish between host (= native) and target (=
> cross) compilation. It will explicitly pass different options to
> pkg-config to distinguish them. Therefore, we don't need to use the
> pkg-config wrapper when using meson, and can instead pass the pkg-config
> settings through the cross-compilation.conf.
> 
> This is important because in some situations (e.g. for the Python
> configuration), meson sets the PKG_CONFIG_LIBDIR variable to a different
> value before calling pkg-config. Relying on our wrapper script doesn't
> work in that case (except if the script would unconditionally set
> PKG_CONFIG_LIBDIR, which it doesn't do at the moment).
> 
> Add the sys_root and pkg_config_lib settings to cross-compilation.conf
> and use pkgconf directly instead of the wrapper.
> 
> Note that this requires us to substitute STAGING_DIR as well, with an
> absolute path. This is not a big deal since cross-compilation.conf is
> regenerated for every package.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

Unfortunately, this breaks the build of libglib2 in static linking
scenarios:

  http://autobuild.buildroot.net/results/35c/35ce460192581a3ce2866ef5d3cb5391afd68cc5/build-end.log

And now that I have merged the fixes for the erlang an sdbusplus
issues, this libglib2 issue is the #1 issue hitting the autobuilders on
master.

The problem comes from the fact that by skipping the wrapper, you are
no longer passing the --static option to pkg-config when building
statically.

From a quick look at build/lib/mesonbuild/dependencies/base.py in the
Meson code base, it seems like there is some way to have it pass
--static to pkg-config:

        if self.static:
            libcmd.append('--static')

But it's not clear to me how that happens. Perhaps with your better
knowledge of the Meson code base you will have an idea here ?

Of course, we don't want to unconditionally pass --static, as --static
should be passed when using pkg-config to look up for target libraries,
but not when looking up for host libraries, and the whole point of your
initial patch was precisely to leave it up to meson to invoke
pkg-config the "right" way depending on whether it was cross-compiling
something or natively compiling.

Could you help here ?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2020-02-19 20:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 10:33 [Buildroot] [PATCH 1/3] package/pkg-meson.mk: refactor flags substitution with make-comma-list Arnout Vandecappelle
2020-02-05 10:33 ` [Buildroot] [PATCH 2/3] package/meson: add upstream patch to support pkg_config_libdir Arnout Vandecappelle
2020-02-05 10:33 ` [Buildroot] [PATCH 3/3] package/pkg-meson.mk: explicitly specify pkg-config settings Arnout Vandecappelle
2020-02-19 20:38   ` Thomas Petazzoni [this message]
2020-02-20  9:05     ` Arnout Vandecappelle
2020-02-05 16:07 ` [Buildroot] [PATCH 1/3] package/pkg-meson.mk: refactor flags substitution with make-comma-list Yann E. MORIN
  -- strict thread matches above, loose matches on Subject: below --
2020-02-04 16:58 [Buildroot] [PATCH 1/3] package/pkg-meson.mk: refactor flags substitution into function Arnout Vandecappelle
2020-02-04 16:58 ` [Buildroot] [PATCH 3/3] package/pkg-meson.mk: explicitly specify pkg-config settings Arnout Vandecappelle

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=20200219213841.3a1fb7a5@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /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