[PATCH] RISC-V: Support for FreeBSD

15 views
Skip to first unread message

Kito Cheng

unread,
Jan 28, 2018, 10:26:38 PM1/28/18
to gcc-p...@gcc.gnu.org, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Jim Wilson, Palmer Dabbelt, Andrew Waterman
Hi all:

This patch enable RISC-V support FreeBSD, Ruslan (RISC-V FreeBSD
maintainer) and me has been tested on FreeBSD 12 for building kernel
and whole user space programs/libraries.

gcc/ChangeLog

2018-01-29 Ruslan Bukin <b...@bsdpad.com>
Kito Cheng <kito....@gmail.com>

* config.gcc (riscv*-*-freebsd*): New.
* config/riscv/freebsd.h: New.

libgcc/ChangeLog

2018-01-29 Ruslan Bukin <b...@bsdpad.com>

* libgcc/config.host: Support RISC-V FreeBSD.
0001-RISC-V-Add-support-for-FreeBSD.patch

Kito Cheng

unread,
Jan 28, 2018, 10:35:18 PM1/28/18
to binu...@sourceware.org, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Jim Wilson, Palmer Dabbelt, Andrew Waterman
BINUTILS-0001-RISC-V-Add-support-for-FreeBSD.patch

Bernhard Reutner-Fischer

unread,
Jan 29, 2018, 3:13:25 AM1/29/18
to Kito Cheng, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Jim Wilson, Palmer Dabbelt, Andrew Waterman, gcc-p...@gcc.gnu.org
On 29 January 2018 04:26:17 CET, Kito Cheng <kito....@gmail.com> wrote:
>Hi all:
>
>This patch enable RISC-V support FreeBSD, Ruslan (RISC-V FreeBSD
>maintainer) and me has been tested on FreeBSD 12 for building kernel
>and whole user space programs/libraries.

I think the copyright year of the new header should be 2018 alone and not the whole span of 1998-2018 .

Thanks,

Nick Clifton

unread,
Jan 29, 2018, 9:08:07 AM1/29/18
to Kito Cheng, binu...@sourceware.org, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Jim Wilson, Palmer Dabbelt, Andrew Waterman
Hi Kito,

> This patch enable RISC-V support FreeBSD, Ruslan (RISC-V FreeBSD
> maintainer) and me has been tested on FreeBSD 12 for building kernel
> and whole user space programs/libraries.

Does this actually work ?

> riscv*-*-*) fmt=elf endian=little ;;
> + riscv*-*-freebsd*) fmt=elf endian=little em=freebsd ;;

To me it looks like the first line will match "riscv-freebsd" as well,
and since it has precedence the freebsd emulation parameter will not be
set.

Cheers
Nick

Jim Wilson

unread,
Jan 29, 2018, 2:31:53 PM1/29/18
to Nick Clifton, Kito Cheng, binu...@sourceware.org, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Palmer Dabbelt, Andrew Waterman
It does not work, for precisely the reason you mentioned.

It also appears pointless, as the only difference between te-generic.h
and te-freebsd.h is the define of TE_FreeBSD in the latter, but that is
not used anywhere in the RISC-V port. So maybe that is why it "works",
because it is unnecessary. But that also means it is harmless and won't
break anything if it goes in, with the order fixed of course.

I also don't see a copyright assignment for Ruslan. This is probably OK
as a trivial patches, but if there are more patches coming we would need
a copyright assignment.

Jim

Jim Wilson

unread,
Jan 29, 2018, 3:28:45 PM1/29/18
to Kito Cheng, gcc-p...@gcc.gnu.org, pat...@groups.riscv.org, Ruslan Bukin, Ruslan Bukin, Palmer Dabbelt, Andrew Waterman
On 01/28/2018 07:26 PM, Kito Cheng wrote:
> gcc/ChangeLog
>
> 2018-01-29 Ruslan Bukin <b...@bsdpad.com>
> Kito Cheng <kito....@gmail.com>
>
> * config.gcc (riscv*-*-freebsd*): New.
> * config/riscv/freebsd.h: New.
>
> libgcc/ChangeLog
>
> 2018-01-29 Ruslan Bukin <b...@bsdpad.com>
>
> * libgcc/config.host: Support RISC-V FreeBSD.

I don't see a copyright assigment for Ruslan. This patch is big enough
that it requires one.

The config.gcc patch is including dbxelf.h. Stabs support is obsolete
and unmaintained. Do you really need this? If you include this, it
will probably just be dropped soon after the gcc-8 release anyways, so
it is probably better to not include it in the first place.

The libgcc/config.host patch is including files that weren't included in
the patch.

Jim

Kito Cheng

unread,
Jan 29, 2018, 9:46:03 PM1/29/18
to pat...@groups.riscv.org, Nick Clifton, binu...@sourceware.org, Ruslan Bukin, Ruslan Bukin, Palmer Dabbelt, Andrew Waterman
Hi Nick:


> Does this actually work ?
Yes, it's work, I guess it's just because like Jim said, however
Ruslan and me will update and test it again, thanks!

Hi Jim:

Thanks your comment, I will fix the order and try again.
> --
> You received this message because you are subscribed to the Google Groups
> "RISC-V Patches" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to patches+u...@groups.riscv.org.
> To post to this group, send email to pat...@groups.riscv.org.
> Visit this group at
> https://groups.google.com/a/groups.riscv.org/group/patches/.
> To view this discussion on the web visit
> https://groups.google.com/a/groups.riscv.org/d/msgid/patches/09c0a5ac-39f3-ca6d-43aa-2d7951a28911%40sifive.com.
>
> For more options, visit
> https://groups.google.com/a/groups.riscv.org/d/optout.

Kito Cheng

unread,
Jan 29, 2018, 9:55:44 PM1/29/18
to pat...@groups.riscv.org, gcc-p...@gcc.gnu.org, Ruslan Bukin, Ruslan Bukin, Palmer Dabbelt, Andrew Waterman
Hi Bernhard:

Thanks your comment, I'll update that :)

Hi Jim:

> I don't see a copyright assigment for Ruslan. This patch is big enough that it requires one.

I'll ask him for that.

> The config.gcc patch is including dbxelf.h. Stabs support is obsolete and unmaintained. Do you really need this? If you include this, it will probably just be dropped soon after the gcc-8 release anyways, so it is probably better to not include it in the first place.

I'll try to remove that, thanks :)

> The libgcc/config.host patch is including files that weren't included in the patch.

Oh, okay, I guess it's something port from older freebsd riscv-gcc, I
should update that, thanks.
> --
> You received this message because you are subscribed to the Google Groups
> "RISC-V Patches" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to patches+u...@groups.riscv.org.
> To post to this group, send email to pat...@groups.riscv.org.
> Visit this group at
> https://groups.google.com/a/groups.riscv.org/group/patches/.
> To view this discussion on the web visit
> https://groups.google.com/a/groups.riscv.org/d/msgid/patches/b9b59f94-7699-b3f3-0eb8-b06c033c0423%40sifive.com.
Reply all
Reply to author
Forward
0 new messages