[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen
From: |
Eli Zaretskii |
Subject: |
Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen |
Date: |
Thu, 21 May 2015 20:09:43 +0300 |
> Date: Thu, 21 May 2015 09:36:18 -0700
> From: Filipe Brandenburger <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden
>
> I think checking for whether popen accepts "rb" / "wb" is fine, but if
> it's done, I think it should be done in gnulib and then gnulib could
> provide one that accepts it regardless.
>
> However, this was attempted before and rejected because it would
> consider glibc as "broken" since it's actually the only one that
> doesn't accept it...
Ahm...
> The problem is that it's currently impossible to cross-compile
> sharutils without butchering the build system.
>
> For instance, this is what Gentoo does to the "configure" script after
> it's generated:
> https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/sharutils/files/sharutils-4.14-popen-rb.patch?view=markup
AFAIU, you are saying that the popen-binary test relies on running a
program, which of course is a cross-compilation killer.
> > (One reason why you may wish to leave that configure test is that many
> > modern platforms support "rb" and "wb" in calls to 'fopen', but not in
> > calls to 'popen'. AFAIR, glibc doesn't support binary modes in
> > 'popen'.)
>
> I think *all* of them support "rb" and "wb" to fopen, isn't that part
> of POSIX anyways?
I think so, yes. But not for 'popen', AFAIK.
> Any suggestions of what's the best way to solve this?
If a better test for popen-binary cannot be written that only compiles
and links a program, then I guess your solution is the next best,
indeed.
Thanks.
- Re: [PATCH 0/4] Cross compiling sharutils, (continued)
- Re: [PATCH 0/4] Cross compiling sharutils, Eli Zaretskii, 2015/05/19
- Re: [PATCH 0/4] Cross compiling sharutils, Bruce Korb, 2015/05/20
- Re: [PATCH 0/4] Cross compiling sharutils, Eric Blake, 2015/05/21
- Re: [PATCH 0/4] Cross compiling sharutils, Filipe Brandenburger, 2015/05/21
- Re: [PATCH 0/4] Cross compiling sharutils, Filipe Brandenburger, 2015/05/21
- [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Eli Zaretskii, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Paul Eggert, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen,
Eli Zaretskii <=
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/21
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Eli Zaretskii, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Andreas Schwab, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- [PATCH 1/2] Use O_BINARY to detect whether to pass "rb" to popen, Filipe Brandenburger, 2015/05/22
- [PATCH 2/2] Be more careful in guarding against pathological "begin" lines, Filipe Brandenburger, 2015/05/22
- Re: [PATCH 1/2] Use O_BINARY to detect whether to pass "rb" to popen, cowan, 2015/05/22
- Re: [PATCH] Use O_BINARY to detect whether to pass "rb" to popen, Bruce Korb, 2015/05/22