diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-03-02 05:41:39 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-03-02 05:41:39 +0000 |
commit | a4036575de835600b3085b97974d0766ef7c7bc2 (patch) | |
tree | 545e8444bbb80f76c5faf48f8fef3719b931fd44 /sys-apps/kmod/files | |
parent | 1331637681273dc8391d7a7caa6175405dceb735 (diff) |
gentoo auto-resync : 02:03:2024 - 05:41:39
Diffstat (limited to 'sys-apps/kmod/files')
-rw-r--r-- | sys-apps/kmod/files/kmod-30-configure-clang16.patch | 26 | ||||
-rw-r--r-- | sys-apps/kmod/files/kmod-31-musl-basename.patch | 113 |
2 files changed, 113 insertions, 26 deletions
diff --git a/sys-apps/kmod/files/kmod-30-configure-clang16.patch b/sys-apps/kmod/files/kmod-30-configure-clang16.patch deleted file mode 100644 index a9e1093aecff..000000000000 --- a/sys-apps/kmod/files/kmod-30-configure-clang16.patch +++ /dev/null @@ -1,26 +0,0 @@ -https://github.com/kmod-project/kmod/commit/035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2 - -From 035e6667d1ace2fd77ef36f5e5d93cd4b1e128a2 Mon Sep 17 00:00:00 2001 -From: Florian Weimer <fweimer@redhat.com> -Date: Sat, 17 Dec 2022 17:52:34 +0100 -Subject: [PATCH] kmod: configure.ac: In _Noreturn check, include <stdlib.h> - for exit - -Otherwise, an implicit functiona declaration is used, causing -a C99 compatibility issue. - -Signed-off-by: Florian Weimer <fweimer@redhat.com> -Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com> ---- a/configure.ac -+++ b/configure.ac -@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE( - - AC_MSG_CHECKING([whether _Noreturn is supported]) - AC_COMPILE_IFELSE( -- [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])], -+ [AC_LANG_SOURCE([[#include <stdlib.h> -+ _Noreturn int foo(void) { exit(0); }]])], - [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - diff --git a/sys-apps/kmod/files/kmod-31-musl-basename.patch b/sys-apps/kmod/files/kmod-31-musl-basename.patch new file mode 100644 index 000000000000..f4839dad2474 --- /dev/null +++ b/sys-apps/kmod/files/kmod-31-musl-basename.patch @@ -0,0 +1,113 @@ +https://github.com/kmod-project/kmod/pull/32 + +From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 9 Dec 2023 17:35:59 -0800 +Subject: [PATCH] Use portable implementation for basename API + +musl has removed the non-prototype declaration of basename from +string.h [1] which now results in build errors with clang-17+ compiler + +Implement GNU basename behavior using strchr which is portable across libcs + +Fixes +../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] +71 | "Commands:\n", basename(argv[0])); +| ^ + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Suggested-by: Rich Felker + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- a/libkmod/libkmod-config.c ++++ b/libkmod/libkmod-config.c +@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx, + bool is_single = false; + + if (name == NULL) { +- name = basename(path); ++ name = gnu_basename(path); + is_single = true; + } + +--- a/shared/util.c ++++ b/shared/util.c +@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t * + + char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len) + { +- char *modname; ++ const char *modname; + +- modname = basename(path); ++ modname = gnu_basename(path); + if (modname == NULL || modname[0] == '\0') + return NULL; + +--- a/shared/util.h ++++ b/shared/util.h +@@ -5,6 +5,7 @@ + #include <stdbool.h> + #include <stdlib.h> + #include <stdio.h> ++#include <string.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <time.h> +@@ -76,6 +77,12 @@ do { \ + __p->__v = (val); \ + } while(0) + ++static _always_inline_ const char *gnu_basename(const char *s) ++{ ++ const char *p = strrchr(s, '/'); ++ return p ? p+1 : s; ++} ++ + static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u) + { + return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1)); +--- a/testsuite/testsuite.c ++++ b/testsuite/testsuite.c +@@ -70,7 +70,7 @@ static void help(void) + + printf("Usage:\n" + "\t%s [options] <test>\n" +- "Options:\n", basename(progname)); ++ "Options:\n", gnu_basename(progname)); + + for (itr = options, itr_short = options_short; + itr->name != NULL; itr++, itr_short++) +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files + if (name != NULL) + namelen = strlen(name); + else { +- name = basename(dir); ++ name = gnu_basename(dir); + namelen = strlen(name); + dirlen -= namelen + 1; + } +--- a/tools/kmod.c ++++ b/tools/kmod.c +@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[]) + "Options:\n" + "\t-V, --version show version\n" + "\t-h, --help show this help\n\n" +- "Commands:\n", basename(argv[0])); ++ "Commands:\n", gnu_basename(argv[0])); + + for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) { + if (kmod_cmds[i]->help != NULL) { +@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[]) + const char *cmd; + size_t i; + +- cmd = basename(argv[0]); ++ cmd = gnu_basename(argv[0]); + + for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) { + if (streq(kmod_compat_cmds[i]->name, cmd)) + |