From: Masahiro Yamada Date: Wed, 7 Aug 2024 18:03:00 +0000 (+0900) Subject: kbuild: avoid scripts/kallsyms parsing /dev/null X-Git-Tag: v6.10.7~124 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7adc1123d285f83c97a7a568b28829e1b5873954;p=thirdparty%2Fkernel%2Fstable.git kbuild: avoid scripts/kallsyms parsing /dev/null [ Upstream commit 1472464c6248575bf2d01c7f076b94704bb32c95 ] On macOS, as reported by Daniel Gomez, getline() sets ENOTTY to errno if it is requested to read from /dev/null. If this is worth fixing, I would rather pass an empty file to scripts/kallsyms instead of adding the ugly #ifdef __APPLE__. Fixes: c442db3f49f2 ("kbuild: remove PROVIDE() for kallsyms symbols") Reported-by: Daniel Gomez Closes: https://lore.kernel.org/all/20240807-macos-build-support-v1-12-4cd1ded85694@samsung.com/ Signed-off-by: Masahiro Yamada Reviewed-by: Nicolas Schier Reviewed-by: Daniel Gomez Signed-off-by: Sasha Levin --- diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 22d0bc8439863..070a319140e89 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -215,7 +215,8 @@ kallsymso= strip_debug= if is_enabled CONFIG_KALLSYMS; then - kallsyms /dev/null .tmp_vmlinux0.kallsyms + truncate -s0 .tmp_vmlinux.kallsyms0.syms + kallsyms .tmp_vmlinux.kallsyms0.syms .tmp_vmlinux0.kallsyms fi if is_enabled CONFIG_KALLSYMS || is_enabled CONFIG_DEBUG_INFO_BTF; then