objtool: Link with -lz
PATCH 1/1 objtool: Link with -lz
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 <[email protected]>
--- tools/objtool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/objtool/Makefile +1 -1
@@ -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)
Signature · 1 line
2.4.6