From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:52049 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161895AbcE3Ub7 (ORCPT ); Mon, 30 May 2016 16:31:59 -0400 Subject: Patch "objtool: Allow building with older libelf" has been added to the 4.6-stable tree To: JBeulich@suse.com, acme@redhat.com, alexander.shishkin@linux.intel.com, eranian@google.com, gregkh@linuxfoundation.org, jbeulich@suse.com, jolsa@redhat.com, jpoimboe@redhat.com, mingo@kernel.org, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, vincent.weaver@maine.edu Cc: , From: Date: Mon, 30 May 2016 13:24:18 -0700 Message-ID: <1464639858170246@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled objtool: Allow building with older libelf to the 4.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: objtool-allow-building-with-older-libelf.patch and it can be found in the queue-4.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 2e51f26245701cb28f154552836b7807159088a8 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 16 May 2016 15:31:07 -0500 Subject: objtool: Allow building with older libelf From: Jan Beulich commit 2e51f26245701cb28f154552836b7807159088a8 upstream. The switch to elf_getshdr{num,strndx} post-dates the oldest tool chain the kernel is supposed to be able to build with, so try to cope with such an environment. Signed-off-by: Jan Beulich Signed-off-by: Josh Poimboeuf Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Jan Beulich Cc: Jiri Olsa Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Link: http://lkml.kernel.org/r/732dae6872b7ff187d94f22bb699a12849d3fe04.1463430618.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar Signed-off-by: Greg Kroah-Hartman --- tools/objtool/Makefile | 4 ++++ tools/objtool/elf.h | 5 +++++ 2 files changed, 9 insertions(+) --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -30,6 +30,10 @@ INCLUDES := -I$(srctree)/tools/include CFLAGS += -Wall -Werror $(EXTRA_WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) LDFLAGS += -lelf $(LIBSUBCMD) +# Allow old libelf to be used: +elfshdr := $(shell echo '\#include ' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) +CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) + AWK = awk export srctree OUTPUT CFLAGS ARCH AWK include $(srctree)/tools/build/Makefile.include --- a/tools/objtool/elf.h +++ b/tools/objtool/elf.h @@ -23,6 +23,11 @@ #include #include +#ifdef LIBELF_USE_DEPRECATED +# define elf_getshdrnum elf_getshnum +# define elf_getshdrstrndx elf_getshstrndx +#endif + struct section { struct list_head list; GElf_Shdr sh; Patches currently in stable-queue which might be from JBeulich@suse.com are queue-4.6/objtool-allow-building-with-older-libelf.patch