Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140428142714.GX26358@brightrain.aerifal.cx>
Date: Mon, 28 Apr 2014 10:27:14 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: thumb2 support

On Mon, Apr 28, 2014 at 02:06:31PM +0200, Szabolcs Nagy wrote:
> * Stephen Thomas <scjthm@...e.com> [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.

> 
> > <deleted>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'
> > <deleted>
> > 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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.