From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v7 5/8] package/pkg-generic: make libtool .la files compatible with per-package directories
Date: Mon, 31 Dec 2018 09:44:32 +0100 [thread overview]
Message-ID: <20181231084432.GC24224@scaer> (raw)
In-Reply-To: <20181228104335.22379-6-thomas.petazzoni@bootlin.com>
Thomas, All,
On 2018-12-28 11:43 +0100, Thomas Petazzoni spake thusly:
> Libtool .la files unfortunately contain a number of absolute paths,
> which now refer to per-package directories. Due to this, when building
> package A, .la files may contain absolute paths referring to
> directories in package B per-package sysroot. This causes some -L
> flags referring to other sysroot from being added, which doesn't work
> as the linker no longer realizes that such paths are within its
> sysroot.
>
> To fix this, we introduce a replacement step of .la files in the
> configure step, to make sure all paths refer to this package
> per-package directory.
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> package/pkg-generic.mk | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 8ea86514d7..9575639b43 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -126,6 +126,21 @@ endef
> GLOBAL_INSTRUMENTATION_HOOKS += step_user
> endif
>
> +#######################################
> +# Helper functions
> +
> +# Make sure .la files only reference the current per-package
> +# directory.
> +
> +# $1: package name (lower case)
> +# $2: staging directory of the package
> +ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
> +define fixup-libtool-files
> + $(Q)find $(2)/usr/lib* -name "*.la" | xargs --no-run-if-empty \
> + $(SED) "s:$(PER_PACKAGE_DIR)/[^/]*/:$(PER_PACKAGE_DIR)/$(1)/:g"
^^^^^^^
This can match the string '//'. Don't you in fact want to match at least
one char? I.e.: $(PER_PACKAGE_DIR)/[^/]+/
> +endef
> +endif
> +
> ################################################################################
> # Implicit targets -- produce a stamp file for each step of a package build
> ################################################################################
> @@ -222,6 +237,7 @@ $(BUILD_DIR)/%/.stamp_configured:
> @$(call step_start,configure)
> @$(call MESSAGE,"Configuring")
> $(call prepare-per-package-directory,$($(PKG)_FINAL_DEPENDENCIES))
> + $(call fixup-libtool-files,$(NAME),$(STAGING_DIR))
At some point, we may have to turn that into a generic hook-registration
mechanism.
For example, in inner-generic-package:
$(2)_PRE_CONFIGURE_HOOKS_FINAL = \
PREPARE_PER_PACKAGE_DIRECTORY \
FIXUP_LIBTOOL_FILES \
$($(2)_PRECONFIGURE_HOOKS)
> $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
... and here, we'd use $($(PKG)_PRE_CONFIGURE_HOOKS_FINAL).
Similarly for the other hooks, of course...
But that's for the future! ;-)
Regards,
Yann E. MORIN.
> $($(PKG)_CONFIGURE_CMDS)
> $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))
> @@ -879,6 +895,7 @@ $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2)
> $$($(2)_TARGET_INSTALL_HOST): PKG=$(2)
> $$($(2)_TARGET_BUILD): PKG=$(2)
> $$($(2)_TARGET_CONFIGURE): PKG=$(2)
> +$$($(2)_TARGET_CONFIGURE): NAME=$(1)
> $$($(2)_TARGET_RSYNC): SRCDIR=$$($(2)_OVERRIDE_SRCDIR)
> $$($(2)_TARGET_RSYNC): PKG=$(2)
> $$($(2)_TARGET_PATCH): PKG=$(2)
> --
> 2.20.1
>
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2018-12-31 8:44 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-28 10:43 [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 1/8] support/scripts/check-host-rpath: document existing functions Thomas Petazzoni
2018-12-28 12:47 ` Yann E. MORIN
2019-01-17 21:33 ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 2/8] Makefile: move definition of TARGET_DIR inside .config condition Thomas Petazzoni
2018-12-28 12:49 ` Yann E. MORIN
2019-01-17 21:35 ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 3/8] core: implement per-package SDK and target Thomas Petazzoni
2018-12-30 21:52 ` Yann E. MORIN
2018-12-31 14:31 ` Thomas Petazzoni
2018-12-31 14:45 ` Yann E. MORIN
2019-01-08 18:02 ` Jan Kundrát
2019-11-05 16:38 ` Thomas Petazzoni
2019-11-05 19:05 ` Carlos Santos
2019-11-06 7:57 ` Thomas Petazzoni
2019-11-06 8:13 ` Jan Kundrát
2018-12-28 10:43 ` [Buildroot] [PATCH v7 4/8] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Thomas Petazzoni
2018-12-28 12:51 ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 5/8] package/pkg-generic: make libtool .la files compatible with per-package directories Thomas Petazzoni
2018-12-31 8:44 ` Yann E. MORIN [this message]
2018-12-28 10:43 ` [Buildroot] [PATCH v7 6/8] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 7/8] docs/manual: add details about top-level parallel build support Thomas Petazzoni
2018-12-28 13:03 ` Yann E. MORIN
2018-12-28 13:08 ` Thomas Petazzoni
2018-12-31 8:46 ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 8/8] docs/manual: document the effect of per-package directory on variables Thomas Petazzoni
2018-12-28 17:21 ` [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2019-02-22 16:18 ` Andreas Naumann
2019-02-22 18:07 ` Vadim Kochan
2019-02-22 20:29 ` Thomas Petazzoni
2019-02-25 1:10 ` Vadim Kochan
2019-02-25 8:05 ` Thomas Petazzoni
2019-02-25 8:33 ` Vadim Kochan
2019-03-01 14:50 ` Vadym Kochan
2019-03-01 17:18 ` Yann E. MORIN
2019-03-04 7:24 ` Arnout Vandecappelle
2019-03-04 10:22 ` Thomas Petazzoni
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=20181231084432.GC24224@scaer \
--to=yann.morin.1998@free.fr \
--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 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.