elf2flt: fix build when LTO is enabled
authorDouglas RAILLARD <public.douglas.raillard@gmail.com>
Sun, 6 Sep 2015 15:48:19 +0000 (17:48 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 20 Sep 2015 13:33:58 +0000 (15:33 +0200)
Signed-off-by: Douglas RAILLARD <public.douglas.raillard@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/elf2flt/elf2flt.mk

index 3fcada42ea81a3427550a760d32bde3a3630d391..bec270b5bed7c6dcd2e33b2f827c7e633eab5f2b 100644 (file)
@@ -21,6 +21,12 @@ HOST_ELF2FLT_CONF_OPTS = \
        --with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
        --target=$(GNU_TARGET_NAME)
 
-HOST_ELF2FLT_CONF_ENV = LIBS=-lz
+HOST_ELF2FLT_LIBS = -lz
+
+ifeq ($(BR2_GCC_ENABLE_LTO),y)
+HOST_ELF2FLT_LIBS += -ldl
+endif
+
+HOST_ELF2FLT_CONF_ENV = LIBS="$(HOST_ELF2FLT_LIBS)"
 
 $(eval $(host-autotools-package))