mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: porting musl to RISCV-64
Date: Wed, 11 May 2016 19:28:47 +0200	[thread overview]
Message-ID: <20160511172847.GC22574@port70.net> (raw)
In-Reply-To: <CA+mdN-GPq-zV7_zOGCcCJqu07nzir7N_hCZ=4b7oRwOPVj9jfA@mail.gmail.com>

* Gry Gunvor <gry.gunvor@gmail.com> [2016-05-11 09:40:42 -0700]:
> Here's another way to put my question: I've already written my own
> ghetto riscv-64 libc for synchronous programming (no threads, signals)
> by writing my own version of what you call syscall_arch.h.  Therefore,
> how hard would it be to factor musl so that syscall_arch.h was all I
> was depending on that is arch dependent?  It seems that should get me

the previous riscv port attempt might be enough for you
https://github.com/lluixhi/musl-riscv
but i've never used any of the riscv stuff.

> a lot of what libc provides.  I would want that if I attempt to
> compile a program that does more than that, say, attempts to use
> threads/signals/something-weird that I just get a compile-time error.
> Here's a naive plan:
> 
>  * grep for the inclusion of the other header files in arch other than
> syscall_arch.h;
> 
>  * for .c files, comment them out in the makefile;
> 
>  * for .h files, insert an #error directive.
> 
> What will go wrong?
> 

there are lot of subtle issues that may or may not matter for you.

> Gry
> 
> 
> On Wed, May 11, 2016 at 9:32 AM, Gry Gunvor <gry.gunvor@gmail.com> wrote:
> > On Wed, May 11, 2016 at 4:25 AM, Szabolcs Nagy <nsz@port70.net> wrote:
> >
> >> newlib is for baremetal development, you don't
> >> need to use threading with it
> >
> > It's attempt at reentrancy support is causing me problems.
> >
> >> musl now has 32bit mips, mips64 and mipsn32 support as well.
> >> these are different abis so they have to be separate ports,
> >> same is true for the riscv targets.
> >
> > Your documentation does not seem to mention the MIPS64 port, but now
> > that I look in arch, I see the directory for it.
> >
> >> there is a google summer of code project to add riscv support
> >> http://www.openwall.com/lists/musl/2016/04/27/3
> >> i think it is supposed to provide a working port within 1-2
> >> months (?) so if you can wait you don't need to do much work.
> >
> > Suppose I can't wait and I attempt this myself.  Right now I'm just
> > trying to get a generic libc working.  I do not want to handle
> > multi-threading or signals.  What can I omit?  Are the
> > non-portabilities isolated in arch/ ?  That is, is there much more to
> > it than cloning the arch/mips64 directory and hacking on it?
> >
> > atomic_arch.h: I think I can make all of these functions empty as I am
> > not going to be using multi-threading, right?
> >
> > crt_arch.h: program startup; what is this doing in a libc
> > implementation?  doesn't the compiler handle this?
> >
> > ksigaction.h: sorry, I'm not a hardware person; I suppose different
> > hardware has a different default layout for a signal object? so this
> > is not a thing determined by kernel software?  I don't care to handle
> > signals right now anyway.
> >
> > pthread_arch.h: again, I think I can make all of these functions empty
> > as I am not going to be using multi-threading.
> >
> > reloc.h: I can't figure out what this is.
> >
> > syscall_arch.h: I've already written this for RISCV-64 (and so have
> > the RISCV people).
> >
> > bits: to what extent is this MIPS64-specific?  since there is *no*
> > inline assembly, how come arch/generic/ doesn't do here?
> >
> > Gry


  reply	other threads:[~2016-05-11 17:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  6:05 Gry Gunvor
2016-05-11 11:25 ` Szabolcs Nagy
2016-05-11 16:32   ` Gry Gunvor
2016-05-11 16:40     ` Gry Gunvor
2016-05-11 17:28       ` Szabolcs Nagy [this message]
2016-05-11 18:48     ` Bobby Bingham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160511172847.GC22574@port70.net \
    --to=nsz@port70.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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