From: Lukasz Gut <lgut@lgut.eu>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: sbrivio@redhat.com, sevinj.aghayeva@gmail.com, passt-dev@passt.top
Subject: Re: [PATCH v2 2/4] mbuto: Use realpath to copy ld
Date: Mon, 23 Sep 2024 12:09:12 +0200 [thread overview]
Message-ID: <6a278d810d6226ee5840ad40c3cbd03f7a23a3cc.camel@lgut.eu> (raw)
In-Reply-To: <ZvDmHtJu39r1Ak6S@zatzit.fritz.box>
On Mon, 2024-09-23 at 13:53 +1000, David Gibson wrote:
> On Wed, Sep 18, 2024 at 12:12:57PM +0200, Lukasz Gut wrote:
> > Place ld in exact physical location as on host, not being confused by
> > links. Use realpath, that was already on the list of default PROGS.
>
> It's not clear to me why this change is necessary.
I would like `ld-linux.so` to be copied to the exact same location as
in host. Without this change, it was copied to `/usr/lib64` directory.
There is no such a directory on the host, but there is a link `lib64 ->
lib` inside of `/usr` directory.
I thought to:
1. Copy things to exactly the same locations as they are on the host.
2. Recreate necessary links.
>
> >
> > Signed-off-by: Lukasz Gut <lgut@lgut.eu>
> > ---
> > mbuto | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/mbuto b/mbuto
> > index 1c3b347..1f92bd9 100755
> > --- a/mbuto
> > +++ b/mbuto
> > @@ -644,12 +644,13 @@ libs_path_add() {
> > # libs_copy_ld_so() - Copy run-time linker program, mimic location from host
> > # $1: Path to run-time linker
> > libs_copy_ld_so() {
> > - [ -f "${wd}/${1}" ] && return
> > + __srcfile="$("${REALPATH}" "${1}")"
> > + __destfile="${wd}""${__srcfile}"
> > + [ -f "${__destfile}" ] && return
> >
> > - __destdir="$("${DIRNAME}" "${wd}/${1}")"
> > + __destdir="$("${DIRNAME}" "${__destfile}")"
> > "${MKDIR}" -p "${__destdir}"
> > -
> > - "${CP}" --parents --preserve=all "${1}" "${wd}"
> > + "${CP}" --parents --preserve=all "${__srcfile}" "${wd}"
> > }
> >
> > # libs_dlopen_copy() - Recursively copy matching libraries from LIBS_DLOPEN
>
--
Lukasz
next prev parent reply other threads:[~2024-09-23 10:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-18 10:12 [PATCH v2 0/4] mbuto: Make it work on Arch Linux Lukasz Gut
2024-09-18 10:12 ` [PATCH v2 1/4] mbuto: Pick a src when ld reported as link by ldd Lukasz Gut
2024-09-23 3:51 ` David Gibson
2024-09-23 10:09 ` Lukasz Gut
2024-09-18 10:12 ` [PATCH v2 2/4] mbuto: Use realpath to copy ld Lukasz Gut
2024-09-23 3:53 ` David Gibson
2024-09-23 10:09 ` Lukasz Gut [this message]
2024-09-18 10:12 ` [PATCH v2 3/4] mbuto: Don't try to add ld when adding libraries Lukasz Gut
2024-09-18 10:12 ` [PATCH v2 4/4] mbuto: Automatically add links related to linker Lukasz Gut
2024-09-23 3:54 ` David Gibson
2024-09-23 10:09 ` Lukasz Gut
2024-09-23 3:45 ` [PATCH v2 0/4] mbuto: Make it work on Arch Linux David Gibson
2024-09-23 10:09 ` Lukasz Gut
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=6a278d810d6226ee5840ad40c3cbd03f7a23a3cc.camel@lgut.eu \
--to=lgut@lgut.eu \
--cc=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
--cc=sevinj.aghayeva@gmail.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.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).