Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 1/1] package/libp11: fix enginesdir
Date: Wed, 7 Aug 2024 11:00:24 +0200	[thread overview]
Message-ID: <20240807110024.519f6ab1@windsurf> (raw)
In-Reply-To: <CAPi7W82C-dMF+d_gJY=WYOAKYPQE_5py6cf4aknoHwpQPXCcNA@mail.gmail.com>

Hello Fabrice,

On Mon, 22 Jul 2024 22:47:04 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> It seems that you added this workaround back in 2019 [1].
> However, to my understanding pkg-config only prefixes sysroot to a
> subset of variables since at least 2018 [2] and enginesdir is not one
> of them.
> Finally, since its addition in openssl in 2016 [3], enginesdir has
> always been set to ${libdir}/engines-...
> So, I don't know what triggers the build failure that you fixed at that time.

So, I had a closer look, and you're right... but things are going to
get broken again soon.

Back when I introduced this code, enginesdir was expressed in terms of
${libdir}:

enginesdir=${libdir}/engines-3

and because ${libdir} is one of the variables that get sysroot-ed,
enginesdir also gets sysrooted, which is why my "hack" was needed.

Then, in OpenSSL commit 2ac569a67b9d0980efa2d8061a6a61e0645f37a7 (first
appeared in OpenSSL 3.3.0), they reworked the whole .pc stuff, and
changed enginesdir like this:

enginesdir={- $OpenSSL::safe::installdata::ENGINESDIR -}

which ends up as:

enginesdir=/usr/lib/engines-3

so enginesdir is no longer expressed as a relative path to ${libdir},
so it doesn't get sysroot'ed, which is the behaviour you observe right
now.

However, more recently (June 2024) commit
30dc37d798a0428fd477d3763086e7e97b3d596f was merged into OpenSSL, which
reworks the above logic to:

enginesdir=${libdir}/{- $OpenSSL::safe::installdata::ENGINESDIR_REL_LIBDIR -}

so, starting from the next release of OpenSSL, enginesdir will be back
to be defining relatively to ${libdir}, so it will be sysrooted again.

See my quick experiment below. First current situation:

$ grep ^enginesdir output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig/libcrypto.pc
enginesdir=/usr/lib/engines-3
$ ./output/host/bin/pkg-config --variable=enginesdir libcrypto
/usr/lib/engines-3

with the next release of OpenSSL, it will look like this:

$ grep ^enginesdir output/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/pkgconfig/libcrypto.pc
enginesdir=${libdir}/engines-3

$ ./output/host/bin/pkg-config --variable=enginesdir libcrypto
./output/host/bin/../arm-buildroot-linux-gnueabihf/sysroot/usr/lib/engines-3

So maybe we should merge your patch.. and revert when a new OpenSSL
release is made?

I was wondering whether the problem should be fixed in libcrypto.pc by
a tweak in libopenssl.mk, but how can we know when this enginesdir will
be used to know the location of the engines at compile time (in which
case it must be sysrooted) vs. when it will be used to know the
location of the engines at run time (in which case it should not be
sysrooted) ?

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2024-08-07  9:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 20:42 [Buildroot] [PATCH 1/1] package/libp11: fix enginesdir Fabrice Fontaine
2024-05-09 21:10 ` Thomas Petazzoni via buildroot
2024-07-22 20:21   ` Thomas Petazzoni via buildroot
2024-07-22 20:47     ` Fabrice Fontaine
2024-08-07  9:00       ` Thomas Petazzoni via buildroot [this message]

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=20240807110024.519f6ab1@windsurf \
    --to=buildroot@buildroot.org \
    --cc=fontaine.fabrice@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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