elf2flt.mk 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ################################################################################
  2. #
  3. # elf2flt
  4. #
  5. ################################################################################
  6. ELF2FLT_VERSION = 7e33f28df198c46764021ed14408bd262751e148
  7. ELF2FLT_SITE = $(call github,uclinux-dev,elf2flt,$(ELF2FLT_VERSION))
  8. ELF2FLT_LICENSE = GPL-2.0+
  9. ELF2FLT_LICENSE_FILES = LICENSE.TXT
  10. HOST_ELF2FLT_DEPENDENCIES = host-binutils host-zlib
  11. # 0003-elf2flt-handle-binutils-2.34.patch
  12. HOST_ELF2FLT_AUTORECONF = YES
  13. # It is not exactly a host variant, but more a cross variant, which is
  14. # why we pass a special --target option.
  15. HOST_ELF2FLT_CONF_OPTS = \
  16. --with-bfd-include-dir=$(HOST_BINUTILS_DIR)/bfd/ \
  17. --with-binutils-include-dir=$(HOST_BINUTILS_DIR)/include/ \
  18. --with-libbfd=$(HOST_BINUTILS_DIR)/bfd/libbfd.a \
  19. --with-libiberty=$(HOST_BINUTILS_DIR)/libiberty/libiberty.a \
  20. --target=$(GNU_TARGET_NAME) \
  21. --disable-werror
  22. HOST_ELF2FLT_LIBS = -lz
  23. ifeq ($(BR2_GCC_ENABLE_LTO),y)
  24. HOST_ELF2FLT_LIBS += -ldl
  25. endif
  26. HOST_ELF2FLT_CONF_ENV = LIBS="$(HOST_ELF2FLT_LIBS)"
  27. # Hardlinks between binaries in different directories cause a problem
  28. # with rpath fixup, so we de-hardlink those binaries, and replace them
  29. # with copies instead. Note that elf2flt will rename ld to ld.real
  30. # before installing its own ld, but we already took care of the
  31. # original ld from binutils so that it is already de-hardlinked. So
  32. # ld is now the one from elf2flt, and we want to de-hardlinke it.
  33. ELF2FLT_TOOLS = elf2flt flthdr ld
  34. define HOST_ELF2FLT_FIXUP_HARDLINKS
  35. $(foreach tool,$(ELF2FLT_TOOLS),\
  36. rm -f $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool) && \
  37. cp -a $(HOST_DIR)/bin/$(GNU_TARGET_NAME)-$(tool) \
  38. $(HOST_DIR)/$(GNU_TARGET_NAME)/bin/$(tool)
  39. )
  40. endef
  41. HOST_ELF2FLT_POST_INSTALL_HOOKS += HOST_ELF2FLT_FIXUP_HARDLINKS
  42. $(eval $(host-autotools-package))