From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4967 Path: news.gmane.org!not-for-mail From: Stephen Thomas Newsgroups: gmane.linux.lib.musl.general Subject: thumb2 support Date: Mon, 28 Apr 2014 04:36:01 +0100 Message-ID: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_21c18780-2cca-477b-ae3b-fa8ec558b9c9_" X-Trace: ger.gmane.org 1398656182 12782 80.91.229.3 (28 Apr 2014 03:36:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 03:36:22 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-4971-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 28 05:36:15 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 1WecMY-0004LD-Oh for gllmg-musl@plane.gmane.org; Mon, 28 Apr 2014 05:36:14 +0200 Original-Received: (qmail 9269 invoked by uid 550); 28 Apr 2014 03:36: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 9258 invoked from network); 28 Apr 2014 03:36:13 -0000 X-TMN: [cPhT+XuIdU6/fjVsO7g5LLAzPNtC2Dup] X-Originating-Email: [scjthm@live.com] Importance: Normal X-OriginalArrivalTime: 28 Apr 2014 03:36:01.0887 (UTC) FILETIME=[FA2A7EF0:01CF6292] Xref: news.gmane.org gmane.linux.lib.musl.general:4967 Archived-At: --_21c18780-2cca-477b-ae3b-fa8ec558b9c9_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi I have been playing around with buildroot and musl with x86_64 and arm (wel= l thumb2 for an arm7 with soft floats). The x86_64 builds work very well wi= th buildroot but I am having a bit of a problem replacing an uClibc build w= ith musl when I have enabled thumb2 instructions. I have checked the docume= ntation and I cannot find anything specific about thumb2 either working or = not working=2C so therefore I will ask the list. buildroot/output/host/usr/bin/arm-buildroot-linux-musleabi-gcc -std=3Dc99 -= nostdinc -ffreestanding -fexcess-precision=3Dstandard -frounding-math -D_XO= PEN_SOURCE=3D700 -I./arch/arm -I./src/internal -I./include -D_LARGEFILE_SOU= RCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=3D64 -pipe -fomit-frame-point= er -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa=2C--noexecstack -= Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int -Werror=3Dpoi= nter-sign -Werror=3Dpointer-arith -fno-stack-protector -pipe -O2 -c -o src= /exit/exit.o src/exit/exit.csrc/dirent/readdir_r.c:29:28: error: redefiniti= on of 'readdir_r' LFS64_2(readdir_r=2C readdir64_r)=3B Makefile:115: recipe for target 'src/dirent/scandir.o' failedmake:= *** [src/dirent/scandir.o] Error 1{standard input}: Assembler messages:{st= andard input}:36: Error: thumb conditional instruction should be in IT bloc= k -- `strexeq r1=2Cr0=2C[r2]'{standard input}:37: Error: thumb conditional = instruction should be in IT block -- `teqeq r1=2C#1' You can ignore the first error. That might be some gcc issue=2C but it woul= d appear that the syscall is using arm instructions in arch/arm/atomic.h. D= oes anyone know if thumb2 is going to be supported?=20 Cheers Thomo = --_21c18780-2cca-477b-ae3b-fa8ec558b9c9_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi

I have bee= n playing around with buildroot and musl with x86_64 and arm (well thumb2 f= or an arm7 with soft floats). The =3Bx86_64 builds work very well with buildroot but I am having a bit of a pro= blem replacing an uClibc build with musl when I have enabled thumb2 instruc= tions. I have checked the documentation and I cannot find anything specific= about thumb2 either working or not working=2C so therefore I will ask the = list.

=
buildroot/output/host/usr/bin/arm-buildroot-linux-musleabi-gcc -s= td=3Dc99 -nostdinc -ffreestanding -fexcess-precision=3Dstandard -frounding-= math -D_XOPEN_SOURCE=3D700 -I./arch/arm -I./src/internal -I./include -D_LAR= GEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=3D64 -pipe -fomit-f= rame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa=2C--noe= xecstack -Werror=3Dimplicit-function-declaration -Werror=3Dimplicit-int -We= rror=3Dpointer-sign -Werror=3Dpointer-arith -fno-stack-protector  =3B-p= ipe -O2 -c -o src/exit/exit.o src/exit/exit.c
src/dirent/readdir_= r.c:29:28: error: redefinition of 'readdir_r'
 =3BLFS64_2(rea= ddir_r=2C readdir64_r)=3B

=
<=3Bdeleted>=3B
Makefile:115: recipe for = target 'src/dirent/scandir.o' failed
make: *** [src/dirent= /scandir.o] Error 1
{standard input}: Assembler messages:
{standard input}:36: Error: thumb conditional instruction should be in I= T block -- `strexeq r1=2Cr0=2C[r2]'
{standard input}:37: Error: t= humb conditional instruction should be in IT block -- `teqeq r1=2C#1'
=

<=3Bdeleted>=3B

You can ig= nore the first error. That might be some gcc issue=2C but it would appear t= hat the syscall is using arm instructions in arch/arm/atomic.h. Does anyone= know if thumb2 is going to be supported? =3B

= Cheers

Thomo



