Generating PPro instructions with CPUTYPE=i586?

Dimitry Andric dim at xs4all.nl
Thu Aug 28 12:55:44 PDT 2003


While trying to build a -CURRENT release for my aging Pentium 150
router box on my substantially faster Athlon XP box, I ran into the
following problem.

I'm using CPUTYPE=i586 in /etc/make.conf, since the target box is not
even capable of doing MMX. However, when the build is complete and I
try to installkernel on the target box, the install tools all bomb out
with SIGILLs. For example,

% gdb infokey
GNU gdb 5.2.1 (FreeBSD)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-undermydesk-freebsd"...
(no debugging symbols found)...
(gdb) run
Starting program: /usr/obj/usr/src/i386/legacy/usr/bin/infokey 

Program received signal SIGILL, Illegal instruction.
0x080556d4 in malloc_bytes ()
(gdb) disassemble
Dump of assembler code for function malloc_bytes:
0x80556c0 <malloc_bytes>:       push   %ebp
0x80556c1 <malloc_bytes+1>:     mov    %esp,%ebp
0x80556c3 <malloc_bytes+3>:     push   %edi
0x80556c4 <malloc_bytes+4>:     push   %esi
0x80556c5 <malloc_bytes+5>:     push   %ebx
0x80556c6 <malloc_bytes+6>:     sub    $0x1c,%esp
0x80556c9 <malloc_bytes+9>:     mov    0x8(%ebp),%eax
0x80556cc <malloc_bytes+12>:    cmp    $0xf,%eax
0x80556cf <malloc_bytes+15>:    mov    $0x10,%edx
0x80556d4 <malloc_bytes+20>:    cmovbe %edx,%eax

As you see, it seems to have generated a cmovbe instruction, which is
only supported for Pentium Pro and higher. Is this normal? From the
buildlog it seems that all tools under .../i386/legacy were built
*without* any CPU specific flags, i.e. just -O -pipe. Only from "stage
4: building libraries" I see the options change to -O -pipe
-march=pentium.

Note that the Athlon XP box I'm building on has been completely built
using CPUTYPE=athlon-xp, maybe this influences the default instruction
set that gcc uses, even without -march flags?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 183 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20030828/2325540f/attachment.bin


More information about the freebsd-current mailing list