* [Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc
@ 2016-12-31 15:30 Marcin Chojnacki
2016-12-31 22:56 ` Baruch Siach
0 siblings, 1 reply; 3+ messages in thread
From: Marcin Chojnacki @ 2016-12-31 15:30 UTC (permalink / raw)
To: buildroot
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 <marcinch7@gmail.com>
---
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)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc
2016-12-31 15:30 [Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc Marcin Chojnacki
@ 2016-12-31 22:56 ` Baruch Siach
2017-01-25 21:31 ` Peter Korsgaard
0 siblings, 1 reply; 3+ messages in thread
From: Baruch Siach @ 2016-12-31 22:56 UTC (permalink / raw)
To: buildroot
Hi Marcin,
On Sat, Dec 31, 2016 at 04:30:17PM +0100, Marcin Chojnacki wrote:
> 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.
getprogname() is BSD specific[1]. None of the major Linux libcs (glibc,
uclibc-ng, musl) provide it.
[1] https://www.freebsd.org/cgi/man.cgi?query=getprogname&sektion=3
baruch
> Signed-off-by: Marcin Chojnacki <marcinch7@gmail.com>
> ---
> 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))
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc
2016-12-31 22:56 ` Baruch Siach
@ 2017-01-25 21:31 ` Peter Korsgaard
0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2017-01-25 21:31 UTC (permalink / raw)
To: buildroot
>>>>> "Baruch" == Baruch Siach <baruch@tkos.co.il> writes:
> Hi Marcin,
> On Sat, Dec 31, 2016 at 04:30:17PM +0100, Marcin Chojnacki wrote:
>> 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.
> getprogname() is BSD specific[1]. None of the major Linux libcs (glibc,
> uclibc-ng, musl) provide it.
> [1] https://www.freebsd.org/cgi/man.cgi?query=getprogname&sektion=3
Out of interest, what system are you trying to use Buildroot on? A BSD
variant? I would imagine a number of other things breaking on !Linux
systems.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-01-25 21:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-31 15:30 [Buildroot] [PATCH 1/1] toolchain/wrapper: fix building without glibc Marcin Chojnacki
2016-12-31 22:56 ` Baruch Siach
2017-01-25 21:31 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.