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