050-Add-compatibility-with-non-Linux-hosts.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 590b23a46b7ae0f5ec5e8f57a85c0e7578c71141 Mon Sep 17 00:00:00 2001
  2. From: Hauke Mehrtens <[email protected]>
  3. Date: Sun, 26 Apr 2020 17:15:17 +0200
  4. Subject: [PATCH 1/2] Add compatibility with non Linux hosts
  5. This adds some changes to the u-boot tools to make it possible to build
  6. them on non Linux hosts like MacOS or FreeBSD.
  7. asm/byteorder.h, asm/posix_types.h, asm/types.h and linux/kernel.h are
  8. not available on such systems. Remove the include and add the necessary
  9. parts for these header files manually or remove the usage too.
  10. __u64 is not available on FreeBSD, remove its usage.
  11. Signed-off-by: Hauke Mehrtens <[email protected]>
  12. ---
  13. include/image.h | 2 ++
  14. include/imx8image.h | 5 +++++
  15. include/linux/posix_types.h | 2 ++
  16. include/linux/types.h | 4 +++-
  17. lib/rsa/rsa-sign.c | 2 +-
  18. 5 files changed, 13 insertions(+), 2 deletions(-)
  19. --- a/include/image.h
  20. +++ b/include/image.h
  21. @@ -16,7 +16,9 @@
  22. #define __IMAGE_H__
  23. #include "compiler.h"
  24. +#ifdef linux
  25. #include <asm/byteorder.h>
  26. +#endif
  27. #include <stdbool.h>
  28. /* Define this to avoid #ifdefs later on */
  29. --- a/include/linux/posix_types.h
  30. +++ b/include/linux/posix_types.h
  31. @@ -43,6 +43,8 @@ typedef void (*__kernel_sighandler_t)(in
  32. /* Type of a SYSV IPC key. */
  33. typedef int __kernel_key_t;
  34. +#ifdef linux
  35. #include <asm/posix_types.h>
  36. +#endif
  37. #endif /* _LINUX_POSIX_TYPES_H */
  38. --- a/include/linux/types.h
  39. +++ b/include/linux/types.h
  40. @@ -2,7 +2,9 @@
  41. #define _LINUX_TYPES_H
  42. #include <linux/posix_types.h>
  43. +#ifdef linux
  44. #include <asm/types.h>
  45. +#endif
  46. #include <stdbool.h>
  47. #ifndef __KERNEL_STRICT_NAMES
  48. @@ -142,7 +144,7 @@ typedef __u16 __bitwise __le16;
  49. typedef __u16 __bitwise __be16;
  50. typedef __u32 __bitwise __le32;
  51. typedef __u32 __bitwise __be32;
  52. -#if defined(__GNUC__)
  53. +#if defined(__GNUC__) && defined(linux)
  54. typedef __u64 __bitwise __le64;
  55. typedef __u64 __bitwise __be64;
  56. #endif