[linux-yocto] [PATCH 09/14] lto, workaround: Disable LTO for BPF

Alejandro Hernandez alejandro.hernandez at linux.intel.com
Mon Feb 13 12:41:22 PST 2017


From: Andi Kleen <ak at linux.intel.com>

Disable LTO for the BPF interpreter. This works around a gcc bug in the LTO
partitioner that partitions the jumptable from the BPF interpreter
into a different LTO unit. This in term causes assembler
errors because the jump table contains references to the
code labels in the original file.

gcc problem tracked in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50676

Signed-off-by: Andi Kleen <ak at linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi at linux.intel.com>
---
 kernel/bpf/Makefile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile
index 1327258..9cf616b 100644
--- a/kernel/bpf/Makefile
+++ b/kernel/bpf/Makefile
@@ -2,3 +2,8 @@ obj-y := core.o
 
 obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o inode.o helpers.o
 obj-$(CONFIG_BPF_SYSCALL) += hashtab.o arraymap.o
+
+# various version of gcc have a LTO bug where the &&labels used in the
+# BPF interpreter can cause linker errors when spread incorrectly over
+# partitions. Disable LTO for BPF for now
+CFLAGS_core.o = $(DISABLE_LTO)
-- 
2.6.6



More information about the linux-yocto mailing list