diff mbox series

[12/12] scripts/kallsyms: add compatibility support for macos

Message ID 20240807-macos-build-support-v1-12-4cd1ded85694@samsung.com (mailing list archive)
State Handled Elsewhere
Delegated to: Paul Moore
Headers show
Series Enable build system on macOS hosts | expand

Commit Message

Daniel Gomez via B4 Relay Aug. 6, 2024, 11:09 p.m. UTC
From: Daniel Gomez <da.gomez@samsung.com>

Commit 67bf347ba924 ("kbuild: remove PROVIDE() for kallsyms symbols")
introduces the use of scripts/kallsyms with /dev/null as input to
generate the kernel symbols file. This results in getline() returning
ENOTTY as the errno value on macOS hosts. To handle this different
behavior, add a specific #ifdef condition for macOS.

Fixes:
+ scripts/kallsyms --base-relative /dev/null
read_symbol: Inappropriate ioctl for device
make[1]: *** [scripts/Makefile.vmlinux:34: vmlinux] Error 1
make: *** [Makefile:1172: vmlinux] Error 2

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 scripts/kallsyms.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 0ed873491bf5..cb200120a072 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -130,7 +130,11 @@  static struct sym_entry *read_symbol(FILE *in, char **buf, size_t *buf_len)
 	errno = 0;
 	readlen = getline(buf, buf_len, in);
 	if (readlen < 0) {
+#ifndef __APPLE__
 		if (errno) {
+#else
+		if (errno && errno != ENOTTY) {
+#endif
 			perror("read_symbol");
 			exit(EXIT_FAILURE);
 		}