From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10018 Path: news.gmane.org!not-for-mail From: Gry Gunvor Newsgroups: gmane.linux.lib.musl.general Subject: porting musl to RISCV-64 Date: Tue, 10 May 2016 23:05:01 -0700 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1462946748 450 80.91.229.3 (11 May 2016 06:05:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 May 2016 06:05:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10031-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 11 08:05:42 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1b0NHA-0003FJ-Mr for gllmg-musl@m.gmane.org; Wed, 11 May 2016 08:05:40 +0200 Original-Received: (qmail 30282 invoked by uid 550); 11 May 2016 06:05:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 30214 invoked from network); 11 May 2016 06:05:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=pN0BIWWS3LigUcFEhvQEkKRnFnf7iwc2r5Rq3E7l4pU=; b=Z0OrB9KIB9NjHZM3NBiCSomezkcEqBJLKcyNHvETylNvWvVwI8IBSNPDl4AfkzrPlo vBnF27s2xituqRp5TVnNRO25dDqgYnG+/aAMuJhflP76DIh8IxttFVpdV4O4UfALb+bp bjsr9TOawQd+lNAGpHIXSMVQbjCtF4faHBLW291uUDEavgdr8UbfKZyDewbsfqiNA9fD p50JT2UkLCQ1MMdzsUbcoEZy8p2RQ0fJnJStwnz7yj8lR6Yu519Yp+r6/13qLNMZGGpp NiDq1H5MXSP/fISf3qXgQuPFjwcUY2mzzmQ1e1YC7ZcDtYrsQU5zsE6UYgIcukrbIi+Q fYhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=pN0BIWWS3LigUcFEhvQEkKRnFnf7iwc2r5Rq3E7l4pU=; b=hR5CxgFlQZFTzdcuSPH9RYeYTdpG7KDXtR5bBfO8t+N5MLqdLQOtLOmJPI4dXciv+a T8och3yLLGGpvY8NX7ws/FaVrQzYzbMPH7kedY4GcXMBTjTIa3gZfjxA/aOuPTzJ2dZh TzNp6x8fNDMHBsMhW/a9DOOSIYwk05dgMlaT2QIPwv1C0DOBVgE1pu4oW9UqGWri67/4 p8t9h44GQoe7NJStN0PcKsltcbhG/hpd6b/lVSZYD/PDFpabFfUGQe2SFTFk8vb+u2O7 fkWDazETOhVIOg0lccrw29Qmm/fw5l3mj6X5xcwGV4+vKp2xb9aGJk4dB22IURn0OIX2 K4hA== X-Gm-Message-State: AOPr4FVa0feOA0op+hMLB2Azq2lbRWSSWOxakI08Ype6aaEnFVuUpZiSKoIJIrw0MHKv+SoOYRil6aHWFdAWnQ== X-Received: by 10.107.0.7 with SMTP id 7mr1826983ioa.35.1462946720425; Tue, 10 May 2016 23:05:20 -0700 (PDT) Xref: news.gmane.org gmane.linux.lib.musl.general:10018 Archived-At: 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=E2=80=99ll want some lecture material about C=E2=80=99s place in the mo= dern 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