GNU bug report logs - #13353
Coreutils-8.20 mips build broken

Previous Next

Package: coreutils;

Reported by: Marko Lindqvist <cazfi74 <at> gmail.com>

Date: Fri, 4 Jan 2013 05:47:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13353 in the body.
You can then email your comments to 13353 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#13353; Package coreutils. (Fri, 04 Jan 2013 05:47:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Marko Lindqvist <cazfi74 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Fri, 04 Jan 2013 05:47:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Marko Lindqvist <cazfi74 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Coreutils-8.20 mips build broken
Date: Fri, 4 Jan 2013 07:45:52 +0200
I've tried to update coreutils version used in OpenEmbedded. I've been
building for x86, arm, and mips architectures. Coreutils-8.19 builds
fine for all three, but 8.20 fails on mips with lots of "unable to
emulate 'TI'" errors and "right whift count >= width of type" warnings
from src/factor.c. First error comes from line 766.


 - ML




Information forwarded to bug-coreutils <at> gnu.org:
bug#13353; Package coreutils. (Fri, 04 Jan 2013 08:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 13353 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Marko Lindqvist <cazfi74 <at> gmail.com>
Cc: 13353 <at> debbugs.gnu.org
Subject: Re: bug#13353: Coreutils-8.20 mips build broken
Date: Fri, 04 Jan 2013 00:51:14 -0800
On 01/03/2013 09:45 PM, Marko Lindqvist wrote:
> 8.20 fails on mips with lots of "unable to
> emulate 'TI'" errors

That sounds like a compiler problem of some sort.

> "right whift count >= width of type" warnings
> from src/factor.c. First error comes from line 766.

What's the output of 'cc -E' for that file, using
the same flags as is used for 'cc -c'?  This will
help us track down what's shifting what.




Information forwarded to bug-coreutils <at> gnu.org:
bug#13353; Package coreutils. (Fri, 04 Jan 2013 11:41:04 GMT) Full text and rfc822 format available.

Message #11 received at 13353 <at> debbugs.gnu.org (full text, mbox):

From: Marko Lindqvist <cazfi74 <at> gmail.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 13353 <at> debbugs.gnu.org
Subject: Re: bug#13353: Coreutils-8.20 mips build broken
Date: Fri, 4 Jan 2013 13:40:11 +0200
On 4 January 2013 10:51, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> On 01/03/2013 09:45 PM, Marko Lindqvist wrote:
>> 8.20 fails on mips with lots of "unable to
>> emulate 'TI'" errors
>
> That sounds like a compiler problem of some sort.

 I've tried to find proper gcc documentation clearly stating which
architectures TImode is available, but found none. There's old emails
discussing the possibility of implementing TImode to MIPS, but it's
not clear to me what's the current status is even supposed to be.

>> "right whift count >= width of type" warnings
>> from src/factor.c. First error comes from line 766.

This warning is likely to follow from the error above, and not to be
separate issue.


 - ML




Information forwarded to bug-coreutils <at> gnu.org:
bug#13353; Package coreutils. (Fri, 04 Jan 2013 12:13:02 GMT) Full text and rfc822 format available.

Message #14 received at 13353 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Marko Lindqvist <cazfi74 <at> gmail.com>
Cc: 13353 <at> debbugs.gnu.org
Subject: Re: bug#13353: Coreutils-8.20 mips build broken
Date: Fri, 04 Jan 2013 12:12:37 +0000
On 01/04/2013 05:45 AM, Marko Lindqvist wrote:
> I've tried to update coreutils version used in OpenEmbedded. I've been
> building for x86, arm, and mips architectures. Coreutils-8.19 builds
> fine for all three, but 8.20 fails on mips with lots of "unable to
> emulate 'TI'" errors and "right whift count >= width of type" warnings
> from src/factor.c. First error comes from line 766.

That's umul_ppmm() which is coming from longlong.h

#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
#if __GMP_GNUC_PREREQ (4,4)
#define umul_ppmm(w1, w0, u, v) \
  do {                                                                  \
    typedef unsigned int __ll_UTItype __attribute__((mode(TI)));        \
    __ll_UTItype __ll = (__ll_UTItype)(u) * (v);                        \
    w1 = __ll >> 64;                                                    \
    w0 = __ll;                                                          \
  } while (0)
#endif

I've only gcc (RAYS 4.3.0-4.rays0) 4.3.1 20080501 (prerelease)
on an ICT Loongson-2 V0.3  FPU V0.1
but that allows me to check various macros to key on....

$ for abi in 32 o64 n32 64; do
    for cpu in mips1 mips2 mips3 mips4 mips32 mips32r2 mips64; do
      echo "--------- $cpu/$abi --------"
      cpp -mabi=$abi -march=$cpu -dM /dev/null |
      grep -Ei "__mips |LP|_MPIS_SZ"
    done
done

