From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7863 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: stable 1.1.9 & current GIT broken on mips Date: Tue, 2 Jun 2015 15:11:33 -0400 Message-ID: <20150602191133.GJ17573@brightrain.aerifal.cx> References: <1433236180.2010.17.camel@xiaoka.com> <20150602093553.GA10927@port70.net> <1433243791.2010.21.camel@xiaoka.com> <20150602112410.GC10927@port70.net> <1433246655.2010.22.camel@xiaoka.com> <556DD263.5070800@dd-wrt.com> <20150602171924.GI17573@brightrain.aerifal.cx> <556DED4F.5040000@dd-wrt.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1433272312 24327 80.91.229.3 (2 Jun 2015 19:11:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Jun 2015 19:11:52 +0000 (UTC) Cc: musl@lists.openwall.com To: Sebastian Gottschall Original-X-From: musl-return-7876-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jun 02 21:11:51 2015 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 1YzrbK-0001Im-4d for gllmg-musl@m.gmane.org; Tue, 02 Jun 2015 21:11:50 +0200 Original-Received: (qmail 5270 invoked by uid 550); 2 Jun 2015 19:11:47 -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 5252 invoked from network); 2 Jun 2015 19:11:47 -0000 Content-Disposition: inline In-Reply-To: <556DED4F.5040000@dd-wrt.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7863 Archived-At: On Tue, Jun 02, 2015 at 07:52:15PM +0200, Sebastian Gottschall wrote: > Am 02.06.2015 um 19:19 schrieb Rich Felker: > >On Tue, Jun 02, 2015 at 05:57:23PM +0200, Sebastian Gottschall wrote: > >>Hello > >> > >>i tested today the current 1.1.9 (and later also current git so see > >>if its the same behaviour) > >>build on a mipsr2 big endian target (atheros ar7xxx) based on my > >>dd-wrt firmware. > >>i found out that mips seems to be broken on musl right now. the > >>behaviour is > >>that a call using execvp will not result in calling the desired > >>application. > >>on a second call and a following return call, the userspace will > >>lock up with no way todo anything anymore. What do you mean by "the userspace will lock up"? The process hangs? Or the whole system? Is there any way to observe what's going on with strace? And can you clarify what you mean about execvp? Are you saying the first call to execvp returns with an error? I don't get what you mean about "a second call and a following return call". On success execvp does not return. If you're trying to start a dynamic-linked application, it's likely that something is going wrong in the dynamic linker after execvp succeeds but before execution passes into the main program. You could try running a program with global constructors and see if they run. There's a jump at the end of dynamic linking which is not compatible with calling into mips16 code, but as long as crt1.o is not mips16 (and it shouldn't be; on mips it's still built from a .s file, and you said you're not using mips16 in libc) this should not be a problem. Another possibility I should mention since this is DD-WRT is that you've got an ancient kernel that's not compatible with TLS. As of 1.1.0 musl deprecated running without a valid thread pointer, but still worked if you happened not to invoke code that needs it. 1.1.9 removed the last remnants of support for no-thread-pointer and now aborts with SIGSEGV or SIGILL in the startup code if setting the thread pointer fails, which will be the case on 2.4 kernels. Please let me know if you think this might be the case and if it's blocking an important usage case for you. Since the rdhwr to get the thread pointer is potentially very expensive on old hardware (MIPS-I/II) I'm already considering making musl use a non-TLS global for the thread pointer on mips in single-threaded programs, and this same mechanism could make it possible to run (without threads, of course) on kernels without rdhwr emulation or set_thread_area syscall. But if possible it's really best to just move away from 2.4. It has lots of bugs and cannot provide a fully-working environment for musl. Rich