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

Patrick Lamaiziere patfbsd at davenulle.org
Sat Oct 22 19:11:10 UTC 2011


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'
*** 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"
.if !defined(CXX) || ${CXX} == "c++"
.if !defined(CPP) || ${CPP} == "cpp"
CPP=clang -E
# Don't die on warnings
# Don't forget this when using Jails!

Help will be welcome.

Thanks regards.

More information about the freebsd-current mailing list