Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] Potential lurking issue with host rpaths
Date: Wed, 25 Dec 2019 16:13:51 +0100	[thread overview]
Message-ID: <20191225151351.GO26395@scaer> (raw)

Thomas, Arnout, Peter, All,

Consider the following situation for packages 'bar' and 'libfoo':
  - upstream bar has an optional dependency on libfoo
  - in Buildroot, host-bar does not depend on host-libfoo, because
    we do not need that dependency [0]
  - a third package (whatever, not in the dependency chain of host-bar)
    brings in host-libfoo into the build.

Now, let's look at what happens:

- without PPD
  - libfoo not installed on the host system
    - host-libfoo built before host-bar
      - bar links to libfoo
        - bar has an RPATH for another lib
          => OK
        - bar does not have an RPATH for another lib
          -> check-host-rpath errors out for host-bar
          => OK
    - host-libfoo built after host-bar
      -> bar not linked to libfoo
      => OK

  - libfoo installed on the host system
    - host-libfoo built before host-bar
      - bar links to host-libfoo
        - bar has an RPATH for another lib
          => OK
        - bar does not have an RPATH for another lib
          -> check-host-rpath errors out for host-bar
          => OK
    - host-libfoo built after host-bar
      - bar links to system libfoo
        - bar has an RPATH for another lib
          -> check-host-rpath OK for both host-bar and host-libfoo
          -> error at runtime: bar uses host-libfoo instead of system
             libfoo
          => KO, MISSED
        - bar does not have an RPATH for another lib
          -> check-host-rpath errors out for host-libfoo
          => OK [1]


- with PPD
  - libfoo not installed on the host system
    -> bar never linked to libfoo
    => OK

  - libfoo installed on the host system
    -> bar always linked to system libfoo
      - bar has an RPATH for another lib
        -> check-host-rpath OK for host-bar
        -> error at runtime: bar uses host-libfoo instead of system
           libfoo, *but* only once the final, complete host directory
           has been aggregated
        => KO, MISSED
      - bar does not have an RPATH for another lib
        -> check-host-rpath OK for host-bar
        => OK


So, in either case (PPD or no PPD), we do have an issue with optional
dependencies for host packages...


Now, the questions:
  - are those two issues for real, or did I miss something?
  - is they are real, how can we fix them?


[0] for example host-systemd does not depend on host-libselinux, because
    we only need systemctl, but systemd will always also build nspawn,
    which may link with libselinux if present.

[1] check-host-rpath errors out for host-libfoo instead of host-bar, so
    for the wrong package, but at least it errors out and we can notice
    the issue.


Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

             reply	other threads:[~2019-12-25 15:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-25 15:13 Yann E. MORIN [this message]
2019-12-26 14:49 ` [Buildroot] Potential lurking issue with host rpaths 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=20191225151351.GO26395@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox