diff options
author | Jörg Sommer <joerg.sommer@navimatix.de> | 2024-01-12 15:15:35 +0100 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-01-12 08:51:12 -0800 |
commit | 072dd00d971e7142adb339a4c1abdeead889df36 (patch) | |
tree | 78359913506631afbdc3146f6431106635d879b7 /meta-oe/recipes-bsp | |
parent | f01a5bf834dcc9ef04641b7b07ffdb6b8c406059 (diff) | |
download | meta-openembedded-072dd00d971e7142adb339a4c1abdeead889df36.tar.gz |
i2cdev: Fix MUSL build
Building the recipe with MUSL fails, because it uses error.h which isn't
supported by MUSL. Because the usage is only in one expression, it's easy to
rewrite this.
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-bsp')
-rw-r--r-- | meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch | 122 | ||||
-rw-r--r-- | meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb | 1 |
2 files changed, 123 insertions, 0 deletions
diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch new file mode 100644 index 000000000..59fd379de --- /dev/null +++ b/meta-oe/recipes-bsp/i2cdev/i2cdev/fix-musl.patch | |||
@@ -0,0 +1,122 @@ | |||
1 | From ce3affeb45a65649dda1edc9a4f0586e9db47ada Mon Sep 17 00:00:00 2001 | ||
2 | Message-Id: <ce3affeb45a65649dda1edc9a4f0586e9db47ada.1705064898.git.joerg.sommer@navimatix.de> | ||
3 | From: =?UTF-8?q?J=C3=B6rg=20Sommer?= <joerg.sommer@navimatix.de> | ||
4 | Date: Fri, 12 Jan 2024 13:59:51 +0100 | ||
5 | Subject: [PATCH] lsi2c: Replace error() by fprintf, drop error.h | ||
6 | |||
7 | The MUSL C library doesn't support error.h. Because the only usage of this | ||
8 | is the *error* function in lsi2c.c, this gets replaced by a *fprintf*. This | ||
9 | doesn't print the program name, but keeps the message and the error | ||
10 | description. | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/costad2/i2cdev/pull/5] | ||
13 | --- | ||
14 | libi2cdev/access.c | 1 - | ||
15 | libi2cdev/i2c-bus-parser.c | 1 - | ||
16 | libi2cdev/i2c-dev-path.c | 1 - | ||
17 | libi2cdev/i2c-error.c | 1 - | ||
18 | libi2cdev/init.c | 2 -- | ||
19 | libi2cdev/sysfs.c | 1 - | ||
20 | lsi2c/lsi2c.c | 4 ++-- | ||
21 | 7 files changed, 2 insertions(+), 9 deletions(-) | ||
22 | |||
23 | diff --git a/libi2cdev/access.c b/libi2cdev/access.c | ||
24 | index 62a3f59..2e77659 100644 | ||
25 | --- a/libi2cdev/access.c | ||
26 | +++ b/libi2cdev/access.c | ||
27 | @@ -16,7 +16,6 @@ | ||
28 | |||
29 | #include "busses.h" | ||
30 | #include "data.h" | ||
31 | -#include "error.h" | ||
32 | #include "sysfs.h" | ||
33 | |||
34 | #include "i2cdiscov.h" | ||
35 | diff --git a/libi2cdev/i2c-bus-parser.c b/libi2cdev/i2c-bus-parser.c | ||
36 | index c4b8688..8c760e0 100644 | ||
37 | --- a/libi2cdev/i2c-bus-parser.c | ||
38 | +++ b/libi2cdev/i2c-bus-parser.c | ||
39 | @@ -27,7 +27,6 @@ | ||
40 | #include <dirent.h> | ||
41 | #include <fcntl.h> | ||
42 | #include <errno.h> | ||
43 | -#include <error.h> | ||
44 | #include <alloca.h> | ||
45 | #include <search.h> | ||
46 | |||
47 | diff --git a/libi2cdev/i2c-dev-path.c b/libi2cdev/i2c-dev-path.c | ||
48 | index b156db7..361761c 100644 | ||
49 | --- a/libi2cdev/i2c-dev-path.c | ||
50 | +++ b/libi2cdev/i2c-dev-path.c | ||
51 | @@ -11,7 +11,6 @@ | ||
52 | #include <string.h> | ||
53 | #include <errno.h> | ||
54 | #include <stdio.h> | ||
55 | -#include <error.h> | ||
56 | |||
57 | #include <linux/limits.h> | ||
58 | |||
59 | diff --git a/libi2cdev/i2c-error.c b/libi2cdev/i2c-error.c | ||
60 | index f92fb6b..540c112 100644 | ||
61 | --- a/libi2cdev/i2c-error.c | ||
62 | +++ b/libi2cdev/i2c-error.c | ||
63 | @@ -9,7 +9,6 @@ | ||
64 | |||
65 | #include <stdlib.h> | ||
66 | #include <stdio.h> | ||
67 | -#include <error.h> | ||
68 | #include <errno.h> | ||
69 | #include <stdbool.h> | ||
70 | #include <stdarg.h> | ||
71 | diff --git a/libi2cdev/init.c b/libi2cdev/init.c | ||
72 | index 99a7edd..dfc4090 100644 | ||
73 | --- a/libi2cdev/init.c | ||
74 | +++ b/libi2cdev/init.c | ||
75 | @@ -16,10 +16,8 @@ | ||
76 | #include <errno.h> | ||
77 | #include <dirent.h> | ||
78 | #include <unistd.h> | ||
79 | -#include <error.h> | ||
80 | #include <limits.h> | ||
81 | #include <ctype.h> | ||
82 | -#include <error.h> | ||
83 | #include <fcntl.h> | ||
84 | #include <assert.h> | ||
85 | |||
86 | diff --git a/libi2cdev/sysfs.c b/libi2cdev/sysfs.c | ||
87 | index 2811500..a7e13a8 100644 | ||
88 | --- a/libi2cdev/sysfs.c | ||
89 | +++ b/libi2cdev/sysfs.c | ||
90 | @@ -17,7 +17,6 @@ | ||
91 | #include <assert.h> | ||
92 | #include <string.h> | ||
93 | #include <fcntl.h> | ||
94 | -#include <error.h> | ||
95 | #include <errno.h> | ||
96 | |||
97 | #include <sys/types.h> | ||
98 | diff --git a/lsi2c/lsi2c.c b/lsi2c/lsi2c.c | ||
99 | index 7af5313..34c6225 100644 | ||
100 | --- a/lsi2c/lsi2c.c | ||
101 | +++ b/lsi2c/lsi2c.c | ||
102 | @@ -38,7 +38,6 @@ | ||
103 | #include <stdlib.h> | ||
104 | #include <string.h> | ||
105 | #include <errno.h> | ||
106 | -#include <error.h> | ||
107 | #include <getopt.h> | ||
108 | #include <stdbool.h> | ||
109 | |||
110 | @@ -205,7 +204,8 @@ static int read_config_file(const char *config_file_name) | ||
111 | if (err < 0) { | ||
112 | err = -err; | ||
113 | } | ||
114 | - error(0, err, "Failed to initialize i2cdevices"); | ||
115 | + fflush(stdout); | ||
116 | + fprintf(stderr, "Failed to initialize i2cdevices: %s", strerror(err)); | ||
117 | if (config_file) { | ||
118 | fclose(config_file); | ||
119 | } | ||
120 | -- | ||
121 | 2.34.1 | ||
122 | |||
diff --git a/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb index b41ecffae..b2b5fda09 100644 --- a/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb +++ b/meta-oe/recipes-bsp/i2cdev/i2cdev_git.bb | |||
@@ -17,6 +17,7 @@ PR = "git${SRCPV}" | |||
17 | SRC_URI = "\ | 17 | SRC_URI = "\ |
18 | git://github.com/costad2/i2cdev.git;protocol=https;branch=master \ | 18 | git://github.com/costad2/i2cdev.git;protocol=https;branch=master \ |
19 | file://fix-lsi2c-makefile.patch \ | 19 | file://fix-lsi2c-makefile.patch \ |
20 | file://fix-musl.patch \ | ||
20 | " | 21 | " |
21 | SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc" | 22 | SRCREV = "ed9ad777d842880e7ac6ca5e0de4bd2d3b4d02dc" |
22 | 23 | ||