Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1227080

Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’"

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’"
Date 2015-09-17 16:40 +0200
Message-ID <q9IvT-6qB-7@gated-at.bofh.it> (permalink)
References <q9tdw-M9-13@gated-at.bofh.it> <q9B1o-3IW-3@gated-at.bofh.it> <q9I2S-5Oz-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Em Thu, Sep 17, 2015 at 11:06:19AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Thu, Sep 17, 2015 at 09:28:31AM +0300, Adrian Hunter escreveu:
> > 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.
> 
> But that looks like a bandaid :-\
> 
> The comment I made in f785f2357673d520a0b7b468973cdd197f336494 was not
> clear enough, now I'm the one trying to figure out why I did that... Duh
> :-\
> 
> I.e. if:
> 
> "HAVE_ELF_GETPHDRNUM_SUPPORT is false" we shouldn't have any prototype
> for that elf_getphdrnum function, i.e. the fact that it is in libelf.h
> should mean that it is present, how come the feature test for it failed,
> i.e. HAVE_ELF_GETPHDRNUM_SUPPORT wasn't defined?

So, on RHEL5.11 (aka, I guess, CentOS 5.11):

  [acme@rhel5 linux]$ cat /etc/redhat-release 
  Red Hat Enterprise Linux Server release 5.11 (Tikanga)
  [acme@rhel5 linux]$ rpm -q elfutils
  elfutils-0.137-3.el5
  [acme@rhel5 linux]$ cat /tmp/build/perf/feature/test-libelf-getphdrnum.make.output
  cc1: warnings being treated as errors
  test-libelf-getphdrnum.c: In function ‘main’:
  test-libelf-getphdrnum.c:7: warning: implicit declaration of function ‘elf_getphdrnum’
  [acme@rhel5 linux]$

If I revert my patch, it builds... I am now building this in more
systems while trying to get my head around how
HAVE_ELF_GETPHDRNUM_SUPPORT can be false while elf_getphdrnum() is
defined.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Vinson Lee <vlee@twopensource.com> - 2015-09-17 00:20 +0200
  Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Adrian Hunter <adrian.hunter@intel.com> - 2015-09-17 08:40 +0200
    Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-17 16:10 +0200
      Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-17 16:40 +0200
        build tests for older systems [was] Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-17 18:10 +0200
        Re: Linux 4.3-rc1 build error with older elfutils "util/symbol-elf.c:41:5: error: no previous prototype for ‘elf_getphdrnum’" Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-17 18:30 +0200

csiph-web