public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Can CT-NG build a RISC-V picolibc toolchain?
@ 2022-08-26 19:41 Tommy Murphy
  2022-08-26 19:41 ` Tommy Murphy
  2022-08-26 20:37 ` Keith Packard
  0 siblings, 2 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-26 19:41 UTC (permalink / raw)
  To: crossgcc

Hi there

Apologies in advance if this is a dumb question or one that has been answered already but I tried searching but couldn't find anything on it...

Can I use CT-NG to build a RISC-V bare metal toolchain that uses picolibc as the standard library? Can I build one that bundles newlib, newlib-nano and picolibc which can be switched between using the relevant specs files as can be done for Arm?

If so, what configuration settings do I need? I can't see a way to do this using the menuconfig. If it's possible, does it perhaps need a manually edited config file?

I've been playing with the latest CT-NG cloned from the master branch in github. I've enabled the experimental option in order to be able to build a RISC-V newlib toolchain which works fine. But I can't see a way to build a picolibc one or a newlib/newlib-nano/picolibc one. I've also used one of the sample configurations to build an Arm multilib toolchain that bundles newlib/newlib-nano/picolibc.

Thanks a lot for any guidance/advice.

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

* Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-26 19:41 Can CT-NG build a RISC-V picolibc toolchain? Tommy Murphy
@ 2022-08-26 19:41 ` Tommy Murphy
  2022-08-26 20:37 ` Keith Packard
  1 sibling, 0 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-26 19:41 UTC (permalink / raw)
  To: crossgcc

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Hi there

Apologies in advance if this is a dumb question or one that has been answered already but I tried searching but couldn't find anything on it...

Can I use CT-NG to build a RISC-V bare metal toolchain that uses picolibc as the standard library? Can I build one that bundles newlib, newlib-nano and picolibc which can be switched between using the relevant specs files as can be done for Arm?

If so, what configuration settings do I need? I can't see a way to do this using the menuconfig. If it's possible, does it perhaps need a manually edited config file?

I've been playing with the latest CT-NG cloned from the master branch in github. I've enabled the experimental option in order to be able to build a RISC-V newlib toolchain which works fine. But I can't see a way to build a picolibc one or a newlib/newlib-nano/picolibc one. I've also used one of the sample configurations to build an Arm multilib toolchain that bundles newlib/newlib-nano/picolibc.

Thanks a lot for any guidance/advice.

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-26 19:41 Can CT-NG build a RISC-V picolibc toolchain? Tommy Murphy
  2022-08-26 19:41 ` Tommy Murphy
@ 2022-08-26 20:37 ` Keith Packard
  2022-08-26 21:09   ` Tommy Murphy
  1 sibling, 1 reply; 10+ messages in thread
From: Keith Packard @ 2022-08-26 20:37 UTC (permalink / raw)
  To: Tommy Murphy, crossgcc

[-- Attachment #1: Type: text/plain, Size: 771 bytes --]

Tommy Murphy via crossgcc <crossgcc@sourceware.org> writes:

> Can I use CT-NG to build a RISC-V bare metal toolchain that uses
> picolibc as the standard library? Can I build one that bundles newlib,
> newlib-nano and picolibc which can be switched between using the
> relevant specs files as can be done for Arm?

Yup. The "trick" is that newlib-nano and picolibc are 'companion'
libraries, so you won't find them in the obvious place in the
menus. That was the easy way to integrate all three C libraries into the
existing ct-ng code.

I just tried building a riscv toolchain with ct-ng master and it worked
fine. I started with riscv32-unknown-elf, added multilib, newlib-nano
and picolibc. I did have to explicitly disable default-pie.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-26 20:37 ` Keith Packard
@ 2022-08-26 21:09   ` Tommy Murphy
  2022-08-26 21:09     ` Tommy Murphy
  0 siblings, 1 reply; 10+ messages in thread
From: Tommy Murphy @ 2022-08-26 21:09 UTC (permalink / raw)
  To: Keith Packard, crossgcc

Hi Keith

Thanks a lot. I'll try again tomorrow and see how it goes and post back if necessary.

Thanks again

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-26 21:09   ` Tommy Murphy
@ 2022-08-26 21:09     ` Tommy Murphy
  0 siblings, 0 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-26 21:09 UTC (permalink / raw)
  To: Keith Packard, crossgcc

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

Hi Keith

Thanks a lot. I'll try again tomorrow and see how it goes and post back if necessary.

Thanks again

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-27 20:11 ` Tommy Murphy
  2022-08-27 20:11   ` Tommy Murphy
@ 2022-08-27 21:15   ` Keith Packard
  1 sibling, 0 replies; 10+ messages in thread
From: Keith Packard @ 2022-08-27 21:15 UTC (permalink / raw)
  To: Tommy Murphy, crossgcc

[-- Attachment #1: Type: text/plain, Size: 701 bytes --]

Tommy Murphy <tommy_murphy@hotmail.com> writes:

> Hi Keith
>
> So, my (non multilib for now) build of the RISC-V tools with newlib,
> newlib-nano and picolibc succeeded. I also had to disable the PIC
> option. With it enabled the picolibc build failed with an error about
> not being able to find the dynamic linker (sorry, forgot to save the
> verbatim error). Do you have the idea why that happens? I guess that
> PIC is largely, or maybe totally, irrelevant for a bare metal
> toolchain with no shared lib requirements?

Yup, you don't need pic as you won't have a dynamic linker.

> Thanks again for your help in making progress on this.

Glad you got it working.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-27 14:22 Tommy Murphy
  2022-08-27 14:22 ` Tommy Murphy
