All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: Laura Abbott <labbott@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>,
	Stephane Eranian <eranian@google.com>,
	Florian Weimer <fweimer@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: perf build failure with newer glibc headers
Date: Wed, 12 Jun 2019 17:56:11 -0300	[thread overview]
Message-ID: <20190612205611.GA2149@redhat.com> (raw)
In-Reply-To: <4c0a4264-7142-2e6d-540d-aa354700e0bb@redhat.com>

Em Wed, Jun 12, 2019 at 03:23:12PM -0400, Laura Abbott escreveu:
> Hi,
> 
> While doing some build experiments, I found a compile failure with perf and jvmti:
> 
> BUILDSTDERR:   gcc -Wp,-MD,./.xsk.o.d -Wp,-MT,xsk.o -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-jvmti/jvmti_agent.c:48:21: error: static declaration of 'gettid' follows non-static declaration
> BUILDSTDERR:    48 | static inline pid_t gettid(void)
> BUILDSTDERR:       |                     ^~~~~~
> BUILDSTDERR: In file included from /usr/include/unistd.h:1170,
> BUILDSTDERR:                  from jvmti/jvmti_agent.c:33:
> BUILDSTDERR: /usr/include/bits/unistd_ext.h:40:16: note: previous declaration of 'gettid' was here
> BUILDSTDERR:    40 | extern __pid_t gettid (void) __THROW;
> BUILDSTDERR:       |                ^~~~~~
> 
> 
> This is with the newer glibc headers that came into Fedora earlier this week
> (glibc-2.29.9000-27.fc31)  It looks like the newer headers now define gettid
> so the in file gettid no longer works. Note this was a custom build with
> jvmti enabled as regular Fedora doesn't have it enabled which is why this
> wasn't reported elsewhere.
> 
> I don't know enough about either the glibc headers or perf to make a suggestion
> on how to fix this but I'm happy to test.

Bummer, I haven't noticed this because my fedora:rawhide perf build test
container wasn't building the jvmti code:

Makefile.config:925: No openjdk development package found, please install JDK package, e.g. openjdk-8-jdk, java-1.8.0-openjdk-devel

i.e.:

[perfbuilder@c0326e8b6511 perf]$ cat /tmp/build/perf/feature/test-jvmti.make.output 
test-jvmti.c:2:10: fatal error: jvmti.h: No such file or directory
    2 | #include <jvmti.h>
      |          ^~~~~~~~~
compilation terminated.
[perfbuilder@c0326e8b6511 perf]$

Installing it I get:

[root@2d7fe307ad20 perf]# rpm -qa | grep openjdk
java-1.8.0-openjdk-1.8.0.212.b04-4.fc31.x86_64
java-1.8.0-openjdk-headless-1.8.0.212.b04-4.fc31.x86_64
java-1.8.0-openjdk-devel-1.8.0.212.b04-4.fc31.x86_64
[root@2d7fe307ad20 perf]# cat
/tmp/build/perf/feature/test-jvmti.make.output 
[root@2d7fe307ad20 perf]# ls -la /tmp/build/perf/feature/test-jvmti.bin 
-rwxr-xr-x. 1 root root 21592 Jun 12 20:48
/tmp/build/perf/feature/test-jvmti.bin
[root@2d7fe307ad20 perf]# 

And reproduce the problem you reported:

jvmti/jvmti_agent.c:48:21: error: static declaration of ‘gettid’ follows
non-static declaration
   48 | static inline pid_t gettid(void)
      |                     ^~~~~~
In file included from /usr/include/unistd.h:1170,
                 from jvmti/jvmti_agent.c:33:

So, we'll have to have a feature test, that defines some HAVE_GETTID
that then ifdefs out our inline copy, working on it.

Thanks for the report!

- Arnaldo

  reply	other threads:[~2019-06-12 20:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 19:23 perf build failure with newer glibc headers Laura Abbott
2019-06-12 20:56 ` Arnaldo Carvalho de Melo [this message]
2019-06-12 21:29   ` Jiri Olsa
2019-06-13 15:19   ` Arnaldo Carvalho de Melo
2019-06-13 19:24     ` Laura Abbott
2019-06-13 20:34       ` Arnaldo Carvalho de Melo
2019-06-13 20:44     ` Jiri Olsa
2019-06-13 21:54       ` Arnaldo Carvalho de Melo
2019-06-12 21:27 ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190612205611.GA2149@redhat.com \
    --to=acme@redhat.com \
    --cc=eranian@google.com \
    --cc=fweimer@redhat.com \
    --cc=jolsa@kernel.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.