lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Sep 2015 09:28:31 +0300
From:	Adrian Hunter <adrian.hunter@...el.com>
To:	Vinson Lee <vlee@...pensource.com>,
	Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Ingo Molnar <mingo@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Jiri Olsa <jolsa@...nel.org>,
	"Naveen N. Rao" <naveen.n.rao@...ux.vnet.ibm.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	Wang Nan <wangnan0@...wei.com>,
	Victor Kamensky <victor.kamensky@...aro.org>,
	LKML <linux-kernel@...r.kernel.org>,
	linux-perf-users@...r.kernel.org
Subject: Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’"

On 17/09/15 01:10, Vinson Lee wrote:
> With Linux 4.3-rc1 I get a perf build error using toolchains with
> older elfutils.
> 
> The following build error occurs on both CentOS 5.11 (elfutils 0.137)
> and Ubuntu 10.04.4 (elfutils 0.143).
> 
>   CC       util/symbol-elf.o
> cc1: warnings being treated as errors
> util/symbol-elf.c:41: error: no previous prototype for ‘elf_getphdrnum’

commit f785f2357673d520a0b7b468973cdd197f336494
removed the 'static' qualifier, presumably because there
are cases where the prototype is in the header but the function is
not in the library.

AFAICT gcc accepts multiple prototypes so long as they are the same
so just adding the prototype should be ok i.e.

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index 53bb5f59ec58..d9abb0307cc5 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -38,6 +38,7 @@ static inline char *bfd_demangle(void __maybe_unused *v,
 #endif
 
 #ifndef HAVE_ELF_GETPHDRNUM_SUPPORT
+int elf_getphdrnum(Elf *elf, size_t *dst);
 int elf_getphdrnum(Elf *elf, size_t *dst)
 {
 	GElf_Ehdr gehdr;



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