@ 2022-08-27 20:11 ` Tommy Murphy
  2022-08-27 20:11   ` Tommy Murphy
  2022-08-27 21:15   ` Keith Packard
  1 sibling, 2 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-27 20:11 UTC (permalink / raw)
  To: Keith Packard, crossgcc

Hi Keith

So, my (non multilib for now) build of the RISC-V tools with newlib, newlib-nano and picolibc succeeded. I also had to disable the PIC option. With it enabled the picolibc build failed with an error about not being able to find the dynamic linker (sorry, forgot to save the verbatim error). Do you have the idea why that happens? I guess that PIC is largely, or maybe totally, irrelevant for a bare metal toolchain with no shared lib requirements?

Thanks again for your help in making progress on this.
________________________________
From: Tommy Murphy <tommy_murphy@hotmail.com>
Sent: Saturday, August 27, 2022 3:22:42 PM
To: Keith Packard <keithp@keithp.com>; crossgcc@sourceware.org <crossgcc@sourceware.org>
Subject: Re: Can CT-NG build a RISC-V picolibc toolchain?

Ok - maybe it was a bit of a dumb question!
I completely overlooked the fact that the Companion Libraries section of menuconfig has options for newlib-nano and picolibc.
I was fixated on the C Library section so missed these.
I'm trying a new build now with these enabled (newlib, newlib-nano and picolibc).
Thanks again for the assistance.

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-27 20:11 ` Tommy Murphy
@ 2022-08-27 20:11   ` Tommy Murphy
  2022-08-27 21:15   ` Keith Packard
  1 sibling, 0 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-27 20:11 UTC (permalink / raw)
  To: Keith Packard, crossgcc

[-- Attachment #1: Type: text/plain, Size: 1141 bytes --]

Hi Keith

So, my (non multilib for now) build of the RISC-V tools with newlib, newlib-nano and picolibc succeeded. I also had to disable the PIC option. With it enabled the picolibc build failed with an error about not being able to find the dynamic linker (sorry, forgot to save the verbatim error). Do you have the idea why that happens? I guess that PIC is largely, or maybe totally, irrelevant for a bare metal toolchain with no shared lib requirements?

Thanks again for your help in making progress on this.
________________________________
From: Tommy Murphy <tommy_murphy@hotmail.com>
Sent: Saturday, August 27, 2022 3:22:42 PM
To: Keith Packard <keithp@keithp.com>; crossgcc@sourceware.org <crossgcc@sourceware.org>
Subject: Re: Can CT-NG build a RISC-V picolibc toolchain?

Ok - maybe it was a bit of a dumb question!
I completely overlooked the fact that the Companion Libraries section of menuconfig has options for newlib-nano and picolibc.
I was fixated on the C Library section so missed these.
I'm trying a new build now with these enabled (newlib, newlib-nano and picolibc).
Thanks again for the assistance.

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
@ 2022-08-27 14:22 Tommy Murphy
  2022-08-27 14:22 ` Tommy Murphy
  2022-08-27 20:11 ` Tommy Murphy
  0 siblings, 2 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-27 14:22 UTC (permalink / raw)
  To: Keith Packard, crossgcc

Ok - maybe it was a bit of a dumb question!
I completely overlooked the fact that the Companion Libraries section of menuconfig has options for newlib-nano and picolibc.
I was fixated on the C Library section so missed these.
I'm trying a new build now with these enabled (newlib, newlib-nano and picolibc).
Thanks again for the assistance.

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

* Re: Can CT-NG build a RISC-V picolibc toolchain?
  2022-08-27 14:22 Tommy Murphy
@ 2022-08-27 14:22 ` Tommy Murphy
  2022-08-27 20:11 ` Tommy Murphy
  1 sibling, 0 replies; 10+ messages in thread
From: Tommy Murphy @ 2022-08-27 14:22 UTC (permalink / raw)
  To: Keith Packard, crossgcc

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

Ok - maybe it was a bit of a dumb question!
I completely overlooked the fact that the Companion Libraries section of menuconfig has options for newlib-nano and picolibc.
I was fixated on the C Library section so missed these.
I'm trying a new build now with these enabled (newlib, newlib-nano and picolibc).
Thanks again for the assistance.

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

end of thread, other threads:[~2022-08-27 21:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-26 19:41 Can CT-NG build a RISC-V picolibc toolchain? Tommy Murphy
2022-08-26 19:41 ` Tommy Murphy
2022-08-26 20:37 ` Keith Packard
2022-08-26 21:09   ` Tommy Murphy
2022-08-26 21:09     ` Tommy Murphy
2022-08-27 14:22 Tommy Murphy
2022-08-27 14:22 ` Tommy Murphy
2022-08-27 20:11 ` Tommy Murphy
2022-08-27 20:11   ` Tommy Murphy
2022-08-27 21:15   ` Keith Packard

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).