= --_21c18780-2cca-477b-ae3b-fa8ec558b9c9_-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4976 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Mon, 28 Apr 2014 14:06:31 +0200 Message-ID: <20140428120630.GG12324@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 1398686811 22028 80.91.229.3 (28 Apr 2014 12:06:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 12:06:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4980-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 28 14:06:45 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 1WekKa-0006om-5i for gllmg-musl@plane.gmane.org; Mon, 28 Apr 2014 14:06:44 +0200 Original-Received: (qmail 7970 invoked by uid 550); 28 Apr 2014 12:06:42 -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 7959 invoked from network); 28 Apr 2014 12:06:42 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4976 Archived-At: * Stephen Thomas [2014-04-28 04:36:01 +0100]: > I have been playing around with buildroot and musl with x86_64 and arm (well thumb2 for an arm7 with soft floats). The x86_64 builds work very well with buildroot but I am having a bit of a problem replacing an uClibc build with musl when I have enabled thumb2 instructions. I have checked the documentation and I cannot find anything specific about thumb2 either working or not working, so therefore I will ask the list. > buildroot/output/host/usr/bin/arm-buildroot-linux-musleabi-gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -D_XOPEN_SOURCE=700 -I./arch/arm -I./src/internal -I./include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -fno-stack-protector -pipe -O2 -c -o src/exit/exit.o src/exit/exit.csrc/dirent/readdir_r.c:29:28: error: redefinition of 'readdir_r' LFS64_2(readdir_r, readdir64_r); how did -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE got into the cflags? these do not make sense when building a libc same for -D_FILE_OFFSET_BITS=64 but that's always a noop on musl so at least it does not hurt > Makefile:115: recipe for target 'src/dirent/scandir.o' failedmake: *** [src/dirent/scandir.o] Error 1{standard input}: Assembler messages:{standard input}:36: Error: thumb conditional instruction should be in IT block -- `strexeq r1,r0,[r2]'{standard input}:37: Error: thumb conditional instruction should be in IT block -- `teqeq r1,#1' > > You can ignore the first error. That might be some gcc issue, but it would appear that the syscall is using arm instructions in arch/arm/atomic.h. Does anyone know if thumb2 is going to be supported? i think this came up before you need to use -marm for now From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4981 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Mon, 28 Apr 2014 10:27:14 -0400 Message-ID: <20140428142714.GX26358@brightrain.aerifal.cx> References: <20140428120630.GG12324@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 1398695257 8121 80.91.229.3 (28 Apr 2014 14:27:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 14:27:37 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4985-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 28 16:27:30 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 1WemWl-0003GP-Jf for gllmg-musl@plane.gmane.org; Mon, 28 Apr 2014 16:27:27 +0200 Original-Received: (qmail 19607 invoked by uid 550); 28 Apr 2014 14:27:26 -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 19599 invoked from network); 28 Apr 2014 14:27:26 -0000 Content-Disposition: inline In-Reply-To: <20140428120630.GG12324@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:4981 Archived-At: On Mon, Apr 28, 2014 at 02:06:31PM +0200, Szabolcs Nagy wrote: > * Stephen Thomas [2014-04-28 04:36:01 +0100]: > > I have been playing around with buildroot and musl with x86_64 and arm (well thumb2 for an arm7 with soft floats). The x86_64 builds work very well with buildroot but I am having a bit of a problem replacing an uClibc build with musl when I have enabled thumb2 instructions. I have checked the documentation and I cannot find anything specific about thumb2 either working or not working, so therefore I will ask the list. > > buildroot/output/host/usr/bin/arm-buildroot-linux-musleabi-gcc -std=c99 -nostdinc -ffreestanding -fexcess-precision=standard -frounding-math -D_XOPEN_SOURCE=700 -I./arch/arm -I./src/internal -I./include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables -Wa,--noexecstack -Werror=implicit-function-declaration -Werror=implicit-int -Werror=pointer-sign -Werror=pointer-arith -fno-stack-protector -pipe -O2 -c -o src/exit/exit.o src/exit/exit.csrc/dirent/readdir_r.c:29:28: error: redefinition of 'readdir_r' LFS64_2(readdir_r, readdir64_r); > > how did -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE got into the cflags? > these do not make sense when building a libc They're probably from a CFLAGS setting that's getting passed to all packages, and they should not be there. There's a widespread misconception that these options are needed for 64-bit off_t. They're not. They're purely for exposing the legacy foo64() functions. > same for -D_FILE_OFFSET_BITS=64 but that's always a noop on musl so > at least it does not hurt Indeed, this one is no problem and should be in your system-wide CFLAGS if you're using glibc, but with musl it's a no-op so it could just as well be omitted. > > > Makefile:115: recipe for target 'src/dirent/scandir.o' failedmake: *** [src/dirent/scandir.o] Error 1{standard input}: Assembler messages:{standard input}:36: Error: thumb conditional instruction should be in IT block -- `strexeq r1,r0,[r2]'{standard input}:37: Error: thumb conditional instruction should be in IT block -- `teqeq r1,#1' > > > > You can ignore the first error. That might be some gcc issue, but it would appear that the syscall is using arm instructions in arch/arm/atomic.h. Does anyone know if thumb2 is going to be supported? > > i think this came up before > you need to use -marm for now Yes, this is a regression we accidentally introduced in 1.1.0. I'd like to fix it if someone with ARM knowledge can help. For now perhaps the easiest way would be adding #if __THUMB__ or whatever to atomic.h and writing a separate thumb version. Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4985 Path: news.gmane.org!not-for-mail From: Stephen Thomas Newsgroups: gmane.linux.lib.musl.general Subject: RE: thumb2 support Date: Tue, 29 Apr 2014 00:52:36 +0100 Message-ID: References: ,<20140428120630.GG12324@port70.net>,<20140428142714.GX26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="_ead62de8-b4d8-426b-8c94-82d035e2829a_" X-Trace: ger.gmane.org 1398729183 32723 80.91.229.3 (28 Apr 2014 23:53:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 23:53:03 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-4989-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 29 01:52:56 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 1WevLv-0001Pm-JS for gllmg-musl@plane.gmane.org; Tue, 29 Apr 2014 01:52:51 +0200 Original-Received: (qmail 11602 invoked by uid 550); 28 Apr 2014 23:52:49 -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 11592 invoked from network); 28 Apr 2014 23:52:49 -0000 X-TMN: [u7PvGjkK+rCclwti2EnqcT45RkaEbUFT] X-Originating-Email: [scjthm@live.com] Importance: Normal In-Reply-To: <20140428142714.GX26358@brightrain.aerifal.cx> X-OriginalArrivalTime: 28 Apr 2014 23:52:36.0414 (UTC) FILETIME=[EE4B65E0:01CF633C] Xref: news.gmane.org gmane.linux.lib.musl.general:4985 Archived-At: --_ead62de8-b4d8-426b-8c94-82d035e2829a_ Content-Type: multipart/alternative; boundary="_19674efa-0d89-4f68-9e1e-b2bf9e8a0ca8_" --_19674efa-0d89-4f68-9e1e-b2bf9e8a0ca8_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0A= =0A= =0A= > On Mon=2C Apr 28=2C 2014 at 02:06:31PM +0200=2C Szabolcs Nagy wrote:> > >= Makefile:115: recipe for target 'src/dirent/scandir.o' failedmake= : *** [src/dirent/scandir.o] Error 1{standard input}: Assembler messages:{s= tandard input}:36: Error: thumb conditional instruction should be in IT blo= ck -- `strexeq r1=2Cr0=2C[r2]'{standard input}:37: Error: thumb conditional= instruction should be in IT block -- `teqeq r1=2C#1'> > > > > > You can ignore the first error. That might be some gcc issue=2C but i= t would appear that the syscall is using arm instructions in arch/arm/atomi= c.h. Does anyone know if thumb2 is going to be supported?=20 > >=20 > Yes=2C this is a regression we accidentally introduced in 1.1.0. I'd > like to fix it if someone with ARM knowledge can help. For now perhaps > the easiest way would be adding #if __THUMB__ or whatever to atomic.h > and writing a separate thumb version. > Rich I remember that the old thumb didn't support the conditional instructions a= nd was quite slow. I only care about thumb2 and am currently using gcc=2C s= o I attach a patch for the thumb that will only work for gcc . I think that= gcc builds two versions of atomic so the ugly #define was needed. I cannot= remember what rvct/rvds or whatever it is branded as these days uses=2C bu= t from memory old versions didn't support the gnu assebmly syntax. Cheers Thomo =0A= = --_19674efa-0d89-4f68-9e1e-b2bf9e8a0ca8_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
=0A= =0A= =0A=
>=3B On Mon=2C A= pr 28=2C 2014 at 02:06:31PM +0200=2C Szabolcs Nagy wrote:
= >=3B >=3B >=3B <=3Bdeleted>=3B= Makefile:115: recipe for target 'src/dirent/scandir.o' failedmake: *** [src= /dirent/scandir.o] Error 1{standard input}: Assembler messages:{standard in= put}:36: Error: thumb conditional instruction should be in IT block -- `str= exeq r1=2Cr0=2C[r2]'{standard input}:37: Error: thumb conditional instructi= on should be in IT block -- `teqeq r1=2C#1'
>=3B >=3B = >=3B <=3Bdeleted>=3B
>=3B >=3B >=3B You can ignore the first= error. That might be some gcc issue=2C but it would appear that the syscal= l is using arm instructions in arch/arm/atomic.h. Does anyone know if thumb= 2 is going to be supported?
>=3B >=3B
>=3B Yes=2C this is a r= egression we accidentally introduced in 1.1.0. I'd
>=3B like to fix it= if someone with ARM knowledge can help. For now perhaps
>=3B the easi= est way would be adding #if __THUMB__ or whatever to atomic.h
>=3B and= writing a separate thumb version.
>=3B Rich

