caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler
@ 2015-06-07 17:44 Nicolas Ojeda Bar
  2016-09-10 16:41 ` Richard W.M. Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Ojeda Bar @ 2015-06-07 17:44 UTC (permalink / raw)
  To: caml-list

Dear list,

I am happy two announce an ALPHA release of a new native-code backend
for the OCaml compiler.

It targets the RISC-V instruction set (http://riscv.org) being
developed at UC Berkeley.  The lowRISC project at the University of
Cambridge (http://www.lowrisc.org) is developing open-source SoCs
based on this instruction set.

This release is in the form of a cross-compiler.  It depends on the
cross-compiling support recently added to 4.02.0+trunk.  It outputs
ELF binaries that can be simulated directly on the RISC-V ISA
simulator (spike) or run natively in a suitable virtual machine.

For detailed installation instructions, please visit:
https://github.com/nojb/riscv-ocamlopt.

The new backend is based on the old 3.12 MIPS backend and the
currently shipping arm64 backend.  Most compiler tests that can
compile in the RISC-V environment pass successfully (including the
"big" ones such as misc-bk, misc/hamming, misc/boyer, misc/nucleic,
misc/bdd, etc.).

Limitations (some are due to the state of RISC-V software tools, some
are due to limitations of the cross-compiling support in the current
OCaml compiler, some just need work):

- Only 64-bit for now (in particular the host has to be 64-bit as well)
- Unix module is not yet supported
- The current version uses the Newlib C library, which is somewhat
less capable than glibc.
- Shared library support may or may not work (has not been tested)

Planned short term improvements (patches welcome!):

- 32-bit support
- cfi directives (and/or frame pointer inclusion) for easier debugging
- switch to glibc
- soft float support
- Unix support

Development is ongoing.

Suggestions, questions of any kind very welcome!

Thanks very much,

Best wishes,
Nicolas

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

* Re: [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler
  2015-06-07 17:44 [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler Nicolas Ojeda Bar
@ 2016-09-10 16:41 ` Richard W.M. Jones
  2016-09-10 16:49   ` Gabriel Scherer
  0 siblings, 1 reply; 5+ messages in thread
From: Richard W.M. Jones @ 2016-09-10 16:41 UTC (permalink / raw)
  To: Nicolas Ojeda Bar; +Cc: caml-list

(Resurrecting the old thread ...)

On Sun, Jun 07, 2015 at 11:14:16PM +0530, Nicolas Ojeda Bar wrote:
> This release is in the form of a cross-compiler.  It depends on the
> cross-compiling support recently added to 4.02.0+trunk.  It outputs
> ELF binaries that can be simulated directly on the RISC-V ISA
> simulator (spike) or run natively in a suitable virtual machine.
> 
> For detailed installation instructions, please visit:
> https://github.com/nojb/riscv-ocamlopt.

Hi Nicolas,

I'm confused here -- where is the upstream source?  For example, is
there a fork of the upstream OCaml git repo with your changes on top?

Rich.

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

* Re: [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler
  2016-09-10 16:41 ` Richard W.M. Jones
@ 2016-09-10 16:49   ` Gabriel Scherer
  2016-09-10 17:08     ` Richard W.M. Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Gabriel Scherer @ 2016-09-10 16:49 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Nicolas Ojeda Bar, caml users

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

The given link is an opam repository that contains a description of the
forked compiler for easy installation via opam. Looking at the description
file for the compiler


https://github.com/nojb/riscv-ocamlopt/blob/master/compilers/4.02.0/4.02.0%2Briscv64-unknown-elf/4.02.0%2Briscv64-unknown-elf.comp

it appears that the upstream source (currently) is a branch of the
github:nojb/ocaml repository:

  https://github.com/nojb/ocaml/commits/4.02.0%2Briscv64-unknown-elf

On Sat, Sep 10, 2016 at 12:41 PM, Richard W.M. Jones <rich@annexia.org>
wrote:

> (Resurrecting the old thread ...)
>
> On Sun, Jun 07, 2015 at 11:14:16PM +0530, Nicolas Ojeda Bar wrote:
> > This release is in the form of a cross-compiler.  It depends on the
> > cross-compiling support recently added to 4.02.0+trunk.  It outputs
> > ELF binaries that can be simulated directly on the RISC-V ISA
> > simulator (spike) or run natively in a suitable virtual machine.
> >
> > For detailed installation instructions, please visit:
> > https://github.com/nojb/riscv-ocamlopt.
>
> Hi Nicolas,
>
> I'm confused here -- where is the upstream source?  For example, is
> there a fork of the upstream OCaml git repo with your changes on top?
>
> Rich.
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

