pyrebox
pyrebox copied to clipboard
Build fails with gcc 9.2.1
I tried to build pyrebox on my debian machine and it fails during compilation. Here the steps:
$ apt-get install build-essential zlib1g-dev pkg-config libglib2.0-dev binutils-dev libboost-all-dev autoconf libtool libssl-dev libpixman-1-dev libpython-dev python-pip virtualenv python-capstone
$ virtualenv pyrebox_venv
$ source pyrebox_venv/bin/activate
$ pip install -r requirements.txt
$ source pyrebox_venv/bin/activate
$ ./build.sh
It compiles the sleuthkit successfully but it fails during compiling qemu, with the following error:
In file included from /usr/include/string.h:494,
from /home/cube/security/tools/pyrebox/qemu/include/qemu/osdep.h:101,
from util/qemu-sockets.c:18:
In function ‘strncpy’,
inlined from ‘unix_connect_saddr.isra.0’ at util/qemu-sockets.c:925:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘strncpy’,
inlined from ‘unix_listen_saddr.isra.0’ at util/qemu-sockets.c:880:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’ specified bound 108 equals destination size [-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any suggestion?
You can try to compile it with an older version of GCC. For PyREBox to be compiled with GCC 9, the QEMU version has to be updated. I will take care of this, and update this issue when it is ready (it requires some testing, etc).
It happens because of gcc doesn't pass any warnings. To avoid this you can add "-w" option to gcc. Just change in build.sh:
-make -j${jobs}
+make -j${jobs} CFLAGS="-w"
Awesome. I still need to upgrade the QEMU version, so for the moment I am leaving this issue open for reference.
Thank you very much!