Rob Landley wrote:
> On Monday 13 December 2010 10:58:06 Konrad Eisele wrote:
>> Rob Landley wrote:
>>> All three of these worked with the previous stable release, but not with
>>> current -git.  Building against 2.6.36:

Appended is a patch that fixes the build error.
The problem occures when  __LONG_DOUBLE_128__ and hence long double support
is not defined. For a gcc that doesnt support long double I revert to the
old qp_ops.c that includes the quad foat _Q* stubs.

Does this resolve the build error on your machine ?
Can you apply that patch then? ...

-- Greetings Konrad


>>>
>>> sparc died with:
>>>
>>> In file included from libc/sysdeps/linux/sparc/soft-fp/q_div.c:24:
>>> libc/sysdeps/linux/sparc/soft-fp/quad.h:63: error: unable to emulate 'TF'
>>> In file included from libc/sysdeps/linux/sparc/soft-fp/q_fle.c:24:
>>> libc/sysdeps/linux/sparc/soft-fp/quad.h:63: error: unable to emulate 'TF'
>>> libc/sysdeps/linux/sparc/soft-fp/q_fle.c: In function '_Q_fle':
>>> libc/sysdeps/linux/sparc/soft-fp/q_fle.c:28: warning: unused variable
>>> '_fcw' make: *** [libc/sysdeps/linux/sparc/soft-fp/q_fle.os] Error 1
>>> make: *** Waiting for unfinished jobs....
>>> make: *** [libc/sysdeps/linux/sparc/soft-fp/q_div.os] Error 1
>>
>> Can you send me gcc's configure line for the sparc toolchain that you use?
> 
> All targets build with:
> 
>   # Are we building C only, or C and C++?
>   [ -z "$NO_CPLUSPLUS" ] &&
>     STUFF="--enable-languages=c,c++ --disable-libstdcxx-pch" ||
>     STUFF="--enable-languages=c"
> 
>   # Configure gcc
>   "$CURSRC/configure" --target="$CROSS_TARGET" --prefix="$STAGE_DIR" \
>     --disable-multilib --disable-nls --enable-c99 --enable-long-long \
>     --enable-__cxa_atexit $STUFF --program-prefix="$TOOLCHAIN_PREFIX" \
>     "$@" $GCC_FLAGS &&
> 
> And in the case of the simple cross compiler (which is what's failing), the 
> call to the configure function would be:
> 
>   AR_FOR_TARGET="${ARCH}-ar" configure_gcc \
>     --disable-threads --disable-shared --host="$CROSS_HOST"
> 
> In sources/targets/sparc/settings we have:
> 
>   GCC_FLAGS="--enable-sjlj-exceptions"
> 
> And then in sources/functions.sh the generic setup gives us:
> 
>   CROSS_TARGET=${ARCH}-unknown-linux
>   CROSS_HOST=$(uname -m)-walrus-linux
> 
> Which gives us:
> 
> AR_FOR_TARGET=sparc-ar ../gcc-core/configure --target=sparc-unknown-linux \
>   --prefix=/big/long/irrelevant/path --disable-multilib --disable-nls \
>   --enable-c99 --enable-long-long --enable-__cxa_atexit \
>   --enable-languages=c,c++ --disable-libstdcxx-pch \
>   --program=prefix=sparc- --disable-threads --disable-shared \
>   --host=x86_64-walrus-linux --enable-sjlj-exceptions
> 
> (And yes, using the wrong ar breaks some target, I forget which.  Wasn't 
> sparc.  I remember the target that broke when using the wrong strip was sh4.)
> 
>> Are you using a setup with a gcc/config/sparc/t-* snippet that has FPBIT
>> and DPBIT not set?
> 
> Possibly?  I dunno what FPBIT and DPBIT are.
> 
> I'm building stock gcc 4.2.1 with binutils 2.17 (last GPLv2 release of each, 
> I 
> await either LLVM or PCC maturing to usability with bated breath).  I am 
> applying a few patches but none of them are sparc stuff.  (Half of them fix 
> various issues with arm, one makes libgcc_eh.a build during the --disable-
> shared pass, and the rest fix OBVIOUS breakage with sh4, alpha, and mips64 of 
> the "how did they ever use those targets" variety).
> 
> However, sparc previously built and booted to a shell prompt under qemu for 
> me.  (Dynamic linking was broken but static worked just fine.)  Not saying it 
> was correct, I'm just saying it worked for me.
> 
>> FPBIT =
>> DPBIT =
>>
>> t-elf for instance defines:
>> ...
>> FPBIT = fp-bit.c
>> DPBIT = dp-bit.c
> 
> gcc/config/sparc/t-linux contains no mention of those.
> 
> You're saying that to build for linux I need to specify sparc-elf instead of 
> sparc-unknown-linux the way all the other targets work?  (I can patch gcc if 
> it would help.  I'm more or less maintaining a feature-frozen GPLv2 fork of 
> the thing until LLVM/PCC/tinycc/something matures, since I refuse to get any 
> GPLv3 on me unless paid to do so.  However, the previous release didn't need 
> this...)
> 
>> dp-bit.c: $(srcdir)/config/fp-bit.c
>>      cat $(srcdir)/config/fp-bit.c > dp-bit.c
>>
>> fp-bit.c: $(srcdir)/config/fp-bit.c
>>      echo '#define FLOAT' > fp-bit.c
>>      cat $(srcdir)/config/fp-bit.c >> fp-bit.c
>> ...
>>
>> if I can reproduce the error here (if you send the gcc configure line) I
>> can try to post a patch that handles the error...
>> -- Greetings Konrad
> 
> Cool.  Thanks.
> 
> (I can send you a binary version of a cross compiler that build 0.9.31 if 
> you'd like.  I have tarballs up at 
> http://landley.net/aboriginal/downloads/binaries for all the targets I've 
> gotten to work so far.  It's 32 bit x86 host binaries statically linked 
> against uClibc and wrapped to be path-agnostic, so you can just drop them 
> into 
> your home directory or something and add the "bin" subdirectory to your 
> $PATH, 
> then use the prefixed tool names ala "sparc-cc" and "sparc-ld" and such.)
> 
> Rob

