[PATCH] build: make sure probed tools don't wait for stdin input.
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as. The --version calls are unchanged because it is supposed to -v + exit. Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/configure b/configure index 576905c..5dd27c9 100755 --- a/configure +++ b/configure @@ -2545,14 +2545,14 @@ probe_cc(){ unset _depflags _DEPCMD _DEPFLAGS _flags_filter=echo - if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then + if $_cc -v 2>&1 < /dev/null | grep -q '^gcc.*LLVM'; then _type=llvm_gcc gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' - elif $_cc -v 2>&1 | grep -qi ^gcc; then + elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then _type=gcc gcc_version=$($_cc --version | head -n1) gcc_basever=$($_cc -dumpversion) @@ -2571,19 +2571,19 @@ probe_cc(){ _cflags_speed='-O3' _cflags_size='-Os' _cflags_noopt='-O1' - elif $_cc -v 2>&1 | grep -q xlc; then + elif $_cc -v 2>&1 < /dev/null | grep -q xlc; then _type=xlc _ident=$($_cc -qversion 2>/dev/null | head -n1) _cflags_speed='-O5' _cflags_size='-O5 -qcompact' - elif $_cc -V 2>/dev/null | grep -q Compaq; then + elif $_cc -V 2>/dev/null < /dev/null | grep -q Compaq; then _type=ccc _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3) _DEPFLAGS='-M' _cflags_speed='-fast' _cflags_size='-O1' _flags_filter=ccc_flags - elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then + elif $_cc --vsn 2>/dev/null < /dev/null | grep -q "ARM C/C++ Compiler"; then test -d "$sysroot" || die "No valid sysroot specified." _type=armcc _ident=$($_cc --vsn | head -n1) @@ -2609,13 +2609,13 @@ probe_cc(){ _cflags_speed='-O3 -mf=5' _cflags_size='-O3 -mf=2' _flags_filter=tms470_flags - elif $_cc -v 2>&1 | grep -q clang; then + elif $_cc -v 2>&1 < /dev/null | grep -q clang; then _type=clang _ident=$($_cc --version | head -n1) _depflags='-MMD' _cflags_speed='-O3' _cflags_size='-Os' - elif $_cc -V 2>&1 | grep -q Sun; then + elif $_cc -V 2>&1 < /dev/null | grep -q Sun; then _type=suncc _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-) _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' @@ -2624,21 +2624,21 @@ probe_cc(){ _cflags_speed='-O5' _cflags_size='-O5 -xspace' _flags_filter=suncc_flags - elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then + elif $_cc -v 2>&1 < /dev/null | grep -q 'PathScale\|Path64'; then _type=pathscale _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O2' _cflags_size='-Os' _flags_filter='filter_out -Wdisabled-optimization' - elif $_cc -v 2>&1 | grep -q Open64; then + elif $_cc -v 2>&1 < /dev/null | grep -q Open64; then _type=open64 _ident=$($_cc -v 2>&1 | head -n1 | tr -d :) _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O2' _cflags_size='-Os' _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros' - elif $_cc -V 2>&1 | grep -q Portland; then + elif $_cc -V 2>&1 < /dev/null | grep -q Portland; then _type=pgi _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')" opt_common='-alias=ansi -Mdse -Mlre -Mpre' @@ -2646,7 +2646,7 @@ probe_cc(){ _cflags_size="-O2 -Munroll=c:1 $opt_common" _cflags_noopt="-O1" _flags_filter=pgi_flags - elif $_cc 2>&1 | grep -q Microsoft; then + elif $_cc 2>&1 < /dev/null | grep -q Microsoft; then _type=msvc _ident=$($cc 2>&1 | head -n1) _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' @@ -2654,7 +2654,7 @@ probe_cc(){ _cflags_speed="-O2" _cflags_size="-O1" # Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it - if $_cc 2>&1 | grep -q Linker; then + if $_cc 2>&1 < /dev/null | grep -q Linker; then _ld_o='-out $@' else _ld_o='-Fe$@' -- 1.8.1
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping -- Clément B.
On Fri, Feb 15, 2013 at 12:05:59AM +0100, Clément Bœsch wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping
probably ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I know you won't believe me, but the highest form of Human Excellence is to question oneself and others. -- Socrates
On 05/10/13 6:44 PM, Michael Niedermayer wrote:
On Fri, Feb 15, 2013 at 12:05:59AM +0100, Clément Bœsch wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping
probably ok
As i said back in February, the output of GNU as doesn't start with "gcc", so the line
elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
needs to check for both "GNU" and "gcc". Something like grep -qi '^g\(cc\|nu\)' should do it.
On Sat, Oct 05, 2013 at 09:06:27PM -0300, James Almer wrote:
On 05/10/13 6:44 PM, Michael Niedermayer wrote:
On Fri, Feb 15, 2013 at 12:05:59AM +0100, Clément Bœsch wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping
probably ok
As i said back in February, the output of GNU as doesn't start with "gcc", so the line
elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
needs to check for both "GNU" and "gcc". Something like grep -qi '^g\(cc\|nu\)' should do it.
yes but is this related to fixing the regresion that configure waits infinitly on stdin? (which is what this patch is doing) thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
On 06/10/13 7:45 AM, Michael Niedermayer wrote:
On Sat, Oct 05, 2013 at 09:06:27PM -0300, James Almer wrote:
On 05/10/13 6:44 PM, Michael Niedermayer wrote:
On Fri, Feb 15, 2013 at 12:05:59AM +0100, Clément Bœsch wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping
probably ok
As i said back in February, the output of GNU as doesn't start with "gcc", so the line
elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
needs to check for both "GNU" and "gcc". Something like grep -qi '^g\(cc\|nu\)' should do it.
yes but is this related to fixing the regresion that configure waits infinitly on stdin? (which is what this patch is doing)
thanks
No, it fixes a bug introduced by fixing the hang on stdin. Since GNU as will not hang up anymore, the grep check will be done but fail as it only checks for '^gcc'.
On Sun, Oct 06, 2013 at 03:51:02PM -0300, James Almer wrote:
On 06/10/13 7:45 AM, Michael Niedermayer wrote:
On Sat, Oct 05, 2013 at 09:06:27PM -0300, James Almer wrote:
On 05/10/13 6:44 PM, Michael Niedermayer wrote:
On Fri, Feb 15, 2013 at 12:05:59AM +0100, Clément Bœsch wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
Ping
probably ok
As i said back in February, the output of GNU as doesn't start with "gcc", so the line
elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
needs to check for both "GNU" and "gcc". Something like grep -qi '^g\(cc\|nu\)' should do it.
yes but is this related to fixing the regresion that configure waits infinitly on stdin? (which is what this patch is doing)
thanks
No, it fixes a bug introduced by fixing the hang on stdin. Since GNU as will not hang up anymore, the grep check will be done but fail as it only checks for '^gcc'.
why dont you send patch(es) or pull req that fixes all this ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB It is dangerous to be right in matters on which the established authorities are wrong. -- Voltaire
On 08/01/13 8:15 PM, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/configure b/configure index 576905c..5dd27c9 100755 --- a/configure +++ b/configure @@ -2545,14 +2545,14 @@ probe_cc(){ unset _depflags _DEPCMD _DEPFLAGS _flags_filter=echo
- if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then + if $_cc -v 2>&1 < /dev/null | grep -q '^gcc.*LLVM'; then _type=llvm_gcc gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' - elif $_cc -v 2>&1 | grep -qi ^gcc; then + elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
The output of GNU as for example doesn't contain "GCC" anywhere. You should use grep -qi '^g\(cc\|nu\)' instead. Regards.
On Thu, Feb 14, 2013 at 09:08:39PM -0300, James Almer wrote:
On 08/01/13 8:15 PM, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/configure b/configure index 576905c..5dd27c9 100755 --- a/configure +++ b/configure @@ -2545,14 +2545,14 @@ probe_cc(){ unset _depflags _DEPCMD _DEPFLAGS _flags_filter=echo
- if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then + if $_cc -v 2>&1 < /dev/null | grep -q '^gcc.*LLVM'; then _type=llvm_gcc gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)') _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver" _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' - elif $_cc -v 2>&1 | grep -qi ^gcc; then + elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
The output of GNU as for example doesn't contain "GCC" anywhere. You should use grep -qi '^g\(cc\|nu\)' instead.
this breaks the code: as: unrecognized option '-dumpversion' as: unrecognized option '-dumpversion' and its not surprising, as is not gcc [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Democracy is the form of government in which you can choose your dictator
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
it seems a few entries where added since this patch, that this patch doesnt add "< /dev/null" to Maybe it would be easier and more robust to check for gnu as at the top or so, so it doesnt break when the next entry is added [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell
On Sat, Oct 26, 2013 at 10:45:23PM +0200, Michael Niedermayer wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
it seems a few entries where added since this patch, that this patch doesnt add "< /dev/null" to
Maybe it would be easier and more robust to check for gnu as at the top or so, so it doesnt break when the next entry is added
And what would you do in that case? Assume any AS version is supposed to behave like the GNU AS probing (aka not entering in any of the checks)? We could of course just not call the probing for AS at all, but I was trying to have a conservative approach because I'm not familiar with all the tools it's trying to probe. -- Clément B.
On Fri, Nov 08, 2013 at 11:40:34PM +0100, Clément Bœsch wrote:
On Sat, Oct 26, 2013 at 10:45:23PM +0200, Michael Niedermayer wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
it seems a few entries where added since this patch, that this patch doesnt add "< /dev/null" to
Maybe it would be easier and more robust to check for gnu as at the top or so, so it doesnt break when the next entry is added
And what would you do in that case? Assume any AS version is supposed to behave like the GNU AS probing (aka not entering in any of the checks)?
Ah... maybe something like attached? -- Clément B.
On Fri, Nov 08, 2013 at 11:56:23PM +0100, Clément Bœsch wrote:
On Fri, Nov 08, 2013 at 11:40:34PM +0100, Clément Bœsch wrote:
On Sat, Oct 26, 2013 at 10:45:23PM +0200, Michael Niedermayer wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
it seems a few entries where added since this patch, that this patch doesnt add "< /dev/null" to
Maybe it would be easier and more robust to check for gnu as at the top or so, so it doesnt break when the next entry is added
And what would you do in that case? Assume any AS version is supposed to behave like the GNU AS probing (aka not entering in any of the checks)?
Ah... maybe something like attached?
-- Clément B.
configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 3f6f0d7f99c2a98febb93dbb572f1d9b33ee7795 0001-build-avoid-stdin-stall-with-GNU-AS-probing.patch From 5b6bc5485629f1e7818b2d6ef78abe0fb050c357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u@pkh.me> Date: Fri, 8 Nov 2013 23:55:06 +0100 Subject: [PATCH] build: avoid stdin stall with GNU AS probing.
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
Fixes Ticket #1898.
should be ok, also iam happy with any other solution, if you prefer another [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB it is not once nor twice but times without number that the same ideas make their appearance in the world. -- Aristotle
On Sat, Nov 09, 2013 at 12:16:55PM +0100, Michael Niedermayer wrote:
On Fri, Nov 08, 2013 at 11:56:23PM +0100, Clément Bœsch wrote:
On Fri, Nov 08, 2013 at 11:40:34PM +0100, Clément Bœsch wrote:
On Sat, Oct 26, 2013 at 10:45:23PM +0200, Michael Niedermayer wrote:
On Wed, Jan 09, 2013 at 12:15:46AM +0100, Clément Bœsch wrote:
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898. --- configure | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
it seems a few entries where added since this patch, that this patch doesnt add "< /dev/null" to
Maybe it would be easier and more robust to check for gnu as at the top or so, so it doesnt break when the next entry is added
And what would you do in that case? Assume any AS version is supposed to behave like the GNU AS probing (aka not entering in any of the checks)?
Ah... maybe something like attached?
-- Clément B.
configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 3f6f0d7f99c2a98febb93dbb572f1d9b33ee7795 0001-build-avoid-stdin-stall-with-GNU-AS-probing.patch From 5b6bc5485629f1e7818b2d6ef78abe0fb050c357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <u@pkh.me> Date: Fri, 8 Nov 2013 23:55:06 +0100 Subject: [PATCH] build: avoid stdin stall with GNU AS probing.
a758c5e added probing for various tools, such as as. Unfortunately, GNU as is reading stdin with -v, and thus configure is stalled with configure arguments such as --as=as.
Fixes Ticket #1898.
should be ok, also iam happy with any other solution, if you prefer another
That last one is simpler so applied. -- Clément B.
participants (4)
-
Clément Bœsch -
Clément Bœsch -
James Almer -
Michael Niedermayer