Bug#543975: FTBFS: mips/mipsel -- Assembler errors

View: New views
3 Messages — Rating Filter:   Alert me  

Bug#543975: FTBFS: mips/mipsel -- Assembler errors

by smr99 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Boost failed to build this week, with numerous files spewing out
assembler errors such as

  Error: opcode not supported on this processor: mips1 (mips1) `ll $3,4($16)'

What causes the compiler to emit opcodes that the assembler cannot
process?  Boost (v 1.38) built OK on june 30, and I'm sure that many
of the files in question have not changed in v 1.39.

I'd appreciate help debugging this.

See
https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-1&arch=mips&stamp=1249965048&file=log
https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-1&arch=mipsel&stamp=1250006828&file=log
https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-2&arch=mips&stamp=1251393955&file=log


Thanks,
-Steve


signature.asc (196 bytes) Download Attachment

Re: Bug#543975: FTBFS: mips/mipsel -- Assembler errors

by Florian Lohoff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Aug 28, 2009 at 09:38:45PM -0500, Steve M. Robbins:

> Hi,
>
> Boost failed to build this week, with numerous files spewing out
> assembler errors such as
>
>   Error: opcode not supported on this processor: mips1 (mips1) `ll $3,4($16)'
>
>
> What causes the compiler to emit opcodes that the assembler cannot
> process?  Boost (v 1.38) built OK on june 30, and I'm sure that many
> of the files in question have not changed in v 1.39.
ll/sc are mips2 opcodes - Debian used to be mips1 to support
the pre R4k (R3/R2k arch). For atomic ops the only solution was to
use ll/sc from mips2 and for r2/r3k emulate them in kernel.

For the assembler to emit mips2 opcodes although it was told to
do mips1 you need to instruct the assembler:

http://lists.debian.org/debian-mips/2009/04/msg00017.html

> I'd appreciate help debugging this.
>
> See
> https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-1&arch=mips&stamp=1249965048&file=log
> https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-1&arch=mipsel&stamp=1250006828&file=log
> https://buildd.debian.org/fetch.cgi?&pkg=boost1.39&ver=1.39.0-2&arch=mips&stamp=1251393955&file=log

A quick grep revealed this file and some functions using ll/sc:

boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp

inline void atomic_increment( int * pw )
{
    // ++*pw;

    int tmp;

    __asm__ __volatile__
    (
        "0:\n\t"
        "ll %0, %1\n\t"
        "addiu %0, 1\n\t"
        "sc %0, %1\n\t"
        "beqz %0, 0b":
        "=&r"( tmp ), "=m"( *pw ):
        "m"( *pw )
    );
}

Flo
--
Florian Lohoff                                         flo@...
"Es ist ein grobes Missverständnis und eine Fehlwahrnehmung, dem Staat
im Internet Zensur- und Überwachungsabsichten zu unterstellen."
- - Bundesminister Dr. Wolfgang Schäuble -- 10. Juli in Berlin


signature.asc (196 bytes) Download Attachment

Re: Bug#543975: FTBFS: mips/mipsel -- Assembler errors

by smr99 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Florian,


On Sat, Aug 29, 2009 at 07:13:19AM +0200, Florian Lohoff wrote:

> On Fri, Aug 28, 2009 at 09:38:45PM -0500, Steve M. Robbins:
> > Hi,
> >
> > Boost failed to build this week, with numerous files spewing out
> > assembler errors such as
> >
> >   Error: opcode not supported on this processor: mips1 (mips1) `ll $3,4($16)'
> >
> >
> > What causes the compiler to emit opcodes that the assembler cannot
> > process?  Boost (v 1.38) built OK on june 30, and I'm sure that many
> > of the files in question have not changed in v 1.39.
Well, it looks like the offending file is new, after all.  


> ll/sc are mips2 opcodes - Debian used to be mips1 to support
> the pre R4k (R3/R2k arch). For atomic ops the only solution was to
> use ll/sc from mips2 and for r2/r3k emulate them in kernel.
 
Thanks for the tip; I would never have found it myself.  Does the
attached patch look correct?

Is this something specific to Debian; i.e. other mips systems would
compile in mips2 mode and not have this problem?  I'm wondering whether
this patch should be propagated upstream or not.

Thanks,
-Steve


--- boost1.39-1.39.0.orig/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
+++ boost1.39-1.39.0/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp
@@ -37,9 +37,12 @@
     __asm__ __volatile__
     (
         "0:\n\t"
+ .set push
+ .set mips2
         "ll %0, %1\n\t"
         "addiu %0, 1\n\t"
         "sc %0, %1\n\t"
+ .set pop
         "beqz %0, 0b":
         "=&r"( tmp ), "=m"( *pw ):
         "m"( *pw )
@@ -55,9 +58,12 @@
     __asm__ __volatile__
     (
         "0:\n\t"
+ .set push
+ .set mips2
         "ll %1, %2\n\t"
         "addiu %0, %1, -1\n\t"
         "sc %0, %2\n\t"
+ .set pop
         "beqz %0, 0b\n\t"
         "addiu %0, %1, -1":
         "=&r"( rv ), "=&r"( tmp ), "=m"( *pw ):
@@ -78,10 +84,13 @@
     __asm__ __volatile__
     (
         "0:\n\t"
+ .set push
+ .set mips2
         "ll %0, %2\n\t"
         "beqz %0, 1f\n\t"
         "addiu %1, %0, 1\n\t"
         "sc %1, %2\n\t"
+ .set pop
         "beqz %1, 0b\n\t"
         "addiu %0, %0, 1\n\t"
         "1:":



signature.asc (196 bytes) Download Attachment