Commit Graph

3 Commits

Author SHA1 Message Date
Khem Raj
11eb9bc67c 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>
[ Implement a basename() function in missing.h and ensure we always use
  the right include rather than having a separate gnu_basename() ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-06-10 18:15:39 -05:00
Emil Velikov
0140db94c0 libkmod: add fallback MODULE_INIT_COMPRESSED_FILE define
The symbol was somewhat recently introduced by the kernel and not all
distributions may be have available.

The number is part of the ABI, so we can add a local fallback define.

Closes: https://github.com/kmod-project/kmod/issues/29
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2023-09-27 22:37:45 -05:00
Lucas De Marchi
8b7189bc25 Move missing.h to shared directory 2014-10-03 00:31:10 -03:00