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.

/mjt


Reply via email to