Skip to contentSkip to conversation

scripts/gcc-goto.sh: Show stdout and stderr for potential errors

PATCH In review [email protected] 1 participant 2 messages Aug 9, 2018 – Sep 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/gcc-goto.sh: Show stdout and stderr for potential errors

From: He Zhe <[email protected]>

The check may fail not only because ${CC} does not support the asm feature, but also due to potential defects of ${CC} itself like what we experienced below or even it's missing.

Assembler messages:
Fatal error: The input and output files must be distinct (introduced by binutils-2.31 "Stop the assembler from overwriting its output file.")

This patch enables stdout and stderr to give user direct error information for those cases, while not polluting the output for normal cases.

---
 scripts/gcc-goto.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gcc-goto.sh +1 -1
index 083c526..bd7fc8eb 100755
@@ -3,7 +3,7 @@
 # Test for gcc 'asm goto' support
 # Copyright (C) 2010, Jason Baron <[email protected]>
 
-cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
+cat << "END" | $@ -x c - -c -o /dev/null && echo "y"
 int main(void)
 {
 #if defined(__arm__) || defined(__aarch64__)
Signature · 1 line
2.7.4
author
#1 lore raw

May I have your input?

Thanks,
Zhe

Quoted 33 lines · On 2018年08月09日 16:34, [email protected] wrote:

From: He Zhe <[email protected]>

The check may fail not only because ${CC} does not support the asm feature, but also due to potential defects of ${CC} itself like what we experienced below or even it's missing.

Assembler messages:
Fatal error: The input and output files must be distinct (introduced by binutils-2.31 "Stop the assembler from overwriting its output file.")

This patch enables stdout and stderr to give user direct error information for those cases, while not polluting the output for normal cases.

---
 scripts/gcc-goto.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gcc-goto.sh +1 -1
index 083c526..bd7fc8eb 100755
@@ -3,7 +3,7 @@
 # Test for gcc 'asm goto' support
 # Copyright (C) 2010, Jason Baron <[email protected]>
 
-cat << "END" | $@ -x c - -c -o /dev/null >/dev/null 2>&1 && echo "y"
+cat << "END" | $@ -x c - -c -o /dev/null && echo "y"
 int main(void)
 {
 #if defined(__arm__) || defined(__aarch64__)