https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125593

--- Comment #5 from Stefan Bidigaray <stefanbidi at gmail dot com> ---
I was able to build strace for this host and run it. I'm including what I
believe is the relevant calls only...

For GCC 14.3.0 that does not work:
> stat("/bin/../libexec/gcc/x86_64-linux-musl/14.3.0/cc1", 0x7ffee011cec0) = -1 
> ENOENT (No such file or directory)
> stat("/bin/../libexec/gcc/cc1", 0x7ffee011cec0) = -1 ENOENT (No such file or 
> directory)
> stat("/bin/../lib/gcc/x86_64-linux-musl/14.3.0/../../../../x86_64-linux-musl/bin/x86_64-linux-musl/14.3.0/cc1",
>  0x7ffee011cec0) = -1 ENOENT (No such file or directory)
> stat("/bin/../lib/gcc/x86_64-linux-musl/14.3.0/../../../../x86_64-linux-musl/bin/cc1",
>  0x7ffee011cec0) = -1 ENOENT (No such file or directory)

For GCC 14.2.0 that does work:
> stat("/bin/../lib/gcc/x86_64-linux-musl/14.2.0/cc1", {st_mode=S_IFREG|0755, 
> st_size=331107216, ...}) = 0
> access("/bin/../lib/gcc/x86_64-linux-musl/14.2.0/cc1", X_OK) = 0

It looks like that the only reason that the GCC 14.2.0 build works is because
of the --libexec=/usr/lib, as mentioned, but not for the reason thought. As I
mentioned in my original write up, this is a custom host that I build for
myself. This time around I decided to use a merged-usr set up, so /usr/bin and
/usr/lib are symlinks to /bin and /lib, respectively. From what I gather,
despite specifying --prefix=/usr, GCC's configure identifies that /usr/bin is a
symlink to /bin and uses /bin, instead of /usr/bin to calculate the location of
libexec. 

I rebuilt GCC 14.3.0 with --libexec=/usr/lib and it works without any problems.
I'll try again, at a later time, with 16.1.0.

While I ran into this issue because of the idiosyncrasies of my system (and can
now move forward with the latest release of GCC), I still believe it could be a
bug in GCC's configure. If these files were all installed in /usr/libexec, then
why would they be searched in /bin/../libexec? It seems to be a discrepancy in
the configuration process.

Reply via email to