From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10021 Path: news.gmane.org!not-for-mail From: Gry Gunvor Newsgroups: gmane.linux.lib.musl.general Subject: Re: porting musl to RISCV-64 Date: Wed, 11 May 2016 09:40:42 -0700 Message-ID: References: <20160511112518.GB22574@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1462984878 24590 80.91.229.3 (11 May 2016 16:41:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 May 2016 16:41:18 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10034-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 11 18:41:17 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 1b0XCG-0001VF-C1 for gllmg-musl@m.gmane.org; Wed, 11 May 2016 18:41:16 +0200 Original-Received: (qmail 11558 invoked by uid 550); 11 May 2016 16:41:14 -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 11538 invoked from network); 11 May 2016 16:41:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=i9qvANWbn1ax4MgUecVxtUjcH17slwE9jkiLJt745sY=; b=vrZUqpBA3Lb2OJSCvVDcGKef7C3QrkbIZuD+B3s6OwAlJ8u31KCaj4xF6F1vWvE2eP trV6Q8rqh+FxAU3arlqPbkgUUncFLf+amyohWStkgYOobdLB6+ZNNNiIrBpaQMuNzqXH G4ssRQq4FHUbx6MxoVhUmZGpLzS7fbC1uhCLtrIklFvKZKjSG0Yl55xZH+X/AmgN8ars 6xwlL2Qg9ZN1wwzdZvRgt44GYzVCAU0mlxTh4oj4e8SR1u5ZkQI9Wsb7cLRH/qfY7byL 52bznZKJjauJaVNBHDBd0x9iRYtj8hwFjqgnDQk0gJSV+SA1R2OTrHcPGDN9jrsjw30u i/zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=i9qvANWbn1ax4MgUecVxtUjcH17slwE9jkiLJt745sY=; b=Xyv00Fy9VSXvBJMTRbBEyE3H6Br0rcvZpEfUOaeNpKlJ+CLGvP6Hhyfqt+jidO99aH aHRSdP+B+0Q9/m0spl9GlM2Dage0nUNNxLOXxmLH3skkhiQtuJbkDQwMum7O/KSqGT+w BG9K6Uk9Fek9BwU6lYgtHVuM+uUcjJcPNMt6G+LXeSMbA5PRaA97bXvKGf8E8zqo5uuT Ipx8vdj4NSaGFFItVct9skluQYJY8i+KUatdBcujyQokdL7b54F3AE8W+BfpKnslNqm+ 0UAM1UgtIZ8dGhbaRDKGY4aN4+z3s2JTWVRv9NJSVYACaY/K1nlx/nqrkhZRc8lwpVOM P3YQ== X-Gm-Message-State: AOPr4FV4udrzyxcypNvE957mjLzEBY8W+p+o0C+ASUcS3mGG3VTFGtHeS1cPCORAH5Rz9Sm0yE7nCTQiMCkH9w== X-Received: by 10.107.192.129 with SMTP id q123mr4022389iof.197.1462984861849; Wed, 11 May 2016 09:41:01 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:10021 Archived-At: 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 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? Gry On Wed, May 11, 2016 at 9:32 AM, Gry Gunvor wrote: > On Wed, May 11, 2016 at 4:25 AM, Szabolcs Nagy 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