--------- mips1/32 --------
#define __mips 1
--------- mips2/32 --------
#define __mips 2
--------- mips3/32 --------
#define __mips 3
--------- mips4/32 --------
#define __mips 4
--------- mips32/32 --------
#define __mips 32
--------- mips32r2/32 --------
#define __mips 32
--------- mips64/32 --------
#define __mips 64
--------- mips1/o64 --------
cc1: error: '-march=mips1' is not compatible with the selected ABI
--------- mips2/o64 --------
cc1: error: '-march=mips2' is not compatible with the selected ABI
--------- mips3/o64 --------
#define __mips 3
--------- mips4/o64 --------
#define __mips 4
--------- mips32/o64 --------
cc1: error: '-march=mips32' is not compatible with the selected ABI
--------- mips32r2/o64 --------
cc1: error: '-march=mips32r2' is not compatible with the selected ABI
--------- mips64/o64 --------
#define __mips 64
--------- mips1/n32 --------
cc1: error: '-march=mips1' is not compatible with the selected ABI
--------- mips2/n32 --------
cc1: error: '-march=mips2' is not compatible with the selected ABI
--------- mips3/n32 --------
#define __mips 3
--------- mips4/n32 --------
#define __mips 4
--------- mips32/n32 --------
cc1: error: '-march=mips32' is not compatible with the selected ABI
--------- mips32r2/n32 --------
cc1: error: '-march=mips32r2' is not compatible with the selected ABI
--------- mips64/n32 --------
#define __mips 64
--------- mips1/64 --------
cc1: error: '-march=mips1' is not compatible with the selected ABI
--------- mips2/64 --------
cc1: error: '-march=mips2' is not compatible with the selected ABI
--------- mips3/64 --------
#define __LP64__ 1
#define _LP64 1
#define __mips 3
--------- mips4/64 --------
#define __LP64__ 1
#define _LP64 1
#define __mips 4
--------- mips32/64 --------
cc1: error: '-march=mips32' is not compatible with the selected ABI
--------- mips32r2/64 --------
cc1: error: '-march=mips32r2' is not compatible with the selected ABI
--------- mips64/64 --------
#define __LP64__ 1
#define _LP64 1
#define __mips 64


Notice that the macro in longlong.h checks __mips > 3
but note that that can be 32 or 64 dependent on --march.
In any case it looks like we also need to key on _LP64.

So could you try the following patch.
With your compiler options it will probably avoid
the code in longlong.h, or you may also like to
try -mabi=64 --march=from-abi if appropriate.

diff src/longlong.h.orig src/longlong.h
1240c1240
< #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
---
> #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 && defined (_LP64)

thanks,
Pádraig.




Information forwarded to bug-coreutils <at> gnu.org:
bug#13353; Package coreutils. (Fri, 04 Jan 2013 16:24:02 GMT) Full text and rfc822 format available.

Message #17 received at 13353 <at> debbugs.gnu.org (full text, mbox):

From: Marko Lindqvist <cazfi74 <at> gmail.com>
To: Pádraig Brady <P <at> draigbrady.com>
Cc: 13353 <at> debbugs.gnu.org
Subject: Re: bug#13353: Coreutils-8.20 mips build broken
Date: Fri, 4 Jan 2013 18:23:02 +0200
On 4 January 2013 14:12, Pádraig Brady <P <at> draigbrady.com> wrote:
>
> So could you try the following patch.

> diff src/longlong.h.orig src/longlong.h
> 1240c1240
> < #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
> ---
>> #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 && defined
>> (_LP64)
>
> thanks,
> Pádraig.

 Yes, that works. Thank you.


 - ML




Reply sent to Pádraig Brady <P <at> draigBrady.com>:
You have taken responsibility. (Fri, 04 Jan 2013 17:03:02 GMT) Full text and rfc822 format available.

Notification sent to Marko Lindqvist <cazfi74 <at> gmail.com>:
bug acknowledged by developer. (Fri, 04 Jan 2013 17:03:02 GMT) Full text and rfc822 format available.

Message #22 received at 13353-done <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Marko Lindqvist <cazfi74 <at> gmail.com>
Cc: 13353-done <at> debbugs.gnu.org
Subject: Re: bug#13353: Coreutils-8.20 mips build broken
Date: Fri, 04 Jan 2013 17:02:14 +0000
On 01/04/2013 04:23 PM, Marko Lindqvist wrote:
> On 4 January 2013 14:12, Pádraig Brady <P <at> draigbrady.com> wrote:
>>
>> So could you try the following patch.
>
>> diff src/longlong.h.orig src/longlong.h
>> 1240c1240
>> < #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
>> ---
>>> #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64 && defined
>>> (_LP64)
>>
>> thanks,
>> Pádraig.
>
>   Yes, that works. Thank you.

OK cool.
I think I'll use this more general patch instead.

thanks,
Pádraig.

diff --git a/src/factor.c b/src/factor.c
index 473eee7..95451a5 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -118,7 +118,14 @@
 #endif

 #ifndef USE_LONGLONG_H
-# define USE_LONGLONG_H 1
+/* With the way we use longlong.h, it's only safe to use
+   when UWtype = UHWtype, as there were various cases
+   (as can be seen in the history for longlong.h) where
+   for example, _LP64 was required to enable W_TYPE_SIZE==64 code,
+   to avoid compile time or run time issues.  */
+# if LONG_MAX == INTMAX_MAX
+#  define USE_LONGLONG_H 1
+# endif
 #endif

 #if USE_LONGLONG_H




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Feb 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 111 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.