All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Thomas Petazzoni' <thomas.petazzoni@bootlin.com>,
	"f.rogall@gmx.de" <f.rogall@gmx.de>,
	"mail@jens-maus.de" <mail@jens-maus.de>,
	"buildroot@buildroot.org" <buildroot@buildroot.org>,
	"fesc2000@mailbox.org" <fesc2000@mailbox.org>,
	"oliver.kasten@trsystems.de" <oliver.kasten@trsystems.de>
Subject: Re: [Buildroot] NodeJS, qemu wrapper and ELF interpreter fun
Date: Tue, 1 Nov 2022 11:02:44 +0100	[thread overview]
Message-ID: <20221101100244.GF1058960@scaer> (raw)
In-Reply-To: <f7086aad47234c089332330689ae9a42@AcuMS.aculab.com>

David, All,

On 2022-11-01 08:46 +0000, David Laight spake thusly:
> > (C) Pass LD_LIBRARY_PATH pointing to $(STAGING_DIR)/lib and
> >     $(STAGING_DIR)/usr/lib in the Qemu wrapper. This works because
> >     LD_LIBRARY_PATH paths have precedence over paths given by
> >     ld.so.cache.
> > 
> >     This is the solution already used by the GOI qemu wrapper in
> >     package/gobject-introspection/g-ir-scanner-qemuwrapper.in, and
> >     which was suggested in bug
> >     https://bugs.busybox.net/show_bug.cgi?id=14366.
> > 
> > Any opinion? Or other ideas?
> 
> Using LD_LIBRARY_PATH like that is a bad idea.

Yeah, we know quite a bit about some LD_LIBRARY_PATH woes ;-)

> Just google for it and you'll find a load of stuff about it.
> LD_LIBRARY_PATH should only really be used not substitute a
> non-standard library - eg for testing.

In this situation, the issue is that we are running a *target* program,
on the *build machine*, and we want it to pick target ilbraries, not the
host libraries.

Of course, during cross-compilation, we can't run target code on the
build machine, so we run it through qemu-user.

However, as Thomas explained and demonstrated, qemu-user intercepts and
emulates the open()-like syscalls. Then it has a heuristic to resolve
the opened path. This heuristic fails for us in some cases, however.

Thus we need a way to force-tell where to look for libraries.

So, yes, LD_LIBRARY_PATH is far from a panacea, but technically it makes
things work.

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.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-11-01 10:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31 20:39 [Buildroot] NodeJS, qemu wrapper and ELF interpreter fun Thomas Petazzoni via buildroot
2022-11-01  8:46 ` David Laight
2022-11-01 10:02   ` Yann E. MORIN [this message]
2022-11-01 10:15 ` 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=20221101100244.GF1058960@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=David.Laight@ACULAB.COM \
    --cc=buildroot@buildroot.org \
    --cc=f.rogall@gmx.de \
    --cc=fesc2000@mailbox.org \
    --cc=mail@jens-maus.de \
    --cc=oliver.kasten@trsystems.de \
    --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.