9.0 RC1/Clang / illegal instruction (Signal 4) in gengtype while building cc_tools on i586.

From: Patrick Lamaiziere <patfbsd_at_davenulle.org>
Date: Sat, 22 Oct 2011 20:51:29 +0200
Hello,

On my Soekris net5501 (AMD Geode i586 CPU) clang make buildworld fails
on an illegal instruction "nopw   %cs:0x0(%eax,%eax,1)".

# make buildworld
...
ranlib libiberty.a
clang -O2 -pipe -I. -DGCCVER=\"4.2\" -DIN_GCC -DHAVE_CONFIG_H -DPREFIX=\"/usr\" -I/usr/obj/usr/src/gnu/usr.bin/cc/cc_tools/../cc_tools -I/usr/src/gnu/usr.bin/cc/cc_tools/../cc_tools -I/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcc -I/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcc/config -I/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/include -I/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/libcpp/include -I/usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcclibs/libdecnumber -g -DGENERATOR_FILE -DHAVE_CONFIG_H -std=gnu89   -I/usr/obj/usr/src/tmp/legacy/usr/include  -L/usr/obj/usr/src/tmp/legacy/usr/lib -o gengtype gengtype.o gengtype-yacc+%DIKED.o gengtype-lex.o errors.o libiberty.a
clang: warning: argument unused during compilation: '-g'
clang: warning: argument unused during compilation: '-std=gnu89'
./gengtype
*** Signal 4

Stop in /usr/src/gnu/usr.bin/cc/cc_tools.
*** Error code 1

# cd /usr/obj/usr/src/gnu/usr.bin/cc/cc_tools

# gdb ./gengtype
(gdb) r
Starting program: /usr/obj/usr/src/gnu/usr.bin/cc/cc_tools/gengtype 

Program received signal SIGILL, Illegal instruction.
0x08048b24 in do_typedef (s=0x80532bf "CUMULATIVE_ARGS", pos=0x805e1a4)
    at /usr/src/gnu/usr.bin/cc/cc_tools/../../../../contrib/gcc/gengtype.c:103
103     {

(gdb) disas 0x08048b24
Dump of assembler code for function do_typedef:
0x08048b10 <do_typedef+0>:      push   %ebp
0x08048b11 <do_typedef+1>:      mov    %esp,%ebp
0x08048b13 <do_typedef+3>:      push   %ebx
0x08048b14 <do_typedef+4>:      push   %edi
0x08048b15 <do_typedef+5>:      push   %esi
0x08048b16 <do_typedef+6>:      sub    $0xc,%esp
0x08048b19 <do_typedef+9>:      mov    $0x805e1d4,%edi
0x08048b1e <do_typedef+14>:     mov    0x10(%ebp),%esi
0x08048b21 <do_typedef+17>:     mov    0x8(%ebp),%ebx
0x08048b24 <do_typedef+20>:     nopw   %cs:0x0(%eax,%eax,1)

----------------

/etc/make.conf for clang (same as the wiki)
.if !defined(CC) || ${CC} == "cc"
CC=clang
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=clang++
.endif
.if !defined(CPP) || ${CPP} == "cpp"
CPP=clang -E
.endif
# Don't die on warnings
NO_WERROR=
WERROR=
# Don't forget this when using Jails!
#NO_FSCHG=
------------------

Help will be welcome.

Thanks regards.
Received on Sat Oct 22 2011 - 17:11:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:19 UTC