From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH v3] perf build: Build error in libbpf with EXTRA_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -O2" Date: Mon, 30 Jul 2018 12:35:09 -0700 Message-ID: <20180730123509.0ffa4737@cakuba.netronome.com> References: <20180730085323.75738-1-tmricht@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: daniel@iogearbox.net, ast@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, heiko.carstens@de.ibm.com, brueckner@linux.vnet.ibm.com, schwidefsky@de.ibm.com To: Thomas Richter Return-path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:37636 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731992AbeG3VLo (ORCPT ); Mon, 30 Jul 2018 17:11:44 -0400 Received: by mail-qt0-f194.google.com with SMTP id n6-v6so13408769qtl.4 for ; Mon, 30 Jul 2018 12:35:14 -0700 (PDT) In-Reply-To: <20180730085323.75738-1-tmricht@linux.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 30 Jul 2018 10:53:23 +0200, Thomas Richter wrote: > commit 531b014e7a2f ("tools: bpf: make use of reallocarray") > causes a compiler error when building the perf tool in the linux-next > tree. Compile file tools/lib/bpf/libbpf.c on a FEDORA 28 > installation with gcc compiler > version: gcc (GCC) 8.0.1 20180324 (Red Hat 8.0.1-0.20) > shows this error message: >=20 > [root@p23lp27] # make V=3D1 EXTRA_CFLAGS=3D"-Wp,-D_FORTIFY_SOURCE=3D2 -O2" > [...] > make -f /home6/tmricht/linux-next/tools/build/Makefile.build > dir=3D./util/scripting-engines obj=3Dlibperf > libbpf.c: In function =E2=80=98bpf_object__elf_collect=E2=80=99: > libbpf.c:811:15: error: ignoring return value of =E2=80=98strerror_r=E2= =80=99, > declared with attribute warn_unused_result [-Werror=3Dunused-result] > strerror_r(-err, errmsg, sizeof(errmsg)); > ^ > cc1: all warnings being treated as errors > mv: cannot stat './.libbpf.o.tmp': No such file or directory > /home6/tmricht/linux-next/tools/build/Makefile.build:96: recipe for targe= t 'libbpf.o' failed >=20 > Replace all occurrences of strerror() by calls to strerror_r(). > To keep the compiler quiet also use the return value from strerror_r() > otherwise a 'variable set but not use' warning which is treated as error > terminates the compile. >=20 > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Cc: Jakub Kicinski > Suggested-by: Jakub Kicinski > Suggested-by: Daniel Borkmann > Reviewed-by: Hendrik Brueckner > Signed-off-by: Thomas Richter Conversion looks correct, thank you! Reviewed-by: Jakub Kicinski