unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68058] [PATCH] gnu: cross-gcc-toolchain: Add native-search-paths.
@ 2023-12-27 12:09 Jean-Pierre De Jesus DIAZ via Guix-patches via
  2024-04-09 22:44 ` Thiago Jung Bauermann
  0 siblings, 1 reply; 3+ messages in thread
From: Jean-Pierre De Jesus DIAZ via Guix-patches via @ 2023-12-27 12:09 UTC (permalink / raw)
  To: 68058; +Cc: Jean-Pierre De Jesus DIAZ

* gnu/packages/cross-base.scm (cross-gcc-toolchain): Add
  native-search-paths.

Change-Id: Ib4cc510fde71b8d3140e1001c3931f74300da8a0
---
 gnu/packages/cross-base.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 6ee7b315d8..dc6f7922d6 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -760,6 +760,7 @@ (define* (cross-gcc-toolchain/implementation target
                  (((names . directory) ...)
                   (union-build #$output directory))))))
     (inputs `(,xbinutils ,xgcc ,@(if libc (list libc) '())))
+    (native-search-paths (package-search-paths xgcc))
     (home-page (package-home-page xgcc))
     (synopsis
      (format #f "Complete GCC tool chain for C/C++ development (~a)" target))

base-commit: 756ba0429e84ee0f8ce30484439b78c00c61d286
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#68058] [PATCH] gnu: cross-gcc-toolchain: Add native-search-paths.
  2023-12-27 12:09 [bug#68058] [PATCH] gnu: cross-gcc-toolchain: Add native-search-paths Jean-Pierre De Jesus DIAZ via Guix-patches via
@ 2024-04-09 22:44 ` Thiago Jung Bauermann
  2024-04-10  9:46   ` Jean-Pierre De Jesus Diaz
  0 siblings, 1 reply; 3+ messages in thread
From: Thiago Jung Bauermann @ 2024-04-09 22:44 UTC (permalink / raw)
  To: 68058; +Cc: jean


Hello,

[ What I'm saying here is a duplicate of what I just sent in issue
  #69394, but I think it's useful to have these comments together with
  the patch, to facilitate discussion about it.  ]

Jean-Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org> writes:

> * gnu/packages/cross-base.scm (cross-gcc-toolchain): Add
>   native-search-paths.
>
> Change-Id: Ib4cc510fde71b8d3140e1001c3931f74300da8a0
> ---
>  gnu/packages/cross-base.scm | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
> index 6ee7b315d8..dc6f7922d6 100644
> --- a/gnu/packages/cross-base.scm
> +++ b/gnu/packages/cross-base.scm
> @@ -760,6 +760,7 @@ (define* (cross-gcc-toolchain/implementation target
>                   (((names . directory) ...)
>                    (union-build #$output directory))))))
>      (inputs `(,xbinutils ,xgcc ,@(if libc (list libc) '())))
> +    (native-search-paths (package-search-paths xgcc))
>      (home-page (package-home-page xgcc))
>      (synopsis
>       (format #f "Complete GCC tool chain for C/C++ development (~a)" target))
>
> base-commit: 756ba0429e84ee0f8ce30484439b78c00c61d286

Today I ran into the problem described in issue 69394 with a custom
aarch64-linux-gnu cross toolchain:

$ aarch64-linux-gnu-gcc -o ~/tmp/hello -g ~/tmp/hello.c
aarch64-linux-gnu-ld: cannot find crt1.o: No such file or directory
aarch64-linux-gnu-ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status

And I was able to fix it by locally applying the patch above. Thank you!

IMHO this patch should be applied.

In issue 69394 you wrote that this solution doesn't work when there are
multiple cross toolchains installed on the same profile (the CROSS_
environment variables would have all the cross toolchains), but I think
that moving from allowing zero cross toolchain installed in the
profile¹ to one cross toolchain installed is already an improvement. :-)

--
Thiago

¹ Except for bare-metal cross toolchains, which IIUC don't have this
  problem because they don't use crt*.o files?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#68058] [PATCH] gnu: cross-gcc-toolchain: Add native-search-paths.
  2024-04-09 22:44 ` Thiago Jung Bauermann
@ 2024-04-10  9:46   ` Jean-Pierre De Jesus Diaz
  0 siblings, 0 replies; 3+ messages in thread
From: Jean-Pierre De Jesus Diaz @ 2024-04-10  9:46 UTC (permalink / raw)
  To: Thiago Jung Bauermann; +Cc: 68058, jean

Hi Thiago,

>In issue 69394 you wrote that this solution doesn't work when there are
>multiple cross toolchains installed on the same profile (the CROSS_
>environment variables would have all the cross toolchains), but I think
>that moving from allowing zero cross toolchain installed in the
>profile¹ to one cross toolchain installed is already an improvement. :-)

And

>¹ Except for bare-metal cross toolchains, which IIUC don't have this
>  problem because they don't use crt*.o files?

It's only a problem with the platforms that provide a C standard library so
bare-metal ones are unaffected.  However some of the bare-metal targets
provide a C standard library like `avr' or `arm-none-eabi' which I'm still
working on, they both provide AVR Libc and Newlib respectively and suffer
from the same problem.

That said there's no downside on the patch other than the bad user
experience IMO, but the bad UX is already there anyway but I think also
this should be merged so that we can start making progress towards
having more functional cross toolchain packages.

On Tue, Apr 9, 2024 at 10:44 PM Thiago Jung Bauermann
<thiago.bauermann@linaro.org> wrote:
>
>
> Hello,
>
> [ What I'm saying here is a duplicate of what I just sent in issue
>   #69394, but I think it's useful to have these comments together with
>   the patch, to facilitate discussion about it.  ]
>
> Jean-Pierre De Jesus DIAZ via Guix-patches via <guix-patches@gnu.org> writes:
>
> > * gnu/packages/cross-base.scm (cross-gcc-toolchain): Add
> >   native-search-paths.
> >
> > Change-Id: Ib4cc510fde71b8d3140e1001c3931f74300da8a0
> > ---
> >  gnu/packages/cross-base.scm | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
> > index 6ee7b315d8..dc6f7922d6 100644
> > --- a/gnu/packages/cross-base.scm
> > +++ b/gnu/packages/cross-base.scm
> > @@ -760,6 +760,7 @@ (define* (cross-gcc-toolchain/implementation target
> >                   (((names . directory) ...)
> >                    (union-build #$output directory))))))
> >      (inputs `(,xbinutils ,xgcc ,@(if libc (list libc) '())))
> > +    (native-search-paths (package-search-paths xgcc))
> >      (home-page (package-home-page xgcc))
> >      (synopsis
> >       (format #f "Complete GCC tool chain for C/C++ development (~a)" target))
> >
> > base-commit: 756ba0429e84ee0f8ce30484439b78c00c61d286
>
> Today I ran into the problem described in issue 69394 with a custom
> aarch64-linux-gnu cross toolchain:
>
> $ aarch64-linux-gnu-gcc -o ~/tmp/hello -g ~/tmp/hello.c
> aarch64-linux-gnu-ld: cannot find crt1.o: No such file or directory
> aarch64-linux-gnu-ld: cannot find crti.o: No such file or directory
> collect2: error: ld returned 1 exit status
>
> And I was able to fix it by locally applying the patch above. Thank you!
>
> IMHO this patch should be applied.
>
> In issue 69394 you wrote that this solution doesn't work when there are
> multiple cross toolchains installed on the same profile (the CROSS_
> environment variables would have all the cross toolchains), but I think
> that moving from allowing zero cross toolchain installed in the
> profile¹ to one cross toolchain installed is already an improvement. :-)
>
> --
> Thiago
>
> ¹ Except for bare-metal cross toolchains, which IIUC don't have this
>   problem because they don't use crt*.o files?




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-10  9:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27 12:09 [bug#68058] [PATCH] gnu: cross-gcc-toolchain: Add native-search-paths Jean-Pierre De Jesus DIAZ via Guix-patches via
2024-04-09 22:44 ` Thiago Jung Bauermann
2024-04-10  9:46   ` Jean-Pierre De Jesus Diaz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).