<= div>I remember that the old thumb didn't support the conditional instructio= ns and was quite slow. I only care about thumb2 and am currently using gcc= =2C so I attach a patch for the thumb that will only work for gcc . I think= that gcc builds two versions of atomic so the ugly #define was needed. I c= annot remember what rvct/rvds or whatever it is branded as these days uses= =2C but from memory old versions didn't support the gnu assebmly syntax.


Cheers

Thomo=


=0A=
= --_19674efa-0d89-4f68-9e1e-b2bf9e8a0ca8_-- --_ead62de8-b4d8-426b-8c94-82d035e2829a_ Content-Type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="thumb2.patch" LS0tIGEvYXJjaC9hcm0vYXRvbWljLmgJMjAxNC0wNC0xNiAwODozMToyNy4wMDAwMDAwMDAgKzAw MDAKKysrIGIvYXJjaC9hcm0vYXRvbWljLmgJMjAxNC0wNC0yOCAyMzoxNDo1MS4zNDQxODU4ODQg KzAwMDAKQEAgLTM5LDcgKzM5LDEzIEBACiAJCSIJIiBNRU1fQkFSUklFUiAiXG4iCiAJCSIxOgls ZHJleCAlMCwlM1xuIgogCQkiCXN1YnMgJTAsJTAsJTFcbiIKKyNpZiBfX3RodW1iMl9fIAorCQki CUlUIGVxXG4iCisjZW5kaWYKIAkJIglzdHJleGVxICUwLCUyLCUzXG4iCisjaWYgX190aHVtYjJf XyAKKwkJIglJVCBlcVxuIgorI2VuZGlmCiAJCSIJdGVxZXEgJTAsIzFcbiIKIAkJIgliZXEgMWJc biIKIAkJIgkiIE1FTV9CQVJSSUVSICJcbiIK --_ead62de8-b4d8-426b-8c94-82d035e2829a_-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4987 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Mon, 28 Apr 2014 20:56:58 -0400 Message-ID: <20140429005658.GC26358@brightrain.aerifal.cx> References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> 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 1398733043 19263 80.91.229.3 (29 Apr 2014 00:57:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 00:57:23 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4991-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 29 02:57:12 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 1WewMB-0003W3-VU for gllmg-musl@plane.gmane.org; Tue, 29 Apr 2014 02:57:12 +0200 Original-Received: (qmail 7738 invoked by uid 550); 29 Apr 2014 00:57: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 7730 invoked from network); 29 Apr 2014 00:57:10 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:4987 Archived-At: On Tue, Apr 29, 2014 at 12:52:36AM +0100, Stephen Thomas wrote: > I remember that the old thumb didn't support the conditional > instructions and was quite slow. I only care about thumb2 and am > currently using gcc, so I attach a patch for the thumb that will The code here is only used on armv6/v7. Do any such chips lack thumb2? If there's any doubt, we could look at what gcc generates for the __sync_* builtins in thumb mode. > only work for gcc . Why is it only for gcc? > I think that gcc builds two versions of atomic What do you mean by this? > so the ugly #define was needed. I cannot remember what rvct/rvds or > whatever it is branded as these days uses, but from memory old > versions didn't support the gnu assebmly syntax. All asm in musl is gas syntax so this is nothing new. Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4988 Path: news.gmane.org!not-for-mail From: Stephen Thomas Newsgroups: gmane.linux.lib.musl.general Subject: RE: thumb2 support Date: Tue, 29 Apr 2014 02:14:01 +0100 Message-ID: References: ,<20140428120630.GG12324@port70.net>,<20140428142714.GX26358@brightrain.aerifal.cx>,,<20140429005658.GC26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_86bafaae-7ed0-422e-b003-1cbf08c6be3a_" X-Trace: ger.gmane.org 1398734063 32669 80.91.229.3 (29 Apr 2014 01:14:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 01:14:23 +0000 (UTC) To: "musl@lists.openwall.com" Original-X-From: musl-return-4992-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 29 03:14:16 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 1Wewch-00065m-RA for gllmg-musl@plane.gmane.org; Tue, 29 Apr 2014 03:14:15 +0200 Original-Received: (qmail 15896 invoked by uid 550); 29 Apr 2014 01:14:14 -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 15885 invoked from network); 29 Apr 2014 01:14:13 -0000 X-TMN: [4bK8ru+iWjup8u2kIe3g0I9X1udglFyg] X-Originating-Email: [scjthm@live.com] Importance: Normal In-Reply-To: <20140429005658.GC26358@brightrain.aerifal.cx> X-OriginalArrivalTime: 29 Apr 2014 01:14:01.0849 (UTC) FILETIME=[4E3D9E90:01CF6348] Xref: news.gmane.org gmane.linux.lib.musl.general:4988 Archived-At: --_86bafaae-7ed0-422e-b003-1cbf08c6be3a_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > On Tue=2C Apr 29=2C 2014 at 12:52:36AM +0100=2C Stephen Thomas wrote: > > I remember that the old thumb didn't support the conditional > > instructions and was quite slow. I only care about thumb2 and am > > currently using gcc=2C so I attach a patch for the thumb that will >=20 > The code here is only used on armv6/v7. Do any such chips lack thumb2? > If there's any doubt=2C we could look at what gcc generates for the > __sync_* builtins in thumb mode. >=20 > > only work for gcc . >=20 > Why is it only for gcc? I have only tested with gcc. I don't know what llvm nor armcc do. Is there= an ASM standard like ther is for C/C++/fortran? There is some good info on= thumb here=2C https://wiki.ubuntu.com/ARM/Thumb2 and the various ways of s= upporting ARM. I guess that the thumb2 could be replaced by a __thumb__. =20 >=20 > > I think that gcc builds two versions of atomic >=20 > What do you mean by this? I am building the native toolchain as I would like to run this on an embedd= ed platform. My understanding is that when you build the toolchain you need= to provide somethings that end up going in libgcc_s.so such as threading i= f you are using openmp in C++. etc etc. That patch works for both the -marm= and -mthumb or whatever the thumb targets are. >=20 > > so the ugly #define was needed. I cannot remember what rvct/rvds or > > whatever it is branded as these days uses=2C but from memory old > > versions didn't support the gnu assebmly syntax. >=20 > All asm in musl is gas syntax so this is nothing new. >=20 > Rich = --_86bafaae-7ed0-422e-b003-1cbf08c6be3a_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
>=3B On Tue=2C Apr 29=2C = 2014 at 12:52:36AM +0100=2C Stephen Thomas wrote:
>=3B >=3B I rememb= er that the old thumb didn't support the conditional
>=3B >=3B instr= uctions and was quite slow. I only care about thumb2 and am
>=3B >= =3B currently using gcc=2C so I attach a patch for the thumb that will
&= gt=3B
>=3B The code here is only used on armv6/v7. Do any such chips = lack thumb2?
>=3B If there's any doubt=2C we could look at what gcc ge= nerates for the
>=3B __sync_* builtins in thumb mode.
>=3B
&g= t=3B >=3B only work for gcc .
>=3B
>=3B Why is it only for gcc= ?

