pyrebox icon indicating copy to clipboard operation
pyrebox copied to clipboard

Build fails with gcc 9.2.1

Open cube0x8 opened this issue 5 years ago • 3 comments

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?

cube0x8 avatar Dec 18 '19 22:12 cube0x8

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).

xabiugarte avatar Dec 20 '19 14:12 xabiugarte

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"

s0i37 avatar Jan 23 '20 20:01 s0i37

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!

xabiugarte avatar Jan 24 '20 07:01 xabiugarte