[SerialICE] Patch set updated for serialice: 59acf36 Do not build without compatible Lua

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun Mar 17 19:01:13 CET 2013


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2772

-gerrit

commit 59acf368a2c4f91cf64d6bd6ffbc670b8666fae5
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sat Mar 16 13:12:01 2013 +0200

    Do not build without compatible Lua
    
    The pre-built Lua library for 32bit distribution is most likely built
    with the type of LUA_INTEGER having essentially range of signed 32bit
    integer. SerialICE requires range of 32bit unsigned, so do not even
    begin the build if that is not satisfied.
    
    Change-Id: Icb93d0126aac5e6e6aaa49cb04a2ebb6077389f1
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 qemu-0.15.x/build.sh  |  4 +++-
 qemu-0.15.x/configure | 21 +++++++++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/qemu-0.15.x/build.sh b/qemu-0.15.x/build.sh
index 34b564c..e44ebc1 100644
--- a/qemu-0.15.x/build.sh
+++ b/qemu-0.15.x/build.sh
@@ -2,4 +2,6 @@
 ./configure --disable-kvm --disable-sdl --enable-serialice \
 	    --target-list="x86_64-softmmu, i386-softmmu"
 
-make
+if [ $? -eq 0 ]; then
+   make
+fi
diff --git a/qemu-0.15.x/configure b/qemu-0.15.x/configure
index 5eed581..24778bf 100755
--- a/qemu-0.15.x/configure
+++ b/qemu-0.15.x/configure
@@ -1759,11 +1759,28 @@ EOF
   fi
   if test "$got_lua" != "yes" ; then
     echo
-    echo "Error LUA version >= 5.2 not found, can't build with SerialICE support."
+    echo "Error Lua version >= 5.2 not found. Can't build QEMU with SerialICE support."
     echo
     exit 1
   fi
-  serialice=yes
+
+# Test if lua-5.2.x-intsize.patch has been applied. On a 32bit host system
+# LUA_INTEGER is often a signed 32bit integer (ptrdiff_t) and not enough for our needs.
+  cat > $TMPC << EOF
+#include <lua.h>
+int main(void) { LUA_INTEGER a = (unsigned long int)1<<31; if (a<0) return 1; else return 0; }
+EOF
+
+  if compile_prog "$lua_cflags" "$lua_ldflags" && $TMPE > /dev/null 2> /dev/null ; then
+    serialice=yes
+  else
+    echo
+    echo "Error Found Lua but it needs a patch to handle 32bit unsigned integers"
+    echo "correctly. Can't build QEMU with SerialICE support."
+    echo
+    exit 1
+  fi
+
   libs_softmmu="$lua_ldflags $libs_softmmu"
 fi # test "$serialice"
 



More information about the SerialICE mailing list