summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/u-boot/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/u-boot/files')
-rw-r--r--meta/recipes-bsp/u-boot/files/0001-include-env.h-Ensure-ulong-is-defined.patch6
-rw-r--r--meta/recipes-bsp/u-boot/files/0002-include-fix-ulong-definition-on-musl-targets.patch83
2 files changed, 86 insertions, 3 deletions
diff --git a/meta/recipes-bsp/u-boot/files/0001-include-env.h-Ensure-ulong-is-defined.patch b/meta/recipes-bsp/u-boot/files/0001-include-env.h-Ensure-ulong-is-defined.patch
index b9118164df..4d623c1f34 100644
--- a/meta/recipes-bsp/u-boot/files/0001-include-env.h-Ensure-ulong-is-defined.patch
+++ b/meta/recipes-bsp/u-boot/files/0001-include-env.h-Ensure-ulong-is-defined.patch
@@ -1,4 +1,4 @@
1From 0565a080d153d5baaaacfeb5045a832e126f4f9e Mon Sep 17 00:00:00 2001 1From 718170ff3a5e677db7212a86b129dacb28b1cac2 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com> 2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Mon, 14 Oct 2019 17:37:30 -0700 3Date: Mon, 14 Oct 2019 17:37:30 -0700
4Subject: [PATCH] include/env.h: Ensure ulong is defined 4Subject: [PATCH] include/env.h: Ensure ulong is defined
@@ -14,7 +14,7 @@ Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
14 1 file changed, 2 insertions(+) 14 1 file changed, 2 insertions(+)
15 15
16diff --git a/include/env.h b/include/env.h 16diff --git a/include/env.h b/include/env.h
17index b72239f6a5..5ca49a3456 100644 17index d6c2d751d6..6cf5053431 100644
18--- a/include/env.h 18--- a/include/env.h
19+++ b/include/env.h 19+++ b/include/env.h
20@@ -13,6 +13,8 @@ 20@@ -13,6 +13,8 @@
@@ -27,5 +27,5 @@ index b72239f6a5..5ca49a3456 100644
27 27
28 /* Value for environment validity */ 28 /* Value for environment validity */
29-- 29--
302.23.0 302.24.1
31 31
diff --git a/meta/recipes-bsp/u-boot/files/0002-include-fix-ulong-definition-on-musl-targets.patch b/meta/recipes-bsp/u-boot/files/0002-include-fix-ulong-definition-on-musl-targets.patch
new file mode 100644
index 0000000000..0d965813b0
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/files/0002-include-fix-ulong-definition-on-musl-targets.patch
@@ -0,0 +1,83 @@
1From dccfea2e95cd3f26d1295e02d41012d014827dd9 Mon Sep 17 00:00:00 2001
2From: Sergei Trofimovich <slyfox@gentoo.org>
3Date: Mon, 16 Dec 2019 23:36:40 +0000
4Subject: [PATCH 2/2] include: fix 'ulong' definition on musl targets
5
6The build failure was originally reported on arm64-musl
7target at https://bugs.gentoo.org/703132. Here is the amd64-musl
8variant:
9
10```
11$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-only_defconfig -j$(nproc)
12$ LANG=C make CROSS_COMPILE=x86_64-gentoo-linux-musl- tools-all -j$(nproc)
13...
14In file included from tools/env/../../env/flags.c:7,
15 from tools/env/env_flags.c:1:
16include/env.h:159:1: error: unknown type name 'ulong'; did you mean 'long'?
17 159 | ulong env_get_ulong(const char *name, int base, ulong default_val);
18 | ^~~~~
19 | long
20```
21
22Note: 'ulong' is not defined there.
23
24On glibc 'ulong' comes from <sys/types.h>:
25
26```c
27/* Old compatibility names for C types. */
28typedef unsigned long int ulong;
29```
30
31On musl it comes from <sys/types.h> as well but from under different guards:
32
33```c
34typedef unsigned long u_long, ulong;
35```
36
37The change inlines 'ulong' define similar to 'uint' define.
38
39Upstream-Status: Pending
40Bug: https://bugs.gentoo.org/703132
41Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
42Message-Id: <20191216233640.518168-1-slyfox@gentoo.org>
43---
44 include/compiler.h | 2 +-
45 include/u-boot/crc.h | 2 ++
46 2 files changed, 3 insertions(+), 1 deletion(-)
47
48diff --git a/include/compiler.h b/include/compiler.h
49index 29507f9840..90372f239c 100644
50--- a/include/compiler.h
51+++ b/include/compiler.h
52@@ -46,7 +46,6 @@
53 # include <byteswap.h>
54 #elif defined(__MACH__) || defined(__FreeBSD__)
55 # include <machine/endian.h>
56-typedef unsigned long ulong;
57 #endif
58 #ifdef __FreeBSD__
59 # include <sys/endian.h> /* htole32 and friends */
60@@ -66,6 +65,7 @@ typedef uint8_t __u8;
61 typedef uint16_t __u16;
62 typedef uint32_t __u32;
63 typedef unsigned int uint;
64+typedef unsigned long ulong;
65
66 #define uswap_16(x) \
67 ((((x) & 0xff00) >> 8) | \
68diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h
69index 1086d2168c..b96b50d98b 100644
70--- a/include/u-boot/crc.h
71+++ b/include/u-boot/crc.h
72@@ -8,6 +8,8 @@
73 #ifndef _UBOOT_CRC_H
74 #define _UBOOT_CRC_H
75
76+#include <compiler.h> /* unit definition */
77+
78 /**
79 * crc8() - Calculate and return CRC-8 of the data
80 *
81--
822.24.1
83