lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] objtool: Link with -lz
Date
This should fix the following when statically linking host tools:
gcc .../tools/objtool/objtool-in.o -lelf .../tools/objtool/libsubcmd.a -static -o .../tools/objtool/objtool
.../bin/ld: .../sys-root/lib/libelf.a(elf_compress.o): in function `__libelf_compress':
.../libelf/elf_compress.c:113: undefined reference to `deflateInit_'

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
tools/objtool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index c9d038f..d1847e3 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -32,7 +32,7 @@ INCLUDES := -I$(srctree)/tools/include \
-I$(srctree)/tools/objtool/arch/$(ARCH)/include
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES)
-LDFLAGS += -lelf $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
+LDFLAGS += -lelf -lz $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)

# Allow old libelf to be used:
elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)
--
2.4.6
\
 
 \ /
  Last update: 2018-09-24 11:19    [W:0.053 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site