On Fri, 30 Mar 2018 15:27:55 +0200 Maxime Coquelin <maxime.coque...@redhat.com> wrote:
> Hi Andrew, > > On 03/30/2018 03:18 PM, Andrew Rybchenko wrote: > > Hi all, > > > > Build is broken in dpdk-next-net for me on Ubuntu 16.04.4: > > > > lib/librte_vhost/fd_man.c: In function ‘fdset_pipe_read_cb’: > > lib/librte_vhost/fd_man.c:284:2: error: ignoring return value of > > ‘read’, declared with attribute warn_unused_result > > [-Werror=unused-result] read(readfd, charbuf, sizeof(charbuf)); ^ > > lib/librte_vhost/fd_man.c: In function ‘fdset_pipe_notify’: > > lib/librte_vhost/fd_man.c:324:2: error: ignoring return value of > > ‘write’, declared with attribute warn_unused_result > > [-Werror=unused-result] write(fdset->u.writefd, "1", 1); ^ > > > > $ gcc --version > > gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 > > Thanks for reporting, I don't catch it with my Fedora build system: > $ gcc --version > gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5) Those kind of warnings are enabled by "-D_FORTIFY_SOURCE=2" (enabled by default in Ubuntu [1]). To have the same behavior on Fedora you need to set -D_FORTIFY_SOURCE=2 by hand, for example with: # make EXTRA_CFLAGS="-D_FORTIFY_SOURCE=2" Usually I build dpdk with the flags we also use when we build the Fedora/RHEL package. To do that I have in my .bashrc (all in one line): export EXTRA_CFLAGS="-O2 -g -pipe -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -Wformat" > > > > As I understand it is broken in > > ad94ade905454401b705be9e06b19e54a1c78148 vhost: add pipe event for > > optimizing negotiating > > I confirm it is this patch. > > Xiangxia, can you provide a fix please? > > Ferruh, how do you want to proceed? > Would you revert it? > > Thanks, > Maxime > > Andrew. > > [1] https://wiki.ubuntu.com/ToolChain/CompilerFlags#A-D_FORTIFY_SOURCE.3D2