diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk index 6cd0786c3d..b970de48f2 100644 --- a/package/elf2flt/elf2flt.mk +++ b/package/elf2flt/elf2flt.mk @@ -14,12 +14,27 @@ HOST_ELF2FLT_DEPENDENCIES = host-binutils host-zlib # 0001-elf2flt-handle-binutils-2.34.patch HOST_ELF2FLT_AUTORECONF = YES +# elf2flt needs to link against libbfd.a and libiberty.a which are +# provided by host-binutils, but not installed, so we poke directly +# into the host-binutils build directory. Turns out that the location +# of libbfd.a has changed in binutils >= 2.41, so we special case +# binutils 2.39 and 2.40, which are the two remaining versions still +# using the "old" path". Note: the ARC-special binutils version is not +# considered because Buildroot only supports ARC CPUs with a MMU and +# therefore host-elf2flt is never used on ARC. libiberty.a has +# remained at the same location. +ifeq ($(BR2_BINUTILS_VERSION_2_39_X)$(BR2_BINUTILS_VERSION_2_40_X),y) +HOST_ELF2FLT_LIBBFD_PATH = $(HOST_BINUTILS_DIR)/bfd/libbfd.a +else +HOST_ELF2FLT_LIBBFD_PATH = $(HOST_BINUTILS_DIR)/bfd/.libs/libbfd.a +endif + # It is not exactly a host variant, but more a cross variant, which is # why we pass a special --target option. HOST_ELF2FLT_CONF_OPTS = \ --with-bfd-include-dir=$(HOST_BINUTILS_DIR)/bfd/ \ --with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \ - --with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \ + --with-libbfd=$(HOST_ELF2FLT_LIBBFD_PATH) \ --with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \ --target=$(GNU_TARGET_NAME) \ --disable-werror