nolp instruction and i686 cpus

Adam Golebiowski adamg at pld-linux.org
Sat Dec 18 15:35:17 CET 2010


Hi,

Some of the i686 compatible cpus (VIA C3 Nehemiah [0], AMD Geode LX, 
Transmeta Cruose, probably others) lack support for the NOLP instruction 
(optional for i686).

Unfortunately there was a wrong assumption about NOLP in binutils for a 
while, resulting in glibc (and probably other packages) misusing NOLP 
when they shouldn't:

[root at rescue /]# chroot /mnt/
Illegal instruction
[root at rescue /]#

(this is a Nehemiah machine).

This has been fixed in binutils a while ago [1], [2], and 
binutils-2.21.51.0.4-1 seems to behave properly:

[adamg at carme-pld-i686 nopl]$ cat nopl.s
cmove %eax,%edx
.align 8
[adamg at carme-pld-i686 nopl]$

[adamg at carme-pld-i686 nopl]$ cat test.sh
#!/bin/sh
for arch in i686 pentium4; do
         for tune in i686 pentium4; do
                 echo "=> --march=$arch --mtune=$tune"
                 as --32 --march=$arch --mtune=$tune nopl.s
                 objdump -dr a.out | grep nopl
         done
done
[adamg at carme-pld-i686 nopl]$ ./test.sh
=> --march=i686 --mtune=i686
=> --march=i686 --mtune=pentium4
=> --march=pentium4 --mtune=i686
    3:   0f 1f 44 00 00          nopl   0x0(%eax,%eax,1)
=> --march=pentium4 --mtune=pentium4
    3:   0f 1f 44 00 00          nopl   0x0(%eax,%eax,1)
[adamg at carme-pld-i686 nopl]$

With our current optflags (--march=i686 --mtune=pentium4) we should be 
safe, so all that's left is to recompile glibc and some unknown number 
of other packages - on carme-i686 I found libggi to be affected as well.

I realize there's probably a handful of users affected by this, and 
eventually the problem will be solved during usual rebuilding of 
affected packages but it would be nice to be able to install th-i686 on 
this machine sooner than later.

Glibc does not compile at this moment [3], which should be fixed anyway. 
Any help with this will be greatly appreciated:

CPP='i686-pld-linux-gcc -E -x c-header' 
/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/elf/ld-linux.so.2 
--library-path 
/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/math:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/elf:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/dlfcn:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/nss:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/nis:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/rt:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/resolv:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/crypt:/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/nptl 
/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/sunrpc/rpcgen -Y 
../scripts -c rpcsvc/nlm_prot.x -o /home/
 
users/builder/rpm/BUILD/glibc-2.12.1/builddir/sunrpc/xnlm_prot.T.././scripts/mkinstalldirs 
/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/sunrpc/rpcsvc
Memory fault
make[2]: *** 
[/home/users/builder/rpm/BUILD/glibc-2.12.1/builddir/sunrpc/xbootparam_prot.stmp] 
Error 139

Thanks,
adamg

[0] Some of the VIA C3s also don't support CMOV but this is not the case.
[1] http://www.sourceware.org/bugzilla/show_bug.cgi?id=6957
[2] http://sourceware.org/ml/binutils-cvs/2010-08/msg00057.html
[3] 
http://buildlogs.pld-linux.org/index.php?dist=th&arch=i686&ok=0&name=glibc&id=60dbdfce-6924-4dc6-9f2b-8b8ab6538bf5&action=tail

-- 
adamg


More information about the pld-devel-en mailing list