[-- Attachment #2: Type: text/html, Size: 2546 bytes --]

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

* Re: [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler
  2016-09-10 16:49   ` Gabriel Scherer
@ 2016-09-10 17:08     ` Richard W.M. Jones
  2016-09-10 18:10       ` Nicolas Ojeda Bar
  0 siblings, 1 reply; 5+ messages in thread
From: Richard W.M. Jones @ 2016-09-10 17:08 UTC (permalink / raw)
  To: Gabriel Scherer; +Cc: Nicolas Ojeda Bar, caml users

On Sat, Sep 10, 2016 at 12:49:45PM -0400, Gabriel Scherer wrote:
> The given link is an opam repository that contains a description of the
> forked compiler for easy installation via opam. Looking at the description
> file for the compiler
> 
> 
> https://github.com/nojb/riscv-ocamlopt/blob/master/compilers/4.02.0/4.02.0%2Briscv64-unknown-elf/4.02.0%2Briscv64-unknown-elf.comp
> 
> it appears that the upstream source (currently) is a branch of the
> github:nojb/ocaml repository:
> 
>   https://github.com/nojb/ocaml/commits/4.02.0%2Briscv64-unknown-elf

Just what I was looking for, thanks.

FWIW we are currently porting Fedora to RISC-V, so of course I
want to have a go at compiling OCaml too.

https://fedoraproject.org/wiki/Architectures/RISC-V

Rich.

-- 
Richard Jones

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

* Re: [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler
  2016-09-10 17:08     ` Richard W.M. Jones
@ 2016-09-10 18:10       ` Nicolas Ojeda Bar
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Ojeda Bar @ 2016-09-10 18:10 UTC (permalink / raw)
  To: Richard W.M. Jones; +Cc: Gabriel Scherer, caml users

Hi Richard,

- As Gabriel explained the upstream is the branch riscv64-unknown-elf
of the official 4.02 release found at
github.com/nojb/ocaml.  It should be trivial to bring it up to date (I
will do it if there is interest).

- I have been following your efforts on the RISC-V mailing list and I
agree that it would be great to have
OCaml running in Fedora userland on RISC-V.  The native-code backend I
wrote was only tested with the spike simulator
(I don't remember the details now, but I had to build OCaml with
newlib instead of libc for this).

Do get back to me if you detect any issues with the port - I haven't
updated it in quite some time and some adjustments may be
needed.

Are there any step-by-step instructions on how to run Fedora on RISC-V
at this stage ?

Thanks!

Best wishes,
Nicolas


On Sat, Sep 10, 2016 at 7:08 PM, Richard W.M. Jones <rich@annexia.org> wrote:
> On Sat, Sep 10, 2016 at 12:49:45PM -0400, Gabriel Scherer wrote:
>> The given link is an opam repository that contains a description of the
>> forked compiler for easy installation via opam. Looking at the description
>> file for the compiler
>>
>>
>> https://github.com/nojb/riscv-ocamlopt/blob/master/compilers/4.02.0/4.02.0%2Briscv64-unknown-elf/4.02.0%2Briscv64-unknown-elf.comp
>>
>> it appears that the upstream source (currently) is a branch of the
>> github:nojb/ocaml repository:
>>
>>   https://github.com/nojb/ocaml/commits/4.02.0%2Briscv64-unknown-elf
>
> Just what I was looking for, thanks.
>
> FWIW we are currently porting Fedora to RISC-V, so of course I
> want to have a go at compiling OCaml too.
>
> https://fedoraproject.org/wiki/Architectures/RISC-V
>
> Rich.
>
> --
> Richard Jones

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

end of thread, other threads:[~2016-09-10 18:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-07 17:44 [Caml-list] [ANN] RISC-V backend for the native-code OCaml compiler Nicolas Ojeda Bar
2016-09-10 16:41 ` Richard W.M. Jones
2016-09-10 16:49   ` Gabriel Scherer
2016-09-10 17:08     ` Richard W.M. Jones
2016-09-10 18:10       ` Nicolas Ojeda Bar

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 NNTP newsgroup(s).