On 03/23/2016 02:21 PM, John Paul Adrian Glaubitz wrote:
> dietlibc currently fails to build from source on powerpcspe because the code
> is missing FPU emulation:
> [...]
> __dtostr.c:(.text+0xc0): undefined reference to `__unorddf2'
> __dtostr.c:(.text+0x110): undefined reference to `__unorddf2'
> collect2: error: ld returned 1 exit status
> make: *** [build-stamp] Error 1
> debian/rules:54: recipe for target 'build-stamp' failed
> 
> "__unorddf2" is a function in the FPU emulation library present in glibc. In
> the past, the FPU emulation code was present in libgcc which is why dietlibc
> used to build find on powerpcspe. However, the FPU emulation code in gcc
> has been deprecated in favour of the code present in glibc 2.19 or newer
> and any recent version of gcc built on a system with glibc 2.19 or newer
> will automatically deactivate its built-in FPU emulation code.

I've now ported most of glibc's FPU emulation support for e500 CPUs to
dietlibc. (What I didn't port were functions that dietlibc doesn't
implement at all, such as all the <fenv.h> functions, because libm stuff
is mostly not implemented in dietlibc yet; for example, even sqrt() only
works on i386 at the moment, see #706327.)

I've test-compiled dietlibc with my patch in a qemu-user ppcspe chroot,
and it doesn't FTBFS anymore. Also, I tried a small test program that
converts a string to a double, does a bit of trivial arithmetic with it
and outputs the result via printf - and that worked as expected.

I've pushed this to the ports/ppcspe branch in dietlibc's collab-maint
git packaging repository:

https://anonscm.debian.org/cgit/collab-maint/dietlibc.git/log/?h=ports/ppcspe

Clone via:
git clone https://anonscm.debian.org/git/collab-maint/dietlibc.git -b 
ports/ppcspe

As I don't have access to any real hardware, it would be nice if you
could test-build it (gbp works). It would also be great that if it
does indeed work, you could try to then build the current src:mksh
from unstable with dietlibc-dev installed, to see if there are any
regressions.

Regards,
Christian

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to