Gentoo Archives: gentoo-hardened

From: Yannis Kontekakis <tolis@×××××××××××.gr>
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] erlang fails to install on kvm guest (illegal instruction)
Date: Tue, 20 Nov 2012 18:02:44
Message-Id: 50ABA6CC.9020207@foss.teithe.gr
In Reply to: Re: [gentoo-hardened] erlang fails to install on kvm guest (illegal instruction) by Alexander Tsoy
1 On 11/20/2012 05:34 PM, Alexander Tsoy wrote:
2 > В Tue, 20 Nov 2012 16:54:39 +0200
3 > Yannis Kontekakis<tolis@×××××××××××.gr> пишет:
4 >
5 >> Hello,
6 >>
7 >> I am trying to install erlang on a hardened amd64 gentoo system running
8 >> on a kvm guest. The use flags and version of erlang are the following:
9 >>
10 >> dev-lang/erlang-15.2 USE="hipe java kpoll odbc smp ssl -compat-ethread
11 >> -doc -emacs -halfword -sctp -tk -wxwidgets"
12 >>
13 >> my CFLAGS are:
14 >> CFLAGS="-march=core2 -O2 -pipe"
15 >> CXXFLAGS="${CFLAGS}"
16 >>
17 >> cat /proc/cpuinfo reports 4 cores of:
18 >>
19 >> processor : 3
20 >> vendor_id : AuthenticAMD
21 >> cpu family : 6
22 >> model : 2
23 >> model name : QEMU Virtual CPU version 1.0
24 >> stepping : 3
25 >> microcode : 0x1000065
26 >> cpu MHz : 2100.278
27 >> cache size : 512 KB
28 >> fpu : yes
29 >> fpu_exception : yes
30 >> cpuid level : 4
31 >> wp : yes
32 >> flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
33 >> pat pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl pni cx16 popcnt
34 >> hypervisor lahf_lm svm abm sse4a
35 >> bogomips : 4200.55
36 >> TLB size : 1024 4K pages
37 >> clflush size : 64
38 >> cache_alignment : 64
39 >> address sizes : 40 bits physical, 48 bits virtual
40 >> power management:
41 >>
42 >> the error message that emerge prints while dying:
43 >>
44 >> === Entering application hipe
45 >> make[3]: Entering directory
46 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib/hipe/rtl'
47 >> (cd ../main&& make hipe.hrl)
48 >> make[4]: Entering directory
49 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib/hipe/main'
50 >> sed -e "s;%VSN%;3.9;" ../../hipe/main/hipe.hrl.src>
51 >> ../../hipe/main/hipe.hrl
52 >> make[4]: Leaving directory
53 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib/hipe/main'
54 >> erlc -W +debug_info +inline -o../ebin hipe_rtl.erl
55 >> make[3]: *** [../ebin/hipe_rtl.beam] Illegal instruction
56 >> make[3]: Leaving directory
57 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib/hipe/rtl'
58 >> make[2]: *** [opt] Error 2
59 >> make[2]: Leaving directory
60 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib/hipe'
61 >> make[1]: *** [opt] Error 2
62 >> make[1]: Leaving directory
63 >> `/var/tmp/portage/dev-lang/erlang-15.2/work/otp_src_R15B/lib'
64 >> make: *** [secondary_bootstrap_build] Error 2
65 >> emake failed
66 >> * ERROR: dev-lang/erlang-15.2 failed (compile phase):
67 >> * (no error message)
68 >> *
69 >> * Call stack:
70 >> * ebuild.sh, line 93: Called src_compile
71 >> * environment, line 3965: Called die
72 >> * The specific snippet of code:
73 >> * emake -j1 || die;
74 >> *
75 >>
76 >> And finally, dmesg reports:
77 >> beam.smp[27752] trap invalid opcode ip:54b49c00c4 sp:3d9f459d3f0 error:0
78 >> in beam.smp[54b48e4000+261000]
79 >>
80 >> Emerging erlang on my desktop(a similar hardened gentoo setup) completes
81 >> successfully. The only thing I can think of is that something is wrong
82 >> with my CFLAGS(but this is just an assumption).
83 >>
84 >> Any help would be appreciated
85 >>
86 >> Regards,
87 >>
88 >> Yannis
89 >>
90 > It seems that KVM host is and AMD-based system. I suggest you to drop
91 > "-march=core2" from CFLAGS. Or if you do not plan to migrate this VM
92 > you can also try to replace it with something like "-march=amdfam10
93 > -mno-3dnow". :)
94 >
95
96 I thought so... I now have to rebuild the whole world :) Is anyone aware
97 of an -march value that can be used interchangeably between 64bit intel
98 & amd cpus? The kvm host is not under my administration, so at any time
99 my guest could be switched between hosts.

Replies

Subject Author
Re: [gentoo-hardened] erlang fails to install on kvm guest (illegal instruction) Alexander Tsoy <alexander@××××.me>