Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Aug 2003 21:55:13 +0200
From:      Dimitry Andric <dim@xs4all.nl>
To:        FreeBSD Current List <current@freebsd.org>
Subject:   Generating PPro instructions with CPUTYPE=i586?
Message-ID:  <1947473743.20030828215513@xs4all.nl>

next in thread | raw e-mail | index | archive | help
------------CD11E1313B88611
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

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=3Di586 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 condition=
s.
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=20

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=3Dpentium.

Note that the Athlon XP box I'm building on has been completely built
using CPUTYPE=3Dathlon-xp, maybe this influences the default instruction
set that gcc uses, even without -march flags?

------------CD11E1313B88611
Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.2 (MingW32)

iD8DBQE/Tl4hsF6jCi4glqMRAn7BAJwOltoaeiBIHEgz75pFQTVW8ezIawCfb4WW
th6n32caayJLuia8ao+gqC0=
=fUt1
-----END PGP MESSAGE-----

------------CD11E1313B88611--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1947473743.20030828215513>