Thread (3 messages) 3 messages, 3 authors, 2017-01-25

[Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc

flat view
STALE3566d

From: Marcin Chojnacki <hidden>
Date: 2016-12-31 15:30:17
Subsystem: the rest · Maintainer: Linus Torvalds

toolchain-wrapper.c now uses program_invocation_short_name, which is
a glibc specific extension. This causes build to fail when using a
system with libc different than glibc (musl, BSD libc, etc.)

This change makes toolchain-wrapper.c portable, by setting it's value
to getprogname() when __GLIBC__ is not defined, and thus makes running
buildroot possible on glibc-less systems.

Signed-off-by: Marcin Chojnacki <redacted>
---
 toolchain/toolchain-wrapper.c | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/toolchain/toolchain-wrapper.c b/toolchain/toolchain-wrapper.c
index 100aa18..8eb0aca 100644
--- a/toolchain/toolchain-wrapper.c
+++ b/toolchain/toolchain-wrapper.c
@@ -141,6 +141,9 @@ static void check_unsafe_path(const char *arg,
 			      int arg_has_path)
 {
 	const struct str_len_s *p;
+#ifndef __GLIBC__
+	const char *program_invocation_short_name = getprogname();
+#endif
 
 	for (p=unsafe_paths; p->str; p++) {
 		if (strncmp(path, p->str, p->len))
-- 
2.10.1 (Apple Git-78)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help