1
0

110-fix_musl_build.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From: Jörg Krause <joerg.krause@embedded.rocks>
  2. Date: Wed, 22 Apr 2015 19:36:22 +0000 (+0200)
  3. Subject: Fix musl build
  4. X-Git-Tag: v2015.07-rc2~281
  5. X-Git-Url: http://git.denx.de/?p=u-boot.git;a=commitdiff_plain;h=26e355d131a6b56ea78a156c1cee4f6ba0500b37;hp=1cdd9412002000aafcfb6f10cd02069adc66ba49
  6. Fix musl build
  7. This patch fixes cross-compiling U-Boot tools with the musl C library:
  8. * including <sys/types.h> is needed for ulong
  9. * defining _GNU_SOURCE is needed for loff_t
  10. Tested for target at91sam9261ek_dataflash_cs3.
  11. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  12. Cc: Tom Rini <trini@konsulko.com>
  13. ---
  14. diff --git a/include/image.h b/include/image.h
  15. index 3844be6..60b924a 100644
  16. --- a/include/image.h
  17. +++ b/include/image.h
  18. @@ -23,6 +23,7 @@
  19. struct lmb;
  20. #ifdef USE_HOSTCC
  21. +#include <sys/types.h>
  22. /* new uImage format support enabled on host */
  23. #define CONFIG_FIT 1
  24. diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
  25. index 1173eea..daa02a7 100644
  26. --- a/tools/env/fw_env.c
  27. +++ b/tools/env/fw_env.c
  28. @@ -8,6 +8,8 @@
  29. * SPDX-License-Identifier: GPL-2.0+
  30. */
  31. +#define _GNU_SOURCE
  32. +
  33. #include <errno.h>
  34. #include <env_flags.h>
  35. #include <fcntl.h>
  36. diff --git a/tools/imagetool.h b/tools/imagetool.h
  37. index 3e15b4e..b7874f4 100644
  38. --- a/tools/imagetool.h
  39. +++ b/tools/imagetool.h
  40. @@ -16,6 +16,7 @@
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #include <sys/stat.h>
  44. +#include <sys/types.h>
  45. #include <time.h>
  46. #include <unistd.h>
  47. #include <u-boot/sha1.h>
  48. diff --git a/tools/proftool.c b/tools/proftool.c
  49. index 3482951..9ce7a77 100644
  50. --- a/tools/proftool.c
  51. +++ b/tools/proftool.c
  52. @@ -16,6 +16,7 @@
  53. #include <string.h>
  54. #include <unistd.h>
  55. #include <sys/param.h>
  56. +#include <sys/types.h>
  57. #include <compiler.h>
  58. #include <trace.h>