public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Applying patches for RISC-V in crosstool-ng
@ 2020-06-15 13:58 Vijay Holimath
  2020-06-15 14:03 ` Jonathan Wakely
  2020-06-15 22:01 ` Jim Wilson
  0 siblings, 2 replies; 6+ messages in thread
From: Vijay Holimath @ 2020-06-15 13:58 UTC (permalink / raw)
  To: gcc-help

Hello All,

I need to apply this patch:
https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
for
RISC-V and build compiler using crosstool-ng. Can you please tell me how to
do it?

Many Thanks,
-Vijay

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

* Re: Applying patches for RISC-V in crosstool-ng
  2020-06-15 13:58 Applying patches for RISC-V in crosstool-ng Vijay Holimath
@ 2020-06-15 14:03 ` Jonathan Wakely
  2020-06-15 14:17   ` Vijay Holimath
  2020-06-15 22:01 ` Jim Wilson
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2020-06-15 14:03 UTC (permalink / raw)
  To: Vijay Holimath; +Cc: gcc-help

On Mon, 15 Jun 2020 at 15:00, Vijay Holimath via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> Hello All,
>
> I need to apply this patch:
> https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
> for
> RISC-V and build compiler using crosstool-ng. Can you please tell me how to
> do it?

That has nothing to do with GCC. Try searching the web for "how to
apply a patch".

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

* Re: Applying patches for RISC-V in crosstool-ng
  2020-06-15 14:03 ` Jonathan Wakely
@ 2020-06-15 14:17   ` Vijay Holimath
  2020-06-15 14:46     ` Jonathan Wakely
  0 siblings, 1 reply; 6+ messages in thread
From: Vijay Holimath @ 2020-06-15 14:17 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

I know in general how to apply patch. But the patch I need to apply is for
RISC-V makefile; in crosstool-ng there seem to be no Makefile for RISC-V. I
think in crosstool-ng you can configure RISC-V options using 'ct-ng
menuconfig' once you configured then one need to use ct-ng build to to
build compiler.  The crosstool-ng will build compiler using the config
options, I think there is no Makefile as such for RISC-V. However, I might
be wrong.

On Mon, Jun 15, 2020 at 7:33 PM Jonathan Wakely <jwakely.gcc@gmail.com>
wrote:

> On Mon, 15 Jun 2020 at 15:00, Vijay Holimath via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
> >
> > Hello All,
> >
> > I need to apply this patch:
> >
> https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
> > for
> > RISC-V and build compiler using crosstool-ng. Can you please tell me how
> to
> > do it?
>
> That has nothing to do with GCC. Try searching the web for "how to
> apply a patch".
>

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

* Re: Applying patches for RISC-V in crosstool-ng
  2020-06-15 14:17   ` Vijay Holimath
@ 2020-06-15 14:46     ` Jonathan Wakely
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Wakely @ 2020-06-15 14:46 UTC (permalink / raw)
  To: Vijay Holimath; +Cc: gcc-help

On Mon, 15 Jun 2020 at 15:17, Vijay Holimath <vijay.holimath@gmail.com> wrote:
>
> I know in general how to apply patch. But the patch I need to apply is for RISC-V makefile; in crosstool-ng there seem to be no Makefile for RISC-V.

OK. That's still nothing to do with GCC. The repository you linked to
is not GCC code. Crosstool-ng is also not GCC code. Maybe you should
ask on a crosstool-ng list, or ask the author of that change.


> I think in crosstool-ng you can configure RISC-V options using 'ct-ng menuconfig' once you configured then one need to use ct-ng build to to build compiler.  The crosstool-ng will build compiler using the config options, I think there is no Makefile as such for RISC-V. However, I might be wrong.
>
> On Mon, Jun 15, 2020 at 7:33 PM Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
>>
>> On Mon, 15 Jun 2020 at 15:00, Vijay Holimath via Gcc-help
>> <gcc-help@gcc.gnu.org> wrote:
>> >
>> > Hello All,
>> >
>> > I need to apply this patch:
>> > https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
>> > for
>> > RISC-V and build compiler using crosstool-ng. Can you please tell me how to
>> > do it?
>>
>> That has nothing to do with GCC. Try searching the web for "how to
>> apply a patch".

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

