mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Gry Gunvor <gry.gunvor@gmail.com>
To: musl@lists.openwall.com
Subject: porting musl to RISCV-64
Date: Tue, 10 May 2016 23:05:01 -0700	[thread overview]
Message-ID: <CA+mdN-HLgwVoP9yq3fu_5_9Oru=WTh82P6jkRcg_8S4tx21sDA@mail.gmail.com> (raw)

I am interested in compiling for RISCV-64 (http://riscv.org/) using a
libc that I compile myself so that I can run it through some
source-to-source transformations before compiling it.  The default
RISCV tools will target their ports of either gnu libc or newlib.  Gnu
libc is huge, so I would rather avoid it; also I would rather use
something released under a permissive open source license (BSD).
Newlib is small, but I am not interested in multithreading and the
multithreading/reentrancy support they have built into the library is
causing me problems.  So I thought I would try musl.

I'm running on a vanilla Ubuntu 14.04 x86 machine and muscl builds out
of the box.  Using your gcc wrapper, hello world links and runs.  I
tried wrapping malloc at link time and that worked.  Thus, so far,
muscl is working great.

FYI: You might want to know that this recent post on the subject of
teaching C speaks of musl as "high-quality":
http://blog.regehr.org/archives/1393
"We’ll want some lecture material about C’s place in the modern world
and we also need to spend time reading some high-quality C code,
perhaps starting with Redis, Musl, or Xv6. Musl, in particular, is a
good match for teaching since it contains lots of cute little
functions that can be understood in isolation."

Anyway, suppose I want to port musl to RISCV-64 and cross-compile it.
MIPS is a RISC architecture that is rather close to RISCV, but your
MIPS support says 32-bit (and big-endian), so I take it you have some
dependencies on what used to be called the "machine word size" (RISCV
is 64-bit, but the RISCV docs still call a 32-bit unit a "word"; ugh;
so now we need a new word for "word").  Thus I suspect that this is
going to be non-trival.  How much work is this going to be?  Hints?

More generally, any comments on what do you recommend as the easiest
thing to do?  Port musl to RISCV-64?  Use a different libc?  For those
of you who know newlib, hack newlib to remove reentrancy goop?

Gry


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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11  6:05 Gry Gunvor [this message]
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
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='CA+mdN-HLgwVoP9yq3fu_5_9Oru=WTh82P6jkRcg_8S4tx21sDA@mail.gmail.com' \
    --to=gry.gunvor@gmail.com \
    --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).