Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Build fails with gcc 9.2.1 #99

Open
cube0x8 opened this issue Dec 18, 2019 · 3 comments
Open

Build fails with gcc 9.2.1 #99

cube0x8 opened this issue Dec 18, 2019 · 3 comments
Assignees
Labels

Comments

@cube0x8
Copy link

cube0x8 commented Dec 18, 2019

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 cube0x8 changed the title Build fails witch gcc 9.2.1 Build fails with gcc 9.2.1 Dec 18, 2019
@xabiugarte
Copy link
Contributor

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 xabiugarte self-assigned this Dec 20, 2019
@xabiugarte xabiugarte added the bug label Dec 20, 2019
@s0i37
Copy link

s0i37 commented Jan 23, 2020

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"

@xabiugarte
Copy link
Contributor

xabiugarte commented Jan 24, 2020

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants