003-tools-dumpimage-fix-tools-compile.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. From 1ceffec2523888b4701405b7cf1710489e17011a Mon Sep 17 00:00:00 2001
  2. From: Scott Mercer <[email protected]>
  3. Date: Wed, 19 Mar 2025 06:31:44 -0400
  4. Subject: [PATCH] ipq50xx: packages: dumpimage: fix compile patch
  5. This patch is to fix compilation for uboot-tool V2025.01 in openwrt.
  6. * same "compile for enviroment patch" to makefile, that is used
  7. in uboot-envtools.
  8. * remove mkeficapsule from build to avoid gnulib dependencies
  9. * disable bmp_logo from build to allow compilation
  10. Signed-off-by: Scott Mercer <[email protected]>
  11. ---
  12. tools/Makefile | 38 ++++++++++++++++++++++++++------------
  13. 1 file changed, 26 insertions(+), 12 deletions(-)
  14. --- a/tools/Makefile
  15. +++ b/tools/Makefile
  16. @@ -22,6 +22,26 @@
  17. # That's as long as the features of those tools aren't modified.
  18. #
  19. +override HOSTCC = $(CC)
  20. +
  21. +ifneq ($(TARGET_CFLAGS),)
  22. +KBUILD_HOSTCFLAGS = $(TARGET_CFLAGS)
  23. +endif
  24. +ifneq ($(TARGET_LDFLAGS),)
  25. +KBUILD_HOSTLDFLAGS = $(TARGET_LDFLAGS)
  26. +endif
  27. +
  28. +# Compile for a hosted environment on the target
  29. +HOST_EXTRACFLAGS = -I$(srctree)/tools \
  30. + $(patsubst -I%,-idirafter%, $(filter -I%, $(UBOOTINCLUDE))) \
  31. + -idirafter $(srctree)/tools/env \
  32. + -DUSE_HOSTCC \
  33. + -DTEXT_BASE=$(TEXT_BASE)
  34. +
  35. +ifeq ($(MTD_VERSION),old)
  36. +HOST_EXTRACFLAGS += -DMTD_OLD
  37. +endif
  38. +
  39. # Enable all the config-independent tools
  40. ifneq ($(HOST_TOOLS_ALL),)
  41. CONFIG_ARCH_KIRKWOOD = y
  42. @@ -261,15 +281,10 @@ hostprogs-$(CONFIG_MIPS) += mips-relocs
  43. hostprogs-$(CONFIG_ASN1_COMPILER) += asn1_compiler
  44. HOSTCFLAGS_asn1_compiler.o = -idirafter $(srctree)/include
  45. -HOSTCFLAGS_mkeficapsule.o += \
  46. - $(shell pkg-config --cflags gnutls 2> /dev/null || echo "")
  47. -HOSTLDLIBS_mkeficapsule += \
  48. - $(shell pkg-config --libs gnutls 2> /dev/null || echo "-lgnutls")
  49. -mkeficapsule-objs := generated/lib/uuid.o \
  50. - generated/lib/sha1.o \
  51. - $(LIBFDT_OBJS) \
  52. - mkeficapsule.o
  53. -hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule
  54. +HOSTCFLAGS_mkeficapsule.o +=
  55. +HOSTLDLIBS_mkeficapsule +=
  56. +mkeficapsule-objs :=
  57. +hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) +=
  58. mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o
  59. HOSTLDLIBS_mkfwumdata += -luuid
  60. @@ -330,10 +345,9 @@ HOST_EXTRACFLAGS += -include $(srctree)/
  61. -I$(srctree)/scripts/dtc/libfdt \
  62. -I$(srctree)/tools \
  63. -DUSE_HOSTCC \
  64. - -D__KERNEL_STRICT_NAMES \
  65. - -D_GNU_SOURCE
  66. + -D__KERNEL_STRICT_NAMES
  67. -__build: $(LOGO-y)
  68. +__build: $(LOGO-n)
  69. $(LOGO_H): $(obj)/bmp_logo $(LOGO_BMP)
  70. $(obj)/bmp_logo --gen-info $(LOGO_BMP) > $@