perf tools: Use python-config --includes rather than --cflags
authorJeremy Cline <jcline@redhat.com>
Tue, 10 Jul 2018 15:46:12 +0000 (11:46 -0400)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 11 Jul 2018 13:48:31 +0000 (09:48 -0400)
commit32aa928a7b817140c84987b726d5014911808fa4
tree8f75c8e622d1e85a4cfb3b7695db41d7a6dca95e
parentdb0ba84c04ef2cf293aaada5ae97531127844d9d
perf tools: Use python-config --includes rather than --cflags

Builds started failing in Fedora on Python 3.7 with:

    `.gnu.debuglto_.debug_macro' referenced in section
    `.gnu.debuglto_.debug_macro' of
    util/scripting-engines/trace-event-python.o: defined in discarded
    section

In Fedora, Python 3.7 added -flto to the list of --cflags and since it
was only applied to util/scripting-engines/trace-event-python.c and
scripts/python/Perf-Trace-Util/Context.c, linking failed.

It's not the first time the addition of flags has broken builds: commit
c6707fdef7e2 ("perf tools: Fix up build in hardnened environments")
appears to have fixed a similar problem. "python-config --includes"
provides the proper -I flags and doesn't introduce additional CFLAGS.

Signed-off-by: Jeremy Cline <jcline@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180710154612.6285-1-jcline@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Makefile.config