>From c09add95e23ec1ff618875e3f88133a49014e396 Mon Sep 17 00:00:00 2001
From: Konrad Eisele <[email protected]>
Date: Tue, 14 Dec 2010 13:49:17 +0100
Subject: [PATCH 1/1] sparc: check for log double support in gcc

To compile the quad float emulation library gcc needs
__LONG_DOUBLE_128__ macro defined. Check first, if not
supported then revert to the qp_ops.c stubs

Signed-off-by: Konrad Eisele <[email protected]>
---
 libc/sysdeps/linux/sparc/Makefile.arch |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libc/sysdeps/linux/sparc/Makefile.arch b/libc/sysdeps/linux/sparc/Makefile.arch
index 91c6e85..d0cae9f 100644
--- a/libc/sysdeps/linux/sparc/Makefile.arch
+++ b/libc/sysdeps/linux/sparc/Makefile.arch
@@ -16,9 +16,15 @@ CSRC += sigaction.c
 SSRC += fork.S vfork.S
 endif
 
+# check weather __LONG_DOUBLE_128__ is defined (long double support)
+UCLIBC_SPARC_HAS_LONG_DOUBLE=$(shell if [ "x`$(CC) -E -dM -xc /dev/null 2>&1 | grep __LONG_DOUBLE_128__`" != "x" ]; then echo "y"; fi)
+ifeq ($(UCLIBC_SPARC_HAS_LONG_DOUBLE),y)
 CSRC += $(foreach f, \
 	q_div.c   q_fle.c    q_mul.c   q_qtoll.c   q_stoq.c    \
 	mp_clz_tab.c  q_dtoq.c  q_flt.c    q_neg.c   q_qtos.c    q_sub.c    \
 	q_add.c      q_feq.c   q_fne.c    q_qtod.c  q_qtou.c    q_ulltoq.c  \
 	q_cmp.c      q_fge.c   q_itoq.c   q_qtoull.c  q_util.c    \
 	q_cmpe.c     q_fgt.c   q_lltoq.c  q_qtoi.c  q_sqrt.c    q_utoq.c, soft-fp/$(f))
+else
+CSRC += qp_ops.c
+endif
-- 
1.6.4.1

_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to