From e1d05ee45cb83c51311e7a9ef0c9be41a7f0abf6 Mon Sep 17 00:00:00 2001 From: Jeremy Cline Date: Jul 13 2018 14:07:58 +0000 Subject: Replace hacky link-time optimization fix with upstream fix --- diff --git a/0001-Filter-out-link-time-optimization.patch b/0001-Filter-out-link-time-optimization.patch deleted file mode 100644 index 56bede3..0000000 --- a/0001-Filter-out-link-time-optimization.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4ce888f590a227a7fb2fba093cff3f9423337170 Mon Sep 17 00:00:00 2001 -From: Jeremy Cline -Date: Fri, 29 Jun 2018 18:13:40 +0000 -Subject: [PATCH] Filter out link-time optimization - -Python 3.7 adds some new cflags to "python3-config --cflags" and perf is -picking these up for a subset of the files it builds. These include --flto, but nothing else is built with link-time optimization and the -linker is not happy about this. This is a quick fix since Python 3.7 is -about to be merged into Rawhide. - -Signed-off-by: Jeremy Cline ---- - tools/perf/Makefile.config | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config -index b5ac356ba323..be39d7862ae2 100644 ---- a/tools/perf/Makefile.config -+++ b/tools/perf/Makefile.config -@@ -209,6 +209,7 @@ ifdef PYTHON_CONFIG - PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil - PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) - PYTHON_EMBED_CCOPTS := $(filter-out -specs=%,$(PYTHON_EMBED_CCOPTS)) -+ PYTHON_EMBED_CCOPTS := $(filter-out -flto%,$(PYTHON_EMBED_CCOPTS)) - FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) - endif - --- -2.17.1 - diff --git a/0001-perf-Use-python-config-includes-rather-than-cflags.patch b/0001-perf-Use-python-config-includes-rather-than-cflags.patch new file mode 100644 index 0000000..b97f5b5 --- /dev/null +++ b/0001-perf-Use-python-config-includes-rather-than-cflags.patch @@ -0,0 +1,39 @@ +From d50c9eec6d8c83dcf86f9c7f91c6e886af20b15f Mon Sep 17 00:00:00 2001 +From: Jeremy Cline +Date: Mon, 9 Jul 2018 14:31:19 -0400 +Subject: [PATCH] perf: 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 the Python perf engine, linking failed. It's not the +first time the addition of flags has broken builds: c6707fdef7e2 ("perf +tools: Fix up build in hardnened environments") fixed a similar problem. + +Signed-off-by: Jeremy Cline +--- + tools/perf/Makefile.config | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config +index b5ac356ba323..f5a3b402589e 100644 +--- a/tools/perf/Makefile.config ++++ b/tools/perf/Makefile.config +@@ -207,8 +207,7 @@ ifdef PYTHON_CONFIG + PYTHON_EMBED_LDOPTS := $(shell $(PYTHON_CONFIG_SQ) --ldflags 2>/dev/null) + PYTHON_EMBED_LDFLAGS := $(call strip-libs,$(PYTHON_EMBED_LDOPTS)) + PYTHON_EMBED_LIBADD := $(call grep-libs,$(PYTHON_EMBED_LDOPTS)) -lutil +- PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --cflags 2>/dev/null) +- PYTHON_EMBED_CCOPTS := $(filter-out -specs=%,$(PYTHON_EMBED_CCOPTS)) ++ PYTHON_EMBED_CCOPTS := $(shell $(PYTHON_CONFIG_SQ) --includes 2>/dev/null) + FLAGS_PYTHON_EMBED := $(PYTHON_EMBED_CCOPTS) $(PYTHON_EMBED_LDOPTS) + endif + +-- +2.17.1 + diff --git a/kernel-tools.spec b/kernel-tools.spec index 7649279..171be6f 100644 --- a/kernel-tools.spec +++ b/kernel-tools.spec @@ -110,7 +110,7 @@ Patch3: 0001-tools-include-Sync-vmx.h-header-for-FSF-removal.patch Patch4: 0001-tools-lib-Remove-FSF-address.patch Patch6: 0002-perf-Don-t-make-sourced-script-executable.patch Patch8: 0001-Switch-to-python3.patch -Patch9: 0001-Filter-out-link-time-optimization.patch +Patch9: 0001-perf-Use-python-config-includes-rather-than-cflags.patch Name: kernel-tools Summary: Assortment of tools for the Linux kernel License: GPLv2