mailing list of musl libc
 help / color / mirror / code / Atom feed
* porting musl to RISCV-64
@ 2016-05-11  6:05 Gry Gunvor
  2016-05-11 11:25 ` Szabolcs Nagy
  0 siblings, 1 reply; 6+ messages in thread
From: Gry Gunvor @ 2016-05-11  6:05 UTC (permalink / raw)
  To: musl

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


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

end of thread, other threads:[~2016-05-11 18:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-11  6:05 porting musl to RISCV-64 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
2016-05-11 18:48     ` Bobby Bingham

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