GNU bug report logs -
#75483
[PATCH] gnu: gcc-4.7: Fix slash in startfile prefix.
Previous Next
Reported by: Leo Nikkilä <hello <at> lnikki.la>
Date: Sat, 11 Jan 2025 01:46:01 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 75483 in the body.
You can then email your comments to 75483 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#75483
; Package
guix-patches
.
(Sat, 11 Jan 2025 01:46:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo Nikkilä <hello <at> lnikki.la>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Sat, 11 Jan 2025 01:46:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
These prefixes must have a trailing slash.[0] When this slash is
omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set:
$ uname -a
Linux guix 6.10.14-gnu #1 SMP PREEMPT_DYNAMIC 1 aarch64 GNU/Linux
$ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc hello.c'
ld: cannot find crt1.o: No such file or directory
ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
I ran into this when building Yocto images in Guix containers, where
bitbake resets the environment and expects an FHS system.
Looking at `-print-search-dirs', the prefix is definitely present at the
end of the startfiles prefixes list[1]:
$ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc -print-search-dirs'
<...>
libraries: <...>:/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib
However, looking closer with strace, gcc is trying to find crt1.o at
`/lib../lib/crt1.o' and `/libcrt1.o', which are paths that have been
mangled due to the missing slash:
$ guix shell --pure gcc-toolchain strace -- /bin/sh -c 'LIBRARY_PATH= strace -e trace=file gcc hello.c' 2>&1 | grep /gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib
<...>
faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib../lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/libcrt1.o", R_OK) = -1 ENOENT (No such file or directory)
<...>
[0]: <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=92c92996401005a9ad17fecd1af4385833785cec;hb=HEAD#l1610>
[1]: <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=92c92996401005a9ad17fecd1af4385833785cec;hb=HEAD#l8604>
* gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix.
[arguments]: <#:phases>: Fix it.
---
gnu/packages/gcc.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 6247919fec..3af2fe5c31 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -285,7 +285,7 @@ (define-public gcc-4.7
\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
libc libc libdir suffix))
(("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
- (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
+ (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\"
#define STANDARD_STARTFILE_PREFIX_2 \"\"
~a"
libc line)))
@@ -299,7 +299,7 @@ (define-public gcc-4.7
\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib -lgcc_s}} \" ~a"
libc libc libdir suffix))
(("#define STARTFILE_LINUX_SPEC.*$" line)
- (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
+ (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib/\"
#define STANDARD_STARTFILE_PREFIX_2 \"\"
~a"
libc line))))
--
2.46.0
Reply sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
You have taken responsibility.
(Thu, 16 Jan 2025 22:45:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Leo Nikkilä <hello <at> lnikki.la>
:
bug acknowledged by developer.
(Thu, 16 Jan 2025 22:45:02 GMT)
Full text and
rfc822 format available.
Message #10 received at 75483-done <at> debbugs.gnu.org (full text, mbox):
Hi Leo,
Leo Nikkilä <hello <at> lnikki.la> skribis:
> These prefixes must have a trailing slash.[0] When this slash is
> omitted, gcc fails to find ?crt*.o files when LIBRARY_PATH is not set:
>
> $ uname -a
> Linux guix 6.10.14-gnu #1 SMP PREEMPT_DYNAMIC 1 aarch64 GNU/Linux
> $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc hello.c'
> ld: cannot find crt1.o: No such file or directory
> ld: cannot find crti.o: No such file or directory
> collect2: error: ld returned 1 exit status
>
> I ran into this when building Yocto images in Guix containers, where
> bitbake resets the environment and expects an FHS system.
>
> Looking at `-print-search-dirs', the prefix is definitely present at the
> end of the startfiles prefixes list[1]:
>
> $ guix shell --pure gcc-toolchain -- /bin/sh -c 'LIBRARY_PATH= gcc -print-search-dirs'
> <...>
> libraries: <...>:/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib
>
> However, looking closer with strace, gcc is trying to find crt1.o at
> `/lib../lib/crt1.o' and `/libcrt1.o', which are paths that have been
> mangled due to the missing slash:
>
> $ guix shell --pure gcc-toolchain strace -- /bin/sh -c 'LIBRARY_PATH= strace -e trace=file gcc hello.c' 2>&1 | grep /gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib
> <...>
> faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/lib../lib/crt1.o", R_OK) = -1 ENOENT (No such file or directory)
> faccessat(AT_FDCWD, "/gnu/store/3gvs8sw95ldfypr1n688svl5brwdmdi9-glibc-2.39/libcrt1.o", R_OK) = -1 ENOENT (No such file or directory)
> <...>
>
> [0]: <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=92c92996401005a9ad17fecd1af4385833785cec;hb=HEAD#l1610>
> [1]: <https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/gcc.cc;h=92c92996401005a9ad17fecd1af4385833785cec;hb=HEAD#l8604>
>
> * gnu/packages/gcc.scm (gcc-4.7): Fix replaced startfile prefix.
> [arguments]: <#:phases>: Fix it.
Good catch. Pushed to the ‘core-packages-team’ branch. (You can see
the position of this branch in the merge queue at
<https://qa.guix.gnu.org/>.)
Now’s a good time if you have other world-rebuild toolchain changes like
this one to submit them!
Thanks,
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#75483
; Package
guix-patches
.
(Fri, 17 Jan 2025 03:19:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 75483 <at> debbugs.gnu.org (full text, mbox):
Thanks!
> Now’s a good time if you have other world-rebuild toolchain changes like
> this one to submit them!
Here's one more I found and just submitted:
<https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75620>
With these two changes I'm now able to build a Yocto image on Guix :-)
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 14 Feb 2025 12:24:20 GMT)
Full text and
rfc822 format available.
This bug report was last modified 27 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.