From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7747 Path: news.gmane.org!not-for-mail From: Arjen Roodselaar Newsgroups: gmane.linux.lib.musl.general Subject: Trouble compiling musl for MIPS softfloat Date: Sun, 24 May 2015 04:36:52 +0000 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_D186A3721EB2Aarjenfbcom_" X-Trace: ger.gmane.org 1432442242 21107 80.91.229.3 (24 May 2015 04:37:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 04:37:22 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-7759-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 24 06:37:14 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 1YwNez-0007ok-44 for gllmg-musl@m.gmane.org; Sun, 24 May 2015 06:37:13 +0200 Original-Received: (qmail 12042 invoked by uid 550); 24 May 2015 04:37:11 -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 11995 invoked from network); 24 May 2015 04:37:05 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : content-type : mime-version; s=facebook; bh=dSVWsYOZq0BBEeExaSyqUWxyaAT7U1hFnsvQlM1ot/o=; b=b0q216b1zCU3vDlja4As6tRw84H763zGQrU8bwmDsiG7+OnV6iqX82qFaaM3ebRnFZ5e rtL1aUd57TOVKJMSZn9LreGx4u6bs7Ub38P/Cb+Q3UrtzfN0C6WtxK01XyngUPuBy5W8 mFKs4Loovlxb2cZYDsstYH67LRcb6KG2ko4= Thread-Topic: Trouble compiling musl for MIPS softfloat Thread-Index: AQHQldtAm1PvjqASGEe1zVMynDnwYQ== Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.52.123] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-05-23_02:2015-05-22,2015-05-23,1970-01-01 signatures=0 Xref: news.gmane.org gmane.linux.lib.musl.general:7747 Archived-At: --_000_D186A3721EB2Aarjenfbcom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I am trying to compile musl for use on devices powered by a MIPS 24kc, a So= C without hardware floating point support. The supported target architectur= es list specifically mentions this, but so far I have been unable to get th= is working. In short, using mips-sf-linux-gnu as the target in the configur= e step seems to enable soft float support as per this output: https://gist.= github.com/arjenroodselaar/f8d20534b0d8c7542d01. When linking however ld wa= rns about a small number of files being compiled with -mhard=96float, resul= ting in crt1.so to use -mhard=96float: https://gist.github.com/arjenroodsel= aar/270df6970b2bd43c9bce. This then trickles down in anything I try to link= against libc. Ignoring all this and simply compiling hard-float binaries i= s causing problems when executing malloc. Tools used here: Binutils-2.25 Gcc-4.8.4 Musl-1.1.9 (I tried musl 1.0.5 and gcc 4.9.2 but neither seem to make a difference her= e). Am I missing something here or is soft float support for MIPS currently bro= ken? Any help is appreciated. Thanks, Arjen Roodselaar --_000_D186A3721EB2Aarjenfbcom_ Content-Type: text/html; charset="Windows-1252" Content-ID: Content-Transfer-Encoding: quoted-printable
I am trying to compile musl for use on devices powered by a MIPS 24kc,= a SoC without hardware floating point support. The supported target archit= ectures list specifically mentions this, but so far I have been unable to g= et this working. In short, using mips-sf-linux-gnu as the target in the configure step seems to enable soft= float support as per this output: https://gist.github.com/arjenroodsela= ar/f8d20534b0d8c7542d01. When linking however ld warns about a small number of files being compiled with -mhard= =96float, resulting in crt1.so to use -mhard=96float: https://gist.githu= b.com/arjenroodselaar/270df6970b2bd43c9bce. This then trickles down in anything I try to link against libc. Ignoring a= ll this and simply compiling hard-float binaries is causing problems when e= xecuting malloc.

Tools used here:

Binutils-2.25
Gcc-4.8.4
Musl-1.1.9

(I tried musl 1.0.5 and gcc 4.9.2 but neither seem to make a differenc= e here).

Am I missing something here or is soft float support for MIPS currentl= y broken? Any help is appreciated.

