* [4.14] please include 056d28d135bca0b1d0908990338e00e9dadaf057
@ 2019-09-23 9:40 Rolf Eike Beer
2019-09-23 10:16 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Rolf Eike Beer @ 2019-09-23 9:40 UTC (permalink / raw)
To: stable
[-- Attachment #1: Type: text/plain, Size: 3096 bytes --]
Hi all,
please include 056d28d135bca0b1d0908990338e00e9dadaf057, I can't build without
it. It is in several other stable kernels (e.g. 4.19). It fails applying in
tools/objtool/Makefile, but the fixup is rather trivial.
For reference, this is the patch as I manually apply it currently:
From 7d25e19601df63ece47da732c96d656ec3850a52 Mon Sep 17 00:00:00 2001
From: Rolf Eike Beer <eb@emlix.com>
Date: Tue, 26 Mar 2019 12:48:39 -0500
Subject: [PATCH] objtool: Query pkg-config for libelf location
If it is not in the default location, compilation fails at several points.
Signed-off-by: Rolf Eike Beer <eb@emlix.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/91a25e992566a7968fedc89ec80e7f4c83ad0548.1553622500.git.jpoimboe@redhat.com
(cherry picked from commit 056d28d135bca0b1d0908990338e00e9dadaf057)
---
Makefile | 4 +++-
tools/objtool/Makefile | 7 +++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index ad923d5eae1e..e5deecb976fd 100644
--- a/Makefile
+++ b/Makefile
@@ -949,9 +949,11 @@ mod_sign_cmd = true
endif
export mod_sign_cmd
+HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
+
ifdef CONFIG_STACK_VALIDATION
has_libelf := $(call try-run,\
- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
+ echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
ifeq ($(has_libelf),1)
objtool_target := tools/objtool FORCE
else
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 884d4f1ed0c1..85d3d041e083 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -26,14 +26,17 @@ LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
OBJTOOL := $(OUTPUT)objtool
OBJTOOL_IN := $(OBJTOOL)-in.o
+LIBELF_FLAGS := $(shell pkg-config libelf --cflags 2>/dev/null)
+LIBELF_LIBS := $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
+
all: $(OBJTOOL)
INCLUDES := -I$(srctree)/tools/include \
-I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
-I$(srctree)/tools/objtool/arch/$(ARCH)/include
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
-CFLAGS += -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES)
-LDFLAGS += -lelf $(LIBSUBCMD)
+CFLAGS += -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) $(LIBELF_FLAGS)
+LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD)
# Allow old libelf to be used:
elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)
--
2.23.0
Greetings,
Eike
--
Rolf Eike Beer, emlix GmbH, http://www.emlix.com
Fon +49 551 30664-0, Fax +49 551 30664-11
Gothaer Platz 3, 37083 Göttingen, Germany
Sitz der Gesellschaft: Göttingen, Amtsgericht Göttingen HR B 3160
Geschäftsführung: Heike Jordan, Dr. Uwe Kracke – Ust-IdNr.: DE 205 198 055
emlix - smart embedded open source
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 313 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [4.14] please include 056d28d135bca0b1d0908990338e00e9dadaf057
2019-09-23 9:40 [4.14] please include 056d28d135bca0b1d0908990338e00e9dadaf057 Rolf Eike Beer
@ 2019-09-23 10:16 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2019-09-23 10:16 UTC (permalink / raw)
To: Rolf Eike Beer; +Cc: stable
On Mon, Sep 23, 2019 at 11:40:41AM +0200, Rolf Eike Beer wrote:
> Hi all,
>
> please include 056d28d135bca0b1d0908990338e00e9dadaf057, I can't build without
> it. It is in several other stable kernels (e.g. 4.19). It fails applying in
> tools/objtool/Makefile, but the fixup is rather trivial.
>
> For reference, this is the patch as I manually apply it currently:
Now queued up, thanks!
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-09-23 10:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-23 9:40 [4.14] please include 056d28d135bca0b1d0908990338e00e9dadaf057 Rolf Eike Beer
2019-09-23 10:16 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).