diff options
Diffstat (limited to 'meta/recipes-devtools/systemd-bootchart')
3 files changed, 109 insertions, 3 deletions
diff --git a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Add-riscv32-support.patch b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Add-riscv32-support.patch new file mode 100644 index 0000000000..80f0b6d378 --- /dev/null +++ b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Add-riscv32-support.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From da22e9f4eec22163feab5a0a4488627ea992daa9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 16 Sep 2024 23:58:36 +0000 | ||
4 | Subject: [PATCH] Add riscv32 support | ||
5 | |||
6 | Add missing definitions for the RISC-V 32-bit architecture. | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/systemd/systemd-bootchart/pull/54] | ||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | --- | ||
11 | configure.ac | 1 + | ||
12 | src/architecture.h | 4 ++++ | ||
13 | 2 files changed, 5 insertions(+) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index 5c9c20f..f977c78 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -45,6 +45,7 @@ SET_ARCH(IA32, i*86*) | ||
20 | SET_ARCH(MIPS, mips*) | ||
21 | SET_ARCH(AARCH64, aarch64*) | ||
22 | SET_ARCH(RISCV64, riscv64*) | ||
23 | +SET_ARCH(RISCV32, riscv32*) | ||
24 | |||
25 | AC_CHECK_SIZEOF(pid_t) | ||
26 | AC_CHECK_SIZEOF(uid_t) | ||
27 | diff --git a/src/architecture.h b/src/architecture.h | ||
28 | index cbf1795..f33cd00 100644 | ||
29 | --- a/src/architecture.h | ||
30 | +++ b/src/architecture.h | ||
31 | @@ -58,6 +58,7 @@ enum { | ||
32 | ARCHITECTURE_TILEGX, | ||
33 | ARCHITECTURE_CRIS, | ||
34 | ARCHITECTURE_RISCV64, | ||
35 | + ARCHITECTURE_RISCV32, | ||
36 | ARCHITECTURE_LOONGARCH, | ||
37 | _ARCHITECTURE_MAX, | ||
38 | _ARCHITECTURE_INVALID = -1 | ||
39 | @@ -151,6 +152,9 @@ int uname_architecture(void); | ||
40 | #elif defined(__riscv) && __riscv_xlen == 64 | ||
41 | # define native_architecture() ARCHITECTURE_RISCV64 | ||
42 | # define define LIB_ARCH_TUPLE "riscv64-linux-gnu" | ||
43 | +#elif defined(__riscv) && __riscv_xlen == 32 | ||
44 | +# define native_architecture() ARCHITECTURE_RISCV32 | ||
45 | +# define define LIB_ARCH_TUPLE "riscv32-linux-gnu" | ||
46 | #elif defined(__loongarch__) && __loongarch_grlen == 64 | ||
47 | # define native_architecture() ARCHITECTURE_LOONGARCH | ||
48 | # define define LIB_ARCH_TUPLE "loongarch64-linux-gnu" | ||
diff --git a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Define-portable-basename-function.patch b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Define-portable-basename-function.patch new file mode 100644 index 0000000000..dc4c44c6af --- /dev/null +++ b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart/0001-Define-portable-basename-function.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | From 4b19c32791fb8a8663b3335f8a3675a2bbabe688 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 20 May 2024 18:40:36 -0700 | ||
4 | Subject: [PATCH] Define portable basename function | ||
5 | |||
6 | Newer version of musl have removed prototype for basename in string.h [1] | ||
7 | which now makes it fail to compile with GCC14+ compiler therefore | ||
8 | define local basename utility function. | ||
9 | |||
10 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/systemd/systemd-bootchart/pull/53] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | src/conf-files.c | 14 ++++++++++++-- | ||
16 | 1 file changed, 12 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/src/conf-files.c b/src/conf-files.c | ||
19 | index 5dd2d7d..b932bb2 100644 | ||
20 | --- a/src/conf-files.c | ||
21 | +++ b/src/conf-files.c | ||
22 | @@ -35,6 +35,16 @@ | ||
23 | #include "strv.h" | ||
24 | #include "util.h" | ||
25 | |||
26 | +/*** | ||
27 | + * basename is implemented differently across different C libraries. This | ||
28 | + * implementation matches the one provided by the GNU libc, and does not | ||
29 | + * modify its input parameter. | ||
30 | +***/ | ||
31 | +static const char *sbc_basename(const char *path) { | ||
32 | + const char *base = strrchr(path, '/'); | ||
33 | + return base ? base + 1 : path; | ||
34 | +} | ||
35 | + | ||
36 | static int files_add(Hashmap *h, const char *root, const char *path, const char *suffix) { | ||
37 | _cleanup_closedir_ DIR *dir = NULL; | ||
38 | const char *dirpath; | ||
39 | @@ -63,7 +73,7 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char | ||
40 | if (!p) | ||
41 | return -ENOMEM; | ||
42 | |||
43 | - r = hashmap_put(h, basename(p), p); | ||
44 | + r = hashmap_put(h, sbc_basename(p), p); | ||
45 | if (r == -EEXIST) { | ||
46 | log_debug("Skipping overridden file: %s.", p); | ||
47 | free(p); | ||
48 | @@ -84,7 +94,7 @@ static int base_cmp(const void *a, const void *b) { | ||
49 | |||
50 | s1 = *(char * const *)a; | ||
51 | s2 = *(char * const *)b; | ||
52 | - return strcmp(basename(s1), basename(s2)); | ||
53 | + return strcmp(sbc_basename(s1), sbc_basename(s2)); | ||
54 | } | ||
55 | |||
56 | static int conf_files_list_strv_internal(char ***strv, const char *suffix, const char *root, char **dirs) { | ||
57 | -- | ||
58 | 2.45.1 | ||
59 | |||
diff --git a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_235.bb b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_235.bb index 25544029d5..31f3add89f 100644 --- a/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_235.bb +++ b/meta/recipes-devtools/systemd-bootchart/systemd-bootchart_235.bb | |||
@@ -11,19 +11,18 @@ LIC_FILES_CHKSUM = "file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c | |||
11 | SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https;branch=main \ | 11 | SRC_URI = "git://github.com/systemd/systemd-bootchart.git;protocol=https;branch=main \ |
12 | file://mips64.patch \ | 12 | file://mips64.patch \ |
13 | file://no_lto.patch \ | 13 | file://no_lto.patch \ |
14 | file://0001-Add-riscv32-support.patch \ | ||
14 | " | 15 | " |
15 | 16 | ||
16 | SRC_URI:append:libc-musl = " \ | 17 | SRC_URI:append:libc-musl = " \ |
17 | file://0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \ | 18 | file://0001-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \ |
18 | file://0002-musl-does-not-provide-printf-h.patch \ | 19 | file://0002-musl-does-not-provide-printf-h.patch \ |
19 | file://0003-musl-does-not-provide-canonicalize_file_name.patch \ | 20 | file://0003-musl-does-not-provide-canonicalize_file_name.patch \ |
21 | file://0001-Define-portable-basename-function.patch \ | ||
20 | " | 22 | " |
21 | 23 | ||
22 | |||
23 | SRCREV = "8ab9680a1bd5eb8fe7a7dcc44897af7ee41e56e7" | 24 | SRCREV = "8ab9680a1bd5eb8fe7a7dcc44897af7ee41e56e7" |
24 | 25 | ||
25 | S = "${WORKDIR}/git" | ||
26 | |||
27 | DEPENDS = "systemd libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native intltool" | 26 | DEPENDS = "systemd libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native intltool" |
28 | 27 | ||
29 | inherit pkgconfig autotools systemd features_check | 28 | inherit pkgconfig autotools systemd features_check |