0001-Fix-musl-build.patch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. [PATCH] Fix musl build
  2. Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
  3. [Dario: make the patch to be applied with fuzz factor 0]
  4. Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
  5. ---
  6. src/mtd.c | 1 +
  7. src/mtd.h | 5 +++++
  8. 2 files changed, 6 insertions(+)
  9. diff --git a/src/mtd.c b/src/mtd.c
  10. index 1edc441..6d2264c 100644
  11. --- a/src/mtd.c
  12. +++ b/src/mtd.c
  13. @@ -31,6 +31,7 @@
  14. #include <fcntl.h>
  15. #include <ctype.h>
  16. #include <errno.h>
  17. +#include <stddef.h>
  18. #include <sys/types.h>
  19. #include <sys/ioctl.h>
  20. #include <sys/utsname.h>
  21. diff --git a/src/mtd.h b/src/mtd.h
  22. index bd21add..debfc84 100644
  23. --- a/src/mtd.h
  24. +++ b/src/mtd.h
  25. @@ -31,6 +31,11 @@
  26. #include "BootControlBlocks.h"
  27. #include "rom_nand_hamming_code_ecc.h"
  28. +// musl library doesn't define loff_t
  29. +#if !defined(__GLIBC__) && !defined(__UCLIBC__)
  30. +#define loff_t off_t
  31. +#endif
  32. +
  33. //------------------------------------------------------------------------------
  34. // Re-definitions of true and false, because the standard ones aren't good
  35. // enough?
  36. --
  37. 2.5.1