From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: Baruch Siach via buildroot <buildroot@buildroot.org>
Cc: Jonathan Borne <jborne@kalray.eu>,
jmaselbas@kalray.eu, ysionneaux@kalray.eu
Subject: Re: [Buildroot] [RFC PATCH 0/1] Fix binutils/libiberty target install directory
Date: Mon, 24 Jan 2022 22:02:38 +0100 [thread overview]
Message-ID: <20220124220238.1fa0568b@windsurf> (raw)
In-Reply-To: <87k0ep9gbx.fsf@tarshish>
On Mon, 24 Jan 2022 19:44:29 +0200
Baruch Siach via buildroot <buildroot@buildroot.org> wrote:
> > Is there a reason behind this?
>
> As I understand that's because libiberty is static only. Buildroot does
> not copy static libraries to $(TARGET_DIR) because they are only used at
> build time, but not at run-time.
True, but it doesn't make sense to do that in
BINUTILS_INSTALL_TARGET_CMDS. It should go in
BINUTILS_INSTALL_STAGING_CMDS, where it is already present, as Romain
pointed out.
So basically:
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
needs to be dropped from BINUTILS_INSTALL_TARGET_CMDS, if indeed
libiberty is only installed as a static library.
However, taking a step back:
# We just want libbfd, libiberty and libopcodes,
# not the full-blown binutils in staging
define BINUTILS_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(STAGING_DIR) install
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/opcodes DESTDIR=$(STAGING_DIR) install
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
endef
# If we don't want full binutils on target
ifneq ($(BR2_PACKAGE_BINUTILS_TARGET),y)
define BINUTILS_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/bfd DESTDIR=$(TARGET_DIR) install
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/opcodes DESTDIR=$(TARGET_DIR) install
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/libiberty DESTDIR=$(STAGING_DIR) install
endef
endif
This is *extremely* suspicious. Indeed, we get the libraries
unconditionally installed in staging, so any other library or program
that we build after binutils can potentially link against thosze
libraries.
But we only install them conditionally in $(TARGET_DIR) if
BR2_PACKAGE_BINUTILS_TARGET=y.
This seems very bad to me. Both target and staging installations should
be done under the same condition.
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
next prev parent reply other threads:[~2022-01-24 21:02 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-24 17:35 [Buildroot] [RFC PATCH 0/1] Fix binutils/libiberty target install directory Jonathan Borne via buildroot
2022-01-24 17:35 ` [Buildroot] [RFC PATCH 1/1] " Jonathan Borne via buildroot
2022-01-24 17:44 ` [Buildroot] [RFC PATCH 0/1] " Baruch Siach via buildroot
2022-01-24 18:12 ` Romain Naour
2022-01-24 21:02 ` Thomas Petazzoni [this message]
2022-01-24 21:21 ` Yann E. MORIN
2022-01-24 21:53 ` Thomas Petazzoni
2022-01-26 15:30 ` Jonathan Borne via buildroot
2022-01-26 15:52 ` Thomas Petazzoni
2022-01-26 17:14 ` Yann E. MORIN
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=20220124220238.1fa0568b@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@buildroot.org \
--cc=jborne@kalray.eu \
--cc=jmaselbas@kalray.eu \
--cc=ysionneaux@kalray.eu \
/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