* Re: Applying patches for RISC-V in crosstool-ng
  2020-06-15 13:58 Applying patches for RISC-V in crosstool-ng Vijay Holimath
  2020-06-15 14:03 ` Jonathan Wakely
@ 2020-06-15 22:01 ` Jim Wilson
  2020-06-16 12:07   ` Vijay Holimath
  1 sibling, 1 reply; 6+ messages in thread
From: Jim Wilson @ 2020-06-15 22:01 UTC (permalink / raw)
  To: Vijay Holimath; +Cc: gcc-help

On Mon, Jun 15, 2020 at 6:59 AM Vijay Holimath via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
> I need to apply this patch:
> https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
> for
> RISC-V and build compiler using crosstool-ng. Can you please tell me how to
> do it?

As Jonathan pointed out this is a crosstools-ng question not a gcc
question.  But crosstools-ng handles patches like many other tools
(buildroot, open-embedded, etc).  You just drop a numbered file into
the package dir, and maybe update a patch file list if they have one.
I don't think that crosstool-ng has a patch file list.  So trying just
dropping a file in the right place.  See for instance
packages/newlib/$VERSION and notice the 0* numbered patch list files.
You need to know which newlib version you are building so that you put
the patch file in the right place.

But looking at the patch file, I see that it is a patch file for
riscv-gnu-toolchain not for newlib.  And the patch file is replacing
newlib with their own newlib port.  If you want to use crosstools-ng,
and replace newlib with a different C library, then you need to make a
change higher up in crosstools-ng.  I don't know offhand how to do
that.  I would guess that you editing packages/newlib/package.desc to
use the alternative git tree would work, but that isn't a clear way to
implement this.  You probably should add the new C library as a new
package, with a description that points at the alternative git tree,
and then change the config to use the alternative C library instead of
newlib.

If you really need to use this patch file, it is probably easier to
just use github.com/riscv/riscv-gnu-toolchain.  But the patch is from
last year, so you might need to use a version of riscv-gnu-toolchain
from last year.

Jim

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

* Re: Applying patches for RISC-V in crosstool-ng
  2020-06-15 22:01 ` Jim Wilson
@ 2020-06-16 12:07   ` Vijay Holimath
  0 siblings, 0 replies; 6+ messages in thread
From: Vijay Holimath @ 2020-06-16 12:07 UTC (permalink / raw)
  To: Jim Wilson; +Cc: gcc-help

Got it Jim..:) Let me try...

On Tue, Jun 16, 2020 at 3:31 AM Jim Wilson <jimw@sifive.com> wrote:

> On Mon, Jun 15, 2020 at 6:59 AM Vijay Holimath via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
> > I need to apply this patch:
> >
> https://github.com/bespoke-silicon-group/bsg_manycore/blob/master/software/riscv-tools/newlib.patch
> > for
> > RISC-V and build compiler using crosstool-ng. Can you please tell me how
> to
> > do it?
>
> As Jonathan pointed out this is a crosstools-ng question not a gcc
> question.  But crosstools-ng handles patches like many other tools
> (buildroot, open-embedded, etc).  You just drop a numbered file into
> the package dir, and maybe update a patch file list if they have one.
> I don't think that crosstool-ng has a patch file list.  So trying just
> dropping a file in the right place.  See for instance
> packages/newlib/$VERSION and notice the 0* numbered patch list files.
> You need to know which newlib version you are building so that you put
> the patch file in the right place.
>
> But looking at the patch file, I see that it is a patch file for
> riscv-gnu-toolchain not for newlib.  And the patch file is replacing
> newlib with their own newlib port.  If you want to use crosstools-ng,
> and replace newlib with a different C library, then you need to make a
> change higher up in crosstools-ng.  I don't know offhand how to do
> that.  I would guess that you editing packages/newlib/package.desc to
> use the alternative git tree would work, but that isn't a clear way to
> implement this.  You probably should add the new C library as a new
> package, with a description that points at the alternative git tree,
> and then change the config to use the alternative C library instead of
> newlib.
>
> If you really need to use this patch file, it is probably easier to
> just use github.com/riscv/riscv-gnu-toolchain.  But the patch is from
> last year, so you might need to use a version of riscv-gnu-toolchain
> from last year.
>
> Jim
>

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

end of thread, other threads:[~2020-06-16 12:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 13:58 Applying patches for RISC-V in crosstool-ng Vijay Holimath
2020-06-15 14:03 ` Jonathan Wakely
2020-06-15 14:17   ` Vijay Holimath
2020-06-15 14:46     ` Jonathan Wakely
2020-06-15 22:01 ` Jim Wilson
2020-06-16 12:07   ` Vijay Holimath

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