[crosstool-ng] error building x86 toolchain

Matthias Kaehlcke matthias@kaehlcke.net
Wed Jan 7 07:14:00 GMT 2009

Hi Khem,

El Mon, Jan 05, 2009 at 04:23:31PM -0800 Khem Raj ha dit:

> On (02/01/09 18:52), Matthias Kaehlcke wrote:
> > hi,
> > 
> > i ran into an error during the crosstool-ng build for a x86
> > toolchain in the compilation of pthread_rwlock_tryrdlock.c:
> > 
> > [ALL  ]    pthread_rwlock_tryrdlock.c: Assembler messages:
> > [ALL  ]    pthread_rwlock_tryrdlock.c:52: Error: suffix or operands
> > invalid for `mov'
> > [ERROR]    make[3]: ***
> > [/data/prog/embedded/toolchains/ct-ng-build/targets/i386-unknown-linux-gnu/build/build-libc/nptl/pthread_rwlock_tryrdlock.o]
> > Error 1
> I think this error is coming from lll_lock defined in
> ./nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h. In the inline asm it
> says "g" (private)  this tells compiler to chose from any
> register, memory or immediate integer operand. So in your case compiler
> choses register bl because __shared is unsigned chari and this instruction does not expect that. Note that 
> its not possible to do a lot of checks on inline code for the compiler
> where as assembler can do better here in catching the error and it does.
> what opt level are you using? for me it works with -O2 and above 
> but I get same errors with O O1 or Os

i build the toolchain with -O

> may be typecasting private to (int) private would help here try this
> patch attached it might help.

after applying your patch pthread_rwlock_tryrdlock.c compiles.

the build now stops with another error in nptl:

[ALL  ]    make[3]: *** No rule to make target
needed by `lib-noranlib'.  Stop.

thanks a lot for your help!

Matthias Kaehlcke
Embedded Linux Engineer

    Ma patrie est où je suis, où personne ne me dérange, où personne
    ne me demande que je suis, d'où je viens et ce que je fais
                              (B. Traven)
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

For unsubscribe information see http://sourceware.org/lists.html#faq

More information about the crossgcc mailing list