I have only tested with gcc. I don't know what l= lvm nor armcc do.  =3BIs there an ASM standard like ther is for C/C++/f= ortran? There is some good info on thumb here=2C =3Bhttps://wiki.ubuntu= .com/ARM/Thumb2 and the various ways of supporting ARM. I guess that the th= umb2 could be replaced by a __thumb__.  =3B

>=3B
&g= t=3B >=3B I think that gcc builds two versions of atomic
>=3B
&g= t=3B What do you mean by this?

I am building the n= ative toolchain as I would like to run this on an embedded platform. My und= erstanding is that when you build the toolchain you need to provide somethi= ngs that end up going in =3Blibgcc_s.so such as threading if you are us= ing openmp in C++. etc etc. That patch works for both the -marm and -mthumb= or whatever the thumb targets are.

>=3B
>=3B >=3B = so the ugly #define was needed. I cannot remember what rvct/rvds or
>= =3B >=3B whatever it is branded as these days uses=2C but from memory old=
>=3B >=3B versions didn't support the gnu assebmly syntax.
>= =3B
>=3B All asm in musl is gas syntax so this is nothing new.
>= =3B
>=3B Rich
= --_86bafaae-7ed0-422e-b003-1cbf08c6be3a_-- From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4989 Path: news.gmane.org!not-for-mail From: Wermut Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Tue, 29 Apr 2014 18:09:14 +0200 Message-ID: References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> 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 1398787775 11762 80.91.229.3 (29 Apr 2014 16:09:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 29 Apr 2014 16:09:35 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4993-gllmg-musl=m.gmane.org@lists.openwall.com Tue Apr 29 18:09:30 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 1WfAb4-0004v9-MF for gllmg-musl@plane.gmane.org; Tue, 29 Apr 2014 18:09:30 +0200 Original-Received: (qmail 30394 invoked by uid 550); 29 Apr 2014 16:09:27 -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 30386 invoked from network); 29 Apr 2014 16:09:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bortis.ch; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=Pr3GWHBeMSA7icDzOSSrD/F+h5Aa37XmI6cUB8EWIgc=; b=UIVOsj6jdeBTtxEDjc+RGDBPcKgBCeJRDSAnPpHWFNXWv+Hbhq2TDCx2j8cXXAtT7K vO1tER9TsfkTrUQDiQiaUbodY+A/0DeP3NQ/K47kP7de+r6MR39eBxlP0f8eDHYFLB/t LOWJLOmBmMzD4E71jm0jWpSJOW3j59wxvuFrg= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=Pr3GWHBeMSA7icDzOSSrD/F+h5Aa37XmI6cUB8EWIgc=; b=spXQT3NNvM97UlucPY/fcc0Vl8BCdJt/P+j1oBOpNuU99maZwNA/3xxmsC2hpRJ9XM BoIDxOik6jflcMAlVVrgspqN4DxPSbAvoHUkd7JtbxC4eYR4Q48Ba6AYuSqGazCSBljm nYvg6Fqs1R1Q7qU7hKehyGYSfA/qCZUMa6f7ibRhmLtKhWkLiVYejqvq8YBJghPs518T 0xn3evfkg9vDSOVylh6UVQ8zB0qFILpudxCOduZsHeYI8yo1ddToIW4bXV7QmU7OLObK t6QelbOoA6FiEHTLwwuHrz65BY46PGtHBJ7rJGd4z3IPozxJNbaoHJyIacx8tSPy2z2G Iu5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Pr3GWHBeMSA7icDzOSSrD/F+h5Aa37XmI6cUB8EWIgc=; b=a0dKyxRfqGx2clqEDn5sR3D1si8utEfCOKCCMio8FvS11jRgKQmziOwGWGdCpC2XgQ gRcnyZtQjgzDG/hocIRUG1gc1umtwWDb+uykWlBrp+oaphfxOeiHM0yFJ6LHROkpP8XJ URDLpVaZkh1nWVtHibv/FiBW5Ua/yzdmkK71bIJi3ophYZjgV3+x0FWJxqJ3KvniHqUs O/KW6Hla64DHSoUIrsMkLUg7EFydBQ8OSlybxN1jBl4f1iVTocGOoY+WlNOXLYtIMev3 jXRbebhF6fYD26GKvOtajnQijWskilNYGUt9hOBfsRx3o7cw1Tprh9paHArrFCOCFiMf Vzkg== X-Gm-Message-State: ALoCoQkZYILKQrL4i2HuO4Ep6P9h/jZNylYDAaQTDR8G9SrbmMZs/qb/pTdmM/mTnfX0ED+2GdzI X-Received: by 10.236.137.8 with SMTP id x8mr47113298yhi.4.1398787754421; Tue, 29 Apr 2014 09:09:14 -0700 (PDT) Original-Sender: kevin@bortis.ch In-Reply-To: X-Google-Sender-Auth: UKWGBfDY3wwYjfNYI_XPpGx5Tbo Xref: news.gmane.org gmane.linux.lib.musl.general:4989 Archived-At: Hi I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 and 4.8. Seems to work. Would be nice if the 1.1.1 release will include a fix. Regards Kevin On Tue, Apr 29, 2014 at 3:14 AM, Stephen Thomas wrote: >> On Tue, Apr 29, 2014 at 12:52:36AM +0100, Stephen Thomas wrote: >> > I remember that the old thumb didn't support the conditional >> > instructions and was quite slow. I only care about thumb2 and am >> > currently using gcc, so I attach a patch for the thumb that will >> >> The code here is only used on armv6/v7. Do any such chips lack thumb2? >> If there's any doubt, we could look at what gcc generates for the >> __sync_* builtins in thumb mode. >> >> > only work for gcc . >> >> Why is it only for gcc? > > I have only tested with gcc. I don't know what llvm nor armcc do. Is there > an ASM standard like ther is for C/C++/fortran? There is some good info on > thumb here, https://wiki.ubuntu.com/ARM/Thumb2 and the various ways of > supporting ARM. I guess that the thumb2 could be replaced by a __thumb__. > >> >> > I think that gcc builds two versions of atomic >> >> What do you mean by this? > > I am building the native toolchain as I would like to run this on an > embedded platform. My understanding is that when you build the toolchain you > need to provide somethings that end up going in libgcc_s.so such as > threading if you are using openmp in C++. etc etc. That patch works for both > the -marm and -mthumb or whatever the thumb targets are. > >> >> > so the ugly #define was needed. I cannot remember what rvct/rvds or >> > whatever it is branded as these days uses, but from memory old >> > versions didn't support the gnu assebmly syntax. >> >> All asm in musl is gas syntax so this is nothing new. >> >> Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5000 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Wed, 30 Apr 2014 15:03:57 -0400 Message-ID: <20140430190357.GM26358@brightrain.aerifal.cx> References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> 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 1398884691 668 80.91.229.3 (30 Apr 2014 19:04:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Apr 2014 19:04:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5004-gllmg-musl=m.gmane.org@lists.openwall.com Wed Apr 30 21:04:45 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 1WfZoB-000196-Od for gllmg-musl@plane.gmane.org; Wed, 30 Apr 2014 21:04:43 +0200 Original-Received: (qmail 9813 invoked by uid 550); 30 Apr 2014 19:04:41 -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 9703 invoked from network); 30 Apr 2014 19:04:09 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5000 Archived-At: On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote: > Hi > > I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 > and 4.8. Seems to work. Would be nice if the 1.1.1 release will > include a fix. It only works for armv7. On armv6k, I'm getting errors that the instructions aren't supported. I think we could simply add !thumb as a condition for the whole block... Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5050 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Sun, 4 May 2014 12:54:40 +0100 Message-ID: References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> <20140430190357.GM26358@brightrain.aerifal.cx> 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 1399204499 4736 80.91.229.3 (4 May 2014 11:54:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 11:54:59 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5054-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 13:54:54 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 1Wgv0Q-0000Uf-5N for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 13:54:54 +0200 Original-Received: (qmail 16340 invoked by uid 550); 4 May 2014 11:54: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 16331 invoked from network); 4 May 2014 11:54:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=B6fNYjgfQt/IXjJSompEsx9xxvf8urnHvRNqilj71Mo=; b=nvClqJeyJ6sFaqW1BYMl1RSBPbuA1j5c/bdN3+VBgkExWBTb65/fcQsXwepC5oS5Gj qY7ZZtxzaGGhl7Wsag6cejV+lQ+cw6C/bBQjRe94mNnmJ1K66bPb8FYW5bDsCQqdxQWy igpDKkMv/fRmJQ06Owo9kNrMgoGG37NImmLZ8= 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:date :message-id:subject:from:to:content-type; bh=B6fNYjgfQt/IXjJSompEsx9xxvf8urnHvRNqilj71Mo=; b=lOLjygofVzO1v01qBjxQigWI3xrLlHWTrYq612trI3XR6PkXevWYYolNq0pt4H6JNd DmJmfg2k7fs1UR/UuM57H7BEJxvmK5AsnYczmbCwBY8y+eRCxaguillZ3hKZ7lxhnmZo 4aXntCgJZx8BgA2Fb9oCOxDuRFJ0maZFVIUdV3M3WulOZS7JlyjP0F57HyGKeyvagw5r DydjGePUXWDJSCUVjyhy/IBs7UVv4keZjJQjp9W0ZI0yzjqBrusdIGsl982riQQlNIlU skO4JlDIp2DB0j7lE29eDrgyqXqhOuq+7lFpDxJ4fkuDQ4uS+tCZnL1S+rKOb1yzBqRh BwTw== X-Gm-Message-State: ALoCoQk2iwwugK0+SlfIxPDptWd8SQA4yvjCVLSnHsfI5FUCKyaKybf8xsps3QuMxb+PMhKW0W+D X-Received: by 10.60.62.178 with SMTP id z18mr1458912oer.61.1399204481061; Sun, 04 May 2014 04:54:41 -0700 (PDT) In-Reply-To: <20140430190357.GM26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:5050 Archived-At: On Wed, Apr 30, 2014 at 8:03 PM, Rich Felker wrote: > On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote: >> Hi >> >> I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 >> and 4.8. Seems to work. Would be nice if the 1.1.1 release will >> include a fix. > > It only works for armv7. On armv6k, I'm getting errors that the > instructions aren't supported. I think we could simply add !thumb as a > condition for the whole block... The patch has the wrong conditional in, there are no standard __thumb__ and __thumb2__ defines, it is __ARM_ARCH_ISA_THUMB being 1 or 2 that differentiates. armv6k does not support thumb2. I should have enough machines of different flavours to make a working patch. We should be able to support just using thumb2, for thumb 1 I guess we can support a mixed mode with some files like this compiled for arm only, but the rest compiled with thumb, with interop turned on. Not sure how messy this will turn out to be. Justin From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5051 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Sun, 4 May 2014 08:01:23 -0400 Message-ID: <20140504120123.GB23751@brightrain.aerifal.cx> References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> <20140430190357.GM26358@brightrain.aerifal.cx> 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 1399204906 8938 80.91.229.3 (4 May 2014 12:01:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 12:01:46 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5055-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 14:01:40 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 1Wgv6t-000595-TN for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 14:01:35 +0200 Original-Received: (qmail 22455 invoked by uid 550); 4 May 2014 12:01:35 -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 22447 invoked from network); 4 May 2014 12:01:35 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5051 Archived-At: On Sun, May 04, 2014 at 12:54:40PM +0100, Justin Cormack wrote: > On Wed, Apr 30, 2014 at 8:03 PM, Rich Felker wrote: > > On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote: > >> Hi > >> > >> I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 > >> and 4.8. Seems to work. Would be nice if the 1.1.1 release will > >> include a fix. > > > > It only works for armv7. On armv6k, I'm getting errors that the > > instructions aren't supported. I think we could simply add !thumb as a > > condition for the whole block... > > The patch has the wrong conditional in, there are no standard > __thumb__ and __thumb2__ defines, it is __ARM_ARCH_ISA_THUMB being 1 > or 2 that differentiates. armv6k does not support thumb2. I should > have enough machines of different flavours to make a working patch. I don't see __ARM_ARCH_ISA_THUMB getting defined at all (gcc 4.7.1) so it doesn't seem reliable. __THUMBEL__ is defined in thumb mode (presumably the EL is for little endian?) but that's the only thing I'm getting that seems relevant other than __thumb__. > We should be able to support just using thumb2, for thumb 1 I guess we > can support a mixed mode with some files like this compiled for arm > only, but the rest compiled with thumb, with interop turned on. Not > sure how messy this will turn out to be. armv6 does not seem to have thumb2, does it? And for armv7 I think it should be reasonable to assume any thumb support is thumb2. Is this wrong? Aside from the question of the macro name, I think the current patch covers all cases that can be covered. (BTW as far as I can tell there's no good reason to ever compile with -mthumb for pre-v7, but it doesn't hurt to support it. All the asm is arm mode anyway, so -mthumb doesn't get you the ability to run on obscure hardware that's thumb-only unless you rewrite all the asm too.) Rich From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5053 Path: news.gmane.org!not-for-mail From: Justin Cormack Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Sun, 4 May 2014 14:56:49 +0100 Message-ID: References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> <20140430190357.GM26358@brightrain.aerifal.cx> <20140504120123.GB23751@brightrain.aerifal.cx> 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 1399211831 26825 80.91.229.3 (4 May 2014 13:57:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 13:57:11 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5057-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 15:57:06 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 1Wgwud-0002FT-71 for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 15:57:03 +0200 Original-Received: (qmail 18070 invoked by uid 550); 4 May 2014 13:57:02 -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 18061 invoked from network); 4 May 2014 13:57:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=specialbusservice.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=APXVcHGxAAtQrzgg4OhIqjcj06aLVkAjxt+r7B8K7xY=; b=BnmqE45M+fDqIDI7RwUzmlOI/ctd+pJCteFAoXbCQ7FYVZBsmX+5aXNuQ+ohA05SvI /ZvkKdE+VXBZPLUmICptsyIIFZ64knCPZuPP0hFwQVOIvGqlw3+bzn9IbL3ownFV+W3J SeDSrt1v8sknjnT08JzQkG4SnB2GmsREFEf3k= 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:date :message-id:subject:from:to:content-type; bh=APXVcHGxAAtQrzgg4OhIqjcj06aLVkAjxt+r7B8K7xY=; b=YEA4LVEpvQVIa6/EBkO2XpuLlZ2SVGSaI0sOADNGR6cX83oy92YRbOgXZq14j+Yg/O vWcgiZdNz6yWVeOl0OG3fAG4ZvPQBxWOM7mp5loHcGBPvYC51yub4vRuoD8foczKZmuL JQiqcBPSqzDOfS3Omv2zk6SfiJqnbO6CN1LZxRtTo4JbOma8i+PSO2Vi/y0DAcCY1JKB YkuSCLONIfNuA2iOthpotHdEA+YzIyY/cX7pJUiHn61WbsZMD2m6jioXxh+v4QFs9faN +5ZaN0b2CSAYAYKFcmFT1GeJrpOEICzIE6IyxOJaxo93BOQO2zXo56Hjd0ga/MFsjJ7m F3jA== X-Gm-Message-State: ALoCoQnTfZNJv4WSLCIsou0wrx8hkZJ39OJ7WdDmKtzWn1lIpgfDEtftoA00WXlxa+tOZKIUHjiK X-Received: by 10.182.225.137 with SMTP id rk9mr2193125obc.51.1399211809526; Sun, 04 May 2014 06:56:49 -0700 (PDT) In-Reply-To: <20140504120123.GB23751@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:5053 Archived-At: On Sun, May 4, 2014 at 1:01 PM, Rich Felker wrote: > On Sun, May 04, 2014 at 12:54:40PM +0100, Justin Cormack wrote: >> On Wed, Apr 30, 2014 at 8:03 PM, Rich Felker wrote: >> > On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote: >> >> Hi >> >> >> >> I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7 >> >> and 4.8. Seems to work. Would be nice if the 1.1.1 release will >> >> include a fix. >> > >> > It only works for armv7. On armv6k, I'm getting errors that the >> > instructions aren't supported. I think we could simply add !thumb as a >> > condition for the whole block... >> >> The patch has the wrong conditional in, there are no standard >> __thumb__ and __thumb2__ defines, it is __ARM_ARCH_ISA_THUMB being 1 >> or 2 that differentiates. armv6k does not support thumb2. I should >> have enough machines of different flavours to make a working patch. > > I don't see __ARM_ARCH_ISA_THUMB getting defined at all (gcc 4.7.1) so > it doesn't seem reliable. __THUMBEL__ is defined in thumb mode > (presumably the EL is for little endian?) but that's the only thing > I'm getting that seems relevant other than __thumb__. I was wrong, sorry, __thumb__ and __thumb2__ are defined. Maybe __ARM_ARCH_ISA_THUMB does seem to be not defined always. >> We should be able to support just using thumb2, for thumb 1 I guess we >> can support a mixed mode with some files like this compiled for arm >> only, but the rest compiled with thumb, with interop turned on. Not >> sure how messy this will turn out to be. > > armv6 does not seem to have thumb2, does it? And for armv7 I think it > should be reasonable to assume any thumb support is thumb2. Is this > wrong? Aside from the question of the macro name, I think the current > patch covers all cases that can be covered. (BTW as far as I can tell > there's no good reason to ever compile with -mthumb for pre-v7, but it > doesn't hurt to support it. All the asm is arm mode anyway, so -mthumb > doesn't get you the ability to run on obscure hardware that's > thumb-only unless you rewrite all the asm too.) Some armv6 machines have thumb2, but not many (ARMv6T2 apparently, I don't have one I don't think). All v7 machines do have (only) thumb2. So you could test ARM_ARCH_6T2 or __thumb2__. Alternatively it seems you can compile with -Wa,-mimplicit-it=always and you don't need the patch at all. That could make it easier in future. So far all the thumb2-only hardware has no MMU, so less likely to be using musl... Justin From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5054 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: thumb2 support Date: Sun, 4 May 2014 10:09:59 -0400 Message-ID: <20140504140959.GA25506@brightrain.aerifal.cx> References: <20140428120630.GG12324@port70.net> <20140428142714.GX26358@brightrain.aerifal.cx> <20140429005658.GC26358@brightrain.aerifal.cx> <20140430190357.GM26358@brightrain.aerifal.cx> <20140504120123.GB23751@brightrain.aerifal.cx> 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 1399212620 3552 80.91.229.3 (4 May 2014 14:10:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 14:10:20 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5058-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 16:10:13 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 1Wgx7M-0002NM-1x for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 16:10:12 +0200 Original-Received: (qmail 28303 invoked by uid 550); 4 May 2014 14:10: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 28289 invoked from network); 4 May 2014 14:10:10 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5054 Archived-At: On Sun, May 04, 2014 at 02:56:49PM +0100, Justin Cormack wrote: > I was wrong, sorry, __thumb__ and __thumb2__ are defined. Maybe > __ARM_ARCH_ISA_THUMB does seem to be not defined always. OK, so the patch as committed should at least be ok, even if not optimal. > Some armv6 machines have thumb2, but not many (ARMv6T2 apparently, I > don't have one I don't think). In any case it's not broken on them, just using the kuser helpers rather than inlines. > All v7 machines do have (only) thumb2. > So you could test ARM_ARCH_6T2 or __thumb2__. We could change the !__thumb__ test to (!__thumb__||__thumb2__). > Alternatively it seems you can compile with -Wa,-mimplicit-it=always > and you don't need the patch at all. That could make it easier in > future. Yes, but it doesn't fix the fact that we have to omit the asm entirely on thumb1. Also adding mandatory arch-specific CFLAGS is probably more ugly than tucking away this logic in the arch-specific atomic.h file. > So far all the thumb2-only hardware has no MMU, so less likely to be > using musl... And if it is using musl it will probably need a special bare-metal-type port with its own asm dirs rather than using the existing Linux/ARM asm. (Of course rdp has an approach that shares the Linux asm and syscall framework despite being "bare-metal".) Rich