[HELP] Illegal instruction error on startup


#1

Hello,

i compiled Asterisk 10.0.0 on Debian Squeeze, as a Xen Dom0, without any problems but it crashes on startup with “Illegal instruction”.

./configure

here the first lines of the config.log

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by asterisk configure trunk, which was
generated by GNU Autoconf 2.63.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = server
uname -m = x86_64
uname -r = 2.6.32-5-xen-amd64
uname -s = Linux
uname -v = #1 SMP Thu Nov 3 05:42:31 UTC 2011

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2512: checking build system type
configure:2530: result: x86_64-unknown-linux-gnu
configure:2552: checking host system type
configure:2567: result: x86_64-unknown-linux-gnu
configure:2700: checking for gcc
configure:2716: found /usr/bin/gcc
configure:2727: result: gcc
configure:2761: checking for C compiler version
configure:2769: gcc --version >&5
gcc (Debian 4.4.5-8) 4.4.5

then

make

Compiles without errors

make install

without errors

make samples

Now when I start asterisk I get this error:

root@server:/usr/src/asterisk-10.0.0# asterisk -vvvc
Illegal instruction

In my opinion this has to do with a wrong instruction in the binary code.
I think a wrong -march argument to gcc, so asterisk is compiled for a wrong processor.

I have a Intel® Xeon® CPU E31220L - Server CPU.

root@server:~# cat /proc/cpuinfo 
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz
stepping	: 7
cpu MHz		: 2195.072
cache size	: 3072 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt avx hypervisor lahf_lm ida arat
bogomips	: 4390.14
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz
stepping	: 7
cpu MHz		: 2195.072
cache size	: 3072 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt avx hypervisor lahf_lm ida arat
bogomips	: 4390.14
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz
stepping	: 7
cpu MHz		: 2195.072
cache size	: 3072 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt avx hypervisor lahf_lm ida arat
bogomips	: 4390.14
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 42
model name	: Intel(R) Xeon(R) CPU E31220L @ 2.20GHz
stepping	: 7
cpu MHz		: 2195.072
cache size	: 3072 KB
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nonstop_tsc aperfmperf pni pclmulqdq est ssse3 cx16 sse4_1 sse4_2 x2apic popcnt avx hypervisor lahf_lm ida arat
bogomips	: 4390.14
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

As you can see in the config.log the system is shown as a x86_64.
When I look in the Makefile there is:

ifeq ($(OSARCH),linux-gnu)
  ifeq ($(PROC),x86_64)
    # You must have GCC 3.4 to use k8, otherwise use athlon
    PROC=k8
    #PROC=athlon
  endif

Does this mean, if the system is recognized as x86_64 it will be compiled with AMD K8 optimizations?
This should be wrong!?

I changed k8 to corei7 in this Makefile, compiled and installed again, but nothing changed.

How can I see which argument to gcc is used while compiling.

How can I change the Processortype for which asterisk is build?

Can anyone give me a hint what is wrong?

Thanks