All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baruch Siach via buildroot <buildroot@buildroot.org>
To: Louis Chauvet <louis.chauvet@bootlin.com>
Cc: kory.maincent@bootlin.com, thomas.petazzoni@bootlin.com,
	geomatsi@gmail.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] boot/arm-trusted-firmware: fix the RPATH of fiptool
Date: Thu, 07 Dec 2023 19:05:02 +0200	[thread overview]
Message-ID: <874jguc58s.fsf@tarshish> (raw)
In-Reply-To: <ZXH1QcJkmcJdz3nB@louis-chauvet-laptop>

Hi Louis,

On Thu, Dec 07 2023, Louis Chauvet wrote:
> Le 06/12/23 - 19:05, Baruch Siach via buildroot a écrit :
>> On Wed, Dec 06 2023, Louis Chauvet via buildroot wrote:
>> > The arm-trusted-firmware package builds a host tool called "fiptool",
>> > which is used during the build process of arm-trusted-firmware
>> > itself. This tool links against the OpenSSL host library, and
>> > therefore needs to be built with the correct RPATH pointing to
>> > $HOST_DIR/lib.
>> >
>> > This is why commit a957d9a90ade4194dffe3eb2fc0136bc5d077c28
>> > ("boot/arm-trusted-firmware: build fiptool separately with dependency
>> > o n host-openssl") added the ARM_TRUSTED_FIRMWARE_BUILD_FIPTOOL
>> > variable, which builds the fiptool tool first, with the right
>> > variables set, before invoking the full build of TF-A. This ensured
>> > that fiptool was built with the correct RPATH.
>> >
>> > However, more recent versions of TF-A have modified their Makefile
>> > machinery, and fiptool is being rebuilt even if it was built
>> > before. Unfortunately, this rebuild is no longer done with the right
>> > flags, so we end up with a fiptool binary that no longer has the right
>> > RPATH, and fiptool fails to find the OpenSSL libraries from
>> > $HOST_DIR/lib.
>> >
>> > In order to fix this, we take a different approach: we do not build
>> > fiptool separately first, but we inject the necessary flags through
>> > the HOSTCC variable. Indeed, there's no HOST_LDFLAGS or HOST_LDLIBS
>> > variable or similar that would allow us to pass the -Wl,-rpath flag
>> > that is needed. Shoe-horning this flag into HOSTCC gets the job done,
>> > and actually simplifies our arm-trusted-firmware.mk.
>> 
>> The code this patch removes tries to keep compatibility with TF-A
>> versions earlier than 1.3. This patch relies on HOSTCC that was only
>> introduced in TF-A version 1.4 with upstream commit 72610c4102990
>> ("build: Introduce HOSTCC flag"). I guess losing compatibility with
>> older TF-A is fine, since all Buildroot in-tree configs appear to use
>> newer versions. But I think this should at least be mentioned in the
>> commit log.
>
> Thanks for your feedback. Do you think this is sufficient ?
>
> This patch break the compatibility with version prior to 1.4 (upstream
> commit 72610c4102990 ("build: Introduce HOSTCC flag")). v1.4 is very old 
> (July 2017), not used anymore in-tree and probably not used anymore 
> outside the tree.

Looks good to me.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-12-07 17:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 16:44 [Buildroot] [PATCH] boot/arm-trusted-firmware: fix the RPATH of fiptool Louis Chauvet via buildroot
2023-12-06 17:05 ` Baruch Siach via buildroot
2023-12-07 16:39   ` Louis Chauvet via buildroot
2023-12-07 17:05     ` Baruch Siach via buildroot [this message]
2023-12-24 15:22 ` Köry Maincent via buildroot

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=874jguc58s.fsf@tarshish \
    --to=buildroot@buildroot.org \
    --cc=baruch@tkos.co.il \
    --cc=geomatsi@gmail.com \
    --cc=kory.maincent@bootlin.com \
    --cc=louis.chauvet@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.