diff mbox

[03/20] elf2flt: fix build when zlib is not installed on the host

Message ID 1369606110-8088-4-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Commit 85e3090a92e13b7afc426cb2d9189bbe8d2adaf4
Headers show

Commit Message

Thomas Petazzoni May 26, 2013, 10:08 p.m. UTC
For a reason that's fairly unclear to me, Peter added a '-lz' link
flag to the elf2flt.mk build in d5664ee99 ("elf2flt: fix link").

However, the zlib library may not necessarily be installed on the host
machine, so we should depend on host-zlib, and pass the appropriate
LDFLAGS. This is what this patch does.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Note: I already have a patch that converts elf2flt to the package
infrastructure, but I am waiting to have the patches to make the
entire internal toolchain logic use the package infrastructure to send
them.
---
 toolchain/elf2flt/elf2flt.mk |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Korsgaard May 27, 2013, 11:13 a.m. UTC | #1
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 Thomas> For a reason that's fairly unclear to me, Peter added a '-lz' link
 Thomas> flag to the elf2flt.mk build in d5664ee99 ("elf2flt: fix link").

I also don't recall the details anymore.

 Thomas> However, the zlib library may not necessarily be installed on the host
 Thomas> machine, so we should depend on host-zlib, and pass the appropriate
 Thomas> LDFLAGS. This is what this patch does.

Committed, thanks.

 Thomas> ---
 Thomas> Note: I already have a patch that converts elf2flt to the package
 Thomas> infrastructure, but I am waiting to have the patches to make the
 Thomas> entire internal toolchain logic use the package infrastructure to send
 Thomas> them.

Ok.
diff mbox

Patch

diff --git a/toolchain/elf2flt/elf2flt.mk b/toolchain/elf2flt/elf2flt.mk
index 134034b..52e199c 100644
--- a/toolchain/elf2flt/elf2flt.mk
+++ b/toolchain/elf2flt/elf2flt.mk
@@ -19,7 +19,7 @@  $(ELF2FLT_DIR)/.patched: $(ELF2FLT_DIR)/.unpacked
 
 $(ELF2FLT_DIR)/.configured: $(ELF2FLT_DIR)/.patched
 	(cd $(ELF2FLT_DIR); rm -rf config.cache; \
-		LDFLAGS=-lz \
+		LDFLAGS="$(HOST_LDFLAGS) -lz" \
 		$(ELF2FLT_DIR)/configure $(QUIET) \
 		--with-bfd-include-dir=$(HOST_BINUTILS_DIR)/bfd/ \
 		--with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
@@ -33,7 +33,7 @@  $(ELF2FLT_DIR)/$(ELF2FLT_BINARY): $(ELF2FLT_DIR)/.configured
 	$(MAKE) -C $(ELF2FLT_DIR) all
 	$(MAKE) -C $(ELF2FLT_DIR) install
 
-elf2flt: uclibc_target uclibc-configured binutils gcc $(ELF2FLT_DIR)/$(ELF2FLT_BINARY)
+elf2flt: uclibc_target uclibc-configured binutils gcc host-zlib $(ELF2FLT_DIR)/$(ELF2FLT_BINARY)
 
 elf2flt-clean:
 	rm -rf $(ELF2FLT_SOURCE)