From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6052 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?0KDRi9GB0Yw=?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: libc.so segfaults on mips Date: Thu, 04 Sep 2014 22:03:58 +0800 Message-ID: References: <4971377a-43f4-4c82-bee6-635791bbe44b@email.android.com> <20140904073545.GP12888@brightrain.aerifal.cx> <7bb51525-1a3d-43e8-a567-7523ca3673c7@email.android.com> <20140904123208.GA10361@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 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1409839462 17866 80.91.229.3 (4 Sep 2014 14:04:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 14:04:22 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6065-gllmg-musl=m.gmane.org@lists.openwall.com Thu Sep 04 16:04:17 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XPXe4-0007d6-Ep for gllmg-musl@plane.gmane.org; Thu, 04 Sep 2014 16:04:16 +0200 Original-Received: (qmail 21926 invoked by uid 550); 4 Sep 2014 14:04:15 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 21916 invoked from network); 4 Sep 2014 14:04:15 -0000 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_RECEIVED, NO_RELAYS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 User-Agent: K-9 Mail for Android In-Reply-To: <20140904123208.GA10361@port70.net> Xref: news.gmane.org gmane.linux.lib.musl.general:6052 Archived-At: 4 сентября 2014 г. 20:32:09 KRAT, Szabolcs Nagy пишет: >* ???????? [2014-09-04 16:56:40 +0800]: >> 4 ???????????????? 2014 ??. 15:35:45 KRAT, Rich Felker > ??????????: >> >On Thu, Sep 04, 2014 at 03:07:57PM +0800, ???????? wrote: >> >> Not a really blocking bug but I was wondering why cross compiled >> >> musl libc.so for embedded wrt system is segfaults with this: > >OpenWRT does not use standard mips ABI but its own thing: >you need mips-sf (softfloat) toolchain > >> >> % ./strace ./libc.so >> >> execve("./libc.so", ["./libc.so"], [/* 10 vars */]) = 0 >> >> --- {si_signo=SIGSEGV, si_code=SI_USER, si_errno=EPERM, >si_addr=0x4} >> >(Segmentation fault) --- >> >> +++ killed by SIGSEGV +++ >> >> Segmentation fault >> >> >> >> A strange segfault with EPERM. >> >> >> >> The target is mips2 bigendian router, specifically it is ar9331 >SoC. >> >> This is how file reports on libc.so: ELF 32-bit MSB shared object, >> >> MIPS, MIPS-I version 1 (SYSV), dynamically linked, not stripped > >> >Could you attach the output of readelf -a libc.so? I'm guessing the >> The output of readelf attached. > >i don't see the softfloat symbols of libgcc there >(eg __addsf3) > >(musl malloc uses float arithmetics so ./libc.so will fail >immediately) > >(openwrt kernel can be built with fpu emulation which is >the default on normal mips kernels) Strange, I have already fpu emulator enabled (Algorithmics/MIPS FPU emulator 1.5 that comes with oprnwrt kernel). Btw without it even static userspace faults. Landley toolchain "broken" here too, but I don't know is it softfloat or not. Static userspace now works flawlessly, so I will investigate my toolchain.