[coreboot] [PATCH] [serialice] QEMU doesn't build and seg faults with SerialICE patch

Dustin Harrison dustin.harrison at sutus.com
Fri Oct 15 05:14:52 CEST 2010


  Hi,

I tried the instructions for getting serialICE installed, but ran into 
two problems (patch attached solved both problems):

1) the configure script failed to detect lua, fixed by adding 
--extra-ldflags="-lm" to the build.sh file.  The output of the lua test 
(with redirect to dev/null removed) is below:
sh build.sh
/usr/local/lib/liblua.a(lvm.o): In function `.L112':
lvm.c:(.text+0xb18): undefined reference to `pow'
/usr/local/lib/liblua.a(lvm.o): In function `.L177':
lvm.c:(.text+0x232d): undefined reference to `pow'
/usr/local/lib/liblua.a(lcode.o): In function `.L211':
lcode.c:(.text+0x1453): undefined reference to `pow'
collect2: ld returned 1 exit status
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found

Error LUA not found, can't build with SerialICE support.


2) QEMU seg faulted when checking for kqemu enabled (note that I am 
running 0.11.1, but I had same behaviour on the qemu 0.11.0 which is 
checked into the SerialICE v1.5 tag).  I'm guessing it is something with 
my Gentoo install that causes the seg fault but if kqemu is not needed 
for serial ice then maybe it is easier to remove it.:

Starting program: /home/dharrison/projects/qemu-0.11.1/i386-softmmu/qemu 
-serialice /dev/ttyUSB0 -hda /dev/zero -L bios/ -bios bios.rom -k en-us 
-s -S
[Thread debugging using libthread_db enabled]
SerialICE: Open connection to target hardware...
SerialICE: Waiting for handshake with target... target alife!
SerialICE: LUA init...
SerialICE: Starting LUA script
SerialICE: Registering physical memory areas for Cache-As-Ram:
Registering physical memory at 0xffd80000 (0x00080000 bytes)

Program received signal SIGSEGV, Segmentation fault.
cpu_register_physical_memory_offset (start_addr=4292345856, size=524288, 
phys_offset=0, region_offset=0) at 
/home/dharrison/projects/qemu-0.11.1/exec.c:2327
2327        if (env->kqemu_enabled) {
(gdb) bt
#0  cpu_register_physical_memory_offset (start_addr=4292345856, 
size=524288, phys_offset=0, region_offset=0) at 
/home/dharrison/projects/qemu-0.11.1/exec.c:2327
#1  0x080735d8 in cpu_register_physical_memory (luastate=0x841e4a8) at 
../cpu-common.h:33
#2  serialice_register_physical (luastate=0x841e4a8) at 
/home/dharrison/projects/qemu-0.11.1/serialice.c:93
#3  0x0819a1ba in luaD_precall ()
#4  0x081a3e3a in luaV_execute ()
#5  0x0819a6a0 in luaD_call ()
#6  0x08197621 in f_call ()
#7  0x08199cc3 in luaD_rawrunprotected ()
#8  0x08199d25 in luaD_pcall ()
#9  0x08197448 in lua_pcall ()
#10 0x080733fb in serialice_lua_init () at 
/home/dharrison/projects/qemu-0.11.1/serialice.c:117
#11 serialice_init () at 
/home/dharrison/projects/qemu-0.11.1/serialice.c:911
#12 0x080b2e8b in module_call_init (type=MODULE_INIT_BLOCK) at module.c:78
#13 0x0805402f in main (argc=13, argv=0xbffff294, envp=0xbffff2cc) at 
/home/dharrison/projects/qemu-0.11.1/vl.c:5956
(gdb)


Here is the output from a (working and patched) configure:
Install prefix    /usr/local
BIOS directory    /usr/local/share/qemu
binary directory  /usr/local/bin
Manual directory  /usr/local/share/man
ELF interp prefix /usr/gnemul/qemu-%M
Source path       /home/dharrison/projects/qemu-0.11.1
C compiler        gcc
Host C compiler   gcc
ARCH_CFLAGS       -m32
make              make
install           install
host CPU          i386
host big endian   no
target list       x86_64-softmmu  i386-softmmu
tcg debug enabled no
gprof enabled     no
sparse enabled    no
strip binaries    yes
profiler          no
static build      no
-Werror enabled   no
SDL support       no
curses support    yes
curl support      yes
mingw32 support   no
Audio drivers     oss
Extra audio cards ac97 es1370 sb16
Mixer emulation   no
SerialICE support yes
VNC TLS support   yes
     TLS CFLAGS
     TLS LIBS      -lgnutls
VNC SASL support  yes
     SASL CFLAGS
     SASL LIBS      -lsasl2
kqemu support     no
xen support       no
brlapi support    no
Documentation     yes
NPTL support      yes
vde support       no
AIO support       yes
IO thread         no
Install blobs     yes
KVM support       no
fdt support       no
preadv support    yes

# uname -a
Linux myhostname 2.6.30-gentoo-r6 #1 SMP Wed Sep 30 12:22:36 PDT 2009 
i686 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux

The following patch fixed both my problems:

Disable kqemu since it caused a seg fault and is not needed.

Add libm to the LDFLAGS to make the lua test work.

Signed-off-by: Dustin Harrison <dustin.harrison at sutus.com>

Index: patches/serialice-qemu-0.11.0.diff
===================================================================
--- patches/serialice-qemu-0.11.0.diff  (revision 107)
+++ patches/serialice-qemu-0.11.0.diff  (working copy)
@@ -1024,7 +1024,7 @@
  @@ -0,0 +1,5 @@
  +#!/bin/sh
  +./configure --disable-kvm --disable-sdl --enable-serialice \
-+          --target-list="x86_64-softmmu, i386-softmmu"
++          --target-list="x86_64-softmmu, i386-softmmu" 
--extra-ldflags="-lm" --disable-kqemu
  +
  +make
  --- qemu-0.11.0/Makefile.target






More information about the coreboot mailing list