From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10804 Path: news.gmane.org!.POSTED!not-for-mail From: Waldemar Brodkorb Newsgroups: gmane.comp.lib.uclibc.buildroot,gmane.linux.lib.musl.general Subject: Re: [musl] cortex-m support? Date: Thu, 15 Dec 2016 19:51:23 +0100 Message-ID: <20161215185123.GX15584@waldemar-brodkorb.de> References: <04e5a294-719e-8029-704f-a57d1ec935b0@landley.net> <20161208211116.GO1555@brightrain.aerifal.cx> <7bfe2625-725d-d1bb-7177-f2d31ce09e9c@landley.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1481827899 28617 195.159.176.226 (15 Dec 2016 18:51:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Dec 2016 18:51:39 +0000 (UTC) User-Agent: Mutt/1.5.23 (2014-03-12) Cc: musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org, buildroot-+q+6gMgSsvIBXFe83j6qeQ@public.gmane.org To: Rob Landley Original-X-From: buildroot-bounces-9GAsQqxh4YTR7s880joybQ@public.gmane.org Thu Dec 15 19:51:34 2016 Return-path: Envelope-to: gclub-buildroot@m.gmane.org Original-Received: from smtp3.osuosl.org ([140.211.166.136] helo=silver.osuosl.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cHb7q-0006KM-BH for gclub-buildroot@m.gmane.org; Thu, 15 Dec 2016 19:51:30 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 02B2C23183; Thu, 15 Dec 2016 18:51:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Original-Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jafhQOdGHicF; Thu, 15 Dec 2016 18:51:30 +0000 (UTC) Original-Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id C8C302314C; Thu, 15 Dec 2016 18:51:29 +0000 (UTC) Original-Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B4D611C0674 for ; Thu, 15 Dec 2016 18:51:28 +0000 (UTC) Original-Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B4928823C3 for ; Thu, 15 Dec 2016 18:51:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Original-Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LIPar8q50D6j for ; Thu, 15 Dec 2016 18:51:27 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Original-Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by whitealder.osuosl.org (Postfix) with ESMTPS id 3BBFC82070 for ; Thu, 15 Dec 2016 18:51:27 +0000 (UTC) Original-Received: by helium.openadk.org (Postfix, from userid 1000) id AF4931009E; Thu, 15 Dec 2016 19:51:23 +0100 (CET) Content-Disposition: inline In-Reply-To: <7bfe2625-725d-d1bb-7177-f2d31ce09e9c-VoJi6FS/r0vR7s880joybQ@public.gmane.org> X-Operating-System: Linux 3.16.0-4-amd64 x86_64 X-BeenThere: buildroot-9GAsQqxh4YTR7s880joybQ@public.gmane.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces-9GAsQqxh4YTR7s880joybQ@public.gmane.org Original-Sender: "buildroot" Xref: news.gmane.org gmane.comp.lib.uclibc.buildroot:167198 gmane.linux.lib.musl.general:10804 Archived-At: Hi, Rob Landley wrote, > On 12/08/2016 03:11 PM, Rich Felker wrote: > > On Tue, Dec 06, 2016 at 11:52:29PM -0600, Rob Landley wrote: > >> Index: src/setjmp/arm/setjmp.S > >> =================================================================== > >> --- src/setjmp/arm/setjmp.S (revision 0) > >> +++ src/setjmp/arm/setjmp.S (revision 4920) > >> @@ -0,0 +1,45 @@ > >> +.global __setjmp > >> +.global _setjmp > >> +.global setjmp > >> +.type __setjmp,%function > >> +.type _setjmp,%function > >> +.type setjmp,%function > >> +__setjmp: > >> +_setjmp: > >> +setjmp: > >> + mov ip,r0 > >> +#if defined(__thumb__) > >> + stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,lr} > >> + str sp, [ip], #4 > >> +#else > >> + stmia ip!,{v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} > >> +#endif > > > > My leaning is to just always use the version that works on thumb, > > Presumaby there's a longjmp.S bit too because: > > ldmia ip!, {v1,v2,v3,v4,v5,v6,sl,fp,sp,lr} > > Make sure you're aware of erratum 752419: > > https://sourceware.org/ml/binutils/2011-05/msg00087.html > > On a board with a lot of serial traffic, it takes about 3 minutes for > uClibc (yes, including the current -ng) to crash (by loading the link > register into the stack pointer and stomping code before the setjmp). > > The emcraft guys fixed this in their cortex-m uClibc fork way back when > (http://www.emcraft.com/som/building-uclibc), and of _course_ never > bothered to send it upstream. (Or put it on github with their kernel and > uboot.) But the source is in their distro tarball, and their patch to > uClibc's __longjmp.S is basically: > > --- uclibc-1.0.17/libc/sysdeps/linux/arm/__longjmp.S > +++ emcraft/libc/sysdeps/linux/arm/__longjmp.S > @@ -56,9 +60,15 @@ > #if defined(__thumb2__) > /* Thumb-2 does not allow loading sp with ldm. */ > ldmia ip!, {v1-v6, sl, fp} > +#if 0 > ldr sp, [ip], #4 > ldr lr, [ip], #4 > #else > + ldr sp, [ip, #0] > + ldr lr, [ip, #4] > + add ip, #8 > +#endif > +#else > ldmia ip!, {v1-v6, sl, fp, sp, lr} > #endif > > > (Dunno why the "add ip, #8" because it's a scratch register and this is > the last use in the function, but maybe they just made it do exactly > what the #else case does?) > > cc-ing buildroot because this is still broken in their november release. I am wondering why you don't cc me or any uclibc related list? You still believe uClibc projects should die? It is really cool and very nice that the communication between Rich and me is always fruitful. I always report any bugs I find while testing musl on new or old platforms (mostly via IRC channel) and I always take care that bugfixes for musl targets end up in buildroot. (mipsr6 support, binutils microblaze problems, ..) I really would like to see a similar open communication between the nommu community, you and me. Just ignoring uClibc-ng does not will make it die. As a good starting point, a nice bug report and/or test application which allows me to reproduce the problem would be really appreciated. best regards Waldemar