Thanks,
Arjen Roodselaar
--_000_D186A3721EB2Aarjenfbcom_-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7748 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Trouble compiling musl for MIPS softfloat Date: Sun, 24 May 2015 14:45:40 +0200 Message-ID: <20150524124540.GA26188@port70.net> References: 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 1432471561 5650 80.91.229.3 (24 May 2015 12:46:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 12:46:01 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7760-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 24 14:45:57 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 1YwVHv-0001MM-Dk for gllmg-musl@m.gmane.org; Sun, 24 May 2015 14:45:55 +0200 Original-Received: (qmail 32622 invoked by uid 550); 24 May 2015 12:45:53 -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 32601 invoked from network); 24 May 2015 12:45:52 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:7748 Archived-At: * Arjen Roodselaar [2015-05-24 04:36:52 +0000]: > I am trying to compile musl for use on devices powered by a MIPS 24kc, a SoC without hardware floating point support. The supported target architectures list specifically mentions this, but so far I have been unable to get this working. In short, using mips-sf-linux-gnu as the target in the configure step seems to enable soft float support as per this output: https://gist.github.com/arjenroodselaar/f8d20534b0d8c7542d01. When linking however ld warns about a small number of files being compiled with -mhard?float, resulting in crt1.so to use -mhard?float: https://gist.github.com/arjenroodselaar/270df6970b2bd43c9bce. This then trickles down in anything I try to link against libc. Ignoring all this and simply compiling hard-float binaries is causing problems when executing malloc. > > Tools used here: > > Binutils-2.25 > Gcc-4.8.4 > Musl-1.1.9 > works here with binutils-2.24 gcc-4.8.2 musl-1.1.9 i get an assembler warning for the crt asm though: {standard input}:32: Warning: macro instruction expanded into multiple instructions in a branch delay slot for this insn: and $sp, $sp, -8 which turns into 38: 2401fff8 li at,-8 3c: 03a1e824 and sp,sp,at (but this is not soft-float related, just the new start code in 1.1.9) > (I tried musl 1.0.5 and gcc 4.9.2 but neither seem to make a difference here). > > Am I missing something here or is soft float support for MIPS currently broken? Any help is appreciated. your problem seems to be that asm is assumed to be hardfloat by your toolchain. (ie the assembler does not get the -msoft-float flag properly) you may try to add CFLAGS += -Wa,-msoft-float to your config.mak (i have no idea why this would be needed, you may want to send the build command and its output when -v added for one of the files that turned to hard float eg. rm src/setjmp/setjmp.lo make src/setjmp/setjmp.lo and copy the build command, add -v to the end, and send us the command and output and maybe readelf -aW src/setjmp/setjmp.lo output too) From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7749 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Trouble compiling musl for MIPS softfloat Date: Sun, 24 May 2015 12:18:44 -0400 Message-ID: <20150524161844.GM17573@brightrain.aerifal.cx> References: <20150524124540.GA26188@port70.net> 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 1432484356 31755 80.91.229.3 (24 May 2015 16:19:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 16:19:16 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7761-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 24 18:19:01 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 1YwYc8-0000u3-Ec for gllmg-musl@m.gmane.org; Sun, 24 May 2015 18:19:00 +0200 Original-Received: (qmail 18211 invoked by uid 550); 24 May 2015 16:18:58 -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 18189 invoked from network); 24 May 2015 16:18:57 -0000 Content-Disposition: inline In-Reply-To: <20150524124540.GA26188@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7749 Archived-At: On Sun, May 24, 2015 at 02:45:40PM +0200, Szabolcs Nagy wrote: > i get an assembler warning for the crt asm though: > > {standard input}:32: Warning: macro instruction expanded into multiple instructions in a branch delay slot > > for this insn: > > and $sp, $sp, -8 > > which turns into > > 38: 2401fff8 li at,-8 > 3c: 03a1e824 and sp,sp,at > > (but this is not soft-float related, just the new start code in 1.1.9) This looks like a potentially serious bug, omitting stack alignment. It shouldn't matter as long as crt_arch.h is only used in dlstart.lo (where the kernel normally gives an aligned stack pointer to begin with) but I want to remove crt/*/crt1.s within the next couple release cycles, and then it would matter. Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7750 Path: news.gmane.org!not-for-mail From: Arjen Roodselaar Newsgroups: gmane.linux.lib.musl.general Subject: Re: Trouble compiling musl for MIPS softfloat Date: Sun, 24 May 2015 22:09:58 +0000 Message-ID: References: <20150524124540.GA26188@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1432505425 15488 80.91.229.3 (24 May 2015 22:10:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 May 2015 22:10:25 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-7762-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 25 00:10:18 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 1Ywe64-0007b0-0G for gllmg-musl@m.gmane.org; Mon, 25 May 2015 00:10:16 +0200 Original-Received: (qmail 14001 invoked by uid 550); 24 May 2015 22:10:13 -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 13983 invoked from network); 24 May 2015 22:10:13 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=facebook; bh=xu7iQQPamrpxhJwTfVMRU4Kki3sX5lX2JvB5B/fu/tg=; b=hdOF30AcZxyRxMGDpIVzETZ6t1fBPiuXS1kQBYWr0DS5olnYs+P2zvTJ0gA6qLf23sZM ZnqgyvymP1Agip9RDCCcMKm5IdL+B+M+RFqVR2F+XcC/DKU1HH+zksHm+rutHVKNx7gb xivq1zSofFt0pM9yFkX+nB0I7FbilY6BzkU= Thread-Topic: [musl] Trouble compiling musl for MIPS softfloat Thread-Index: AQHQldtAm1PvjqASGEe1zVMynDnwYZ2LiLYAgAAoVYA= In-Reply-To: <20150524124540.GA26188@port70.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [192.168.52.123] Content-ID: X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-05-24_03:2015-05-22,2015-05-24,1970-01-01 signatures=0 Xref: news.gmane.org gmane.linux.lib.musl.general:7750 Archived-At: Passing -Wa,-msoft-float to the assembler works like a charm. Reading your reply I realized I had been looking for a way to pass this on to the assembler but did not realize I should just pass that same flag. I guess it was a long day yesterday. Thank you for the quick reply on this! 1.1.9 indeed produces a few of those warnings mentioned so for now I will continue with 1.1.8. Rich, should I open an issue somewhere to make sure this gets looked in to? On 5/24/15, 5:45 AM, "Szabolcs Nagy" wrote: >* Arjen Roodselaar [2015-05-24 04:36:52 +0000]: >> I am trying to compile musl for use on devices powered by a MIPS 24kc, >>a SoC without hardware floating point support. The supported target >>architectures list specifically mentions this, but so far I have been >>unable to get this working. In short, using mips-sf-linux-gnu as the >>target in the configure step seems to enable soft float support as per >>this output:=20 >>https://gist.github.com/arjenroodselaar/f8d20534b0d8c7542d01. When >>linking however ld warns about a small number of files being compiled >>with -mhard?float, resulting in crt1.so to use -mhard?float: >>https://gist.github.com/arjenroodselaar/270df6970b2bd43c9bce. This then >>trickles down in anything I try to link against libc. Ignoring all this >>and simply compiling hard-float binaries is causing problems when >>executing malloc. >>=20 >> Tools used here: >>=20 >> Binutils-2.25 >> Gcc-4.8.4 >> Musl-1.1.9 >>=20 > >works here with >binutils-2.24 >gcc-4.8.2 >musl-1.1.9 > >i get an assembler warning for the crt asm though: > >{standard input}:32: Warning: macro instruction expanded into multiple >instructions in a branch delay slot > >for this insn: > > and $sp, $sp, -8 > >which turns into > > 38: 2401fff8 li at,-8 > 3c: 03a1e824 and sp,sp,at > >(but this is not soft-float related, just the new start code in 1.1.9) > >> (I tried musl 1.0.5 and gcc 4.9.2 but neither seem to make a difference >>here). >>=20 >> Am I missing something here or is soft float support for MIPS currently >>broken? Any help is appreciated. > >your problem seems to be that asm is assumed to be >hardfloat by your toolchain. > >(ie the assembler does not get the -msoft-float flag >properly) > >you may try to add > >CFLAGS +=3D -Wa,-msoft-float > >to your config.mak > >(i have no idea why this would be needed, you may want >to send the build command and its output when -v added >for one of the files that turned to hard float >eg. > > rm src/setjmp/setjmp.lo > make src/setjmp/setjmp.lo > >and copy the build command, add -v to the end, and send us the >command and output and maybe readelf -aW src/setjmp/setjmp.lo >output too) From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7759 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Trouble compiling musl for MIPS softfloat Date: Mon, 25 May 2015 16:14:03 -0400 Message-ID: <20150525201403.GS17573@brightrain.aerifal.cx> References: <20150524124540.GA26188@port70.net> 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 1432584860 26518 80.91.229.3 (25 May 2015 20:14:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 May 2015 20:14:20 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7771-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 25 22:14:20 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 1YwylP-0006jH-8n for gllmg-musl@m.gmane.org; Mon, 25 May 2015 22:14:19 +0200 Original-Received: (qmail 10037 invoked by uid 550); 25 May 2015 20:14:17 -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 10016 invoked from network); 25 May 2015 20:14:16 -0000 Content-Disposition: inline In-Reply-To: eFrom: Rich Felker User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:7759 Archived-At: On Sun, May 24, 2015 at 10:09:58PM +0000, Arjen Roodselaar wrote: > Passing -Wa,-msoft-float to the assembler works like a charm. Reading your > reply I realized I had been looking for a way to pass this on to the > assembler but did not realize I should just pass that same flag. I guess > it was a long day yesterday. Thank you for the quick reply on this! > > 1.1.9 indeed produces a few of those warnings mentioned so for now I will > continue with 1.1.8. Rich, should I open an issue somewhere to make sure > this gets looked in to? As of commit 9f26ebded188ed78c3571a4ca1477dd6351bc647 they should be fixed. Let me know if you see any remaining such warnings. Thanks! Rich