qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Akihiko Odaki <akihiko.odaki@gmail.com>
To: Michael Tokarev <mjt@tls.msk.ru>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: get_relocated_path: the configured paths are not looked for?
Date: Mon, 24 Apr 2023 03:24:00 +0900	[thread overview]
Message-ID: <dfa9e438-d1be-caec-6320-c5f196ced2f5@gmail.com> (raw)
In-Reply-To: <0803ed60-9ed6-26aa-f5a8-c955c8ca085a@msgid.tls.msk.ru>

On 2023/04/24 3:10, Michael Tokarev wrote:
> 23.04.2023 20:39, Akihiko Odaki пишет:
>> On 2023/04/23 22:22, Michael Tokarev wrote:
>>> 23.04.2023 14:47, Akihiko Odaki пишет:
>>>
>>> https://salsa.debian.org/qemu-team/qemu/-/commit/e017f53a8550d0bcaaca81c6dacac8ec34295cf0
>>> fwiw.
>>
>> I seriously think you better consult GCC and other package maintainers 
>> to have consensus on handling this kind of scenario. Otherwise you 
>> don't get the behavior you expect from other packages.
> 
> I know no other software which does this.  It's interesting you 
> mentioned GCC, -
> I've seen it is doing that for years, wondered why.  But it works just fine
> when moved elsewhere - I just tried compiling a hello.c program by
> /tmp/gcc, it works exactly the same way as compiled by /usr/bin/gcc.
> And wast majority of software available on linux does not do these funny
> tricks with relative-to-executable paths (I can't say for *all* software,
> but it is definitely uncommon and I know no other examples).  Only qemu
> is broken in this context.  The patch above fixes this breakage.
> 
> /mjt

Well for me GCC can't find cc1 as I pointed out earlier. The below is a 
simple reproduction case using Podman:
podman run --rm -i debian <<EOS
apt-get update
apt-get install -y gcc
cp /usr/bin/gcc /tmp
cat > a.c <<EOC
int main()
{
}
EOC
/tmp/gcc a.c
EOS

The output ends with:
gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
compilation terminated.

This is because GCC uses relative paths to find cc1 and other files.

Regards,
Akihiko Odaki


  reply	other threads:[~2023-04-23 18:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-19  7:32 get_relocated_path: the configured paths are not looked for? Michael Tokarev
2023-04-20  5:29 ` Akihiko Odaki
2023-04-23 10:28   ` Michael Tokarev
2023-04-23 11:22     ` Akihiko Odaki
2023-04-23 11:31       ` Michael Tokarev
2023-04-23 11:47         ` Akihiko Odaki
2023-04-23 13:22           ` Michael Tokarev
2023-04-23 17:39             ` Akihiko Odaki
2023-04-23 18:10               ` Michael Tokarev
2023-04-23 18:24                 ` Akihiko Odaki [this message]
2023-04-23 18:33                   ` Michael Tokarev
2023-04-23 18:37                     ` Michael Tokarev
2023-04-23 18:39                       ` Akihiko Odaki

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=dfa9e438-d1be-caec-6320-c5f196ced2f5@gmail.com \
    --to=akihiko.odaki@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).