On 2023/04/24 3:37, Michael Tokarev wrote:
23.04.2023 21:33, Michael Tokarev пишет:

$ cd /tmp; printf '#include <stdio.h>\nint main(){puts("Hello!");return 0;}' > hello.c; cp /usr/bin/gcc .; ./gcc hello.c; ./a.out ; ./gcc --version; ls -l gcc; cd /tmp
Hello!

execve("/tmp/../lib/gcc/x86_64-linux-gnu/12/cc1", [...])

Since this is merged-usr system, it finds its component just fine,
that's why it works here in /tmp, doesn't work in a subdir of /tmp,
and doesn't work in your case (non-merged /usr).

Still, GCC is an exception. It is very rare.

Oh, I was just wondering why it worked and digging what's going on. Thanks for the answer.

Well, I have nothing to say GCC is an exception or not, but it's certainly an important program so I still think it's better to talk with GCC packagers (and upstream developers perhaps?)

Regards,
Akihiko Odaki


/mjt


Reply via email to