gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
RFC PATCH 1/1 gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
With just CONFIG_DEBUG_INFO=y, the makefile adds "-g" to KBUILD_CFLAGS/KBUILD_AFLAGS and the test passes.
However, if CONFIG_DEBUG_INFO_SPLIT is also enabled, the makefile adds "-gsplit-dwarf" instead which makes the test fail with $?==1 because of objcopy trying to split the debug info:
objcopy: Warning: '/dev/null' is not an ordinary file
This changes the output to $(mktemp) which fixes the problem.
I am pretty sure there better ways, this is just to demonstrate the bug.
gcc 5.4.1, ppc64le (does not really matter).
--- scripts/gcc-goto.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/gcc-goto.sh +4 -1
@@ -2,7 +2,8 @@ # 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" +TMPOUT=$(mktemp) +cat << "END" | $@ -x c - -c -o $TMPOUT >/dev/null 2>&1 && echo "y" int main(void) { #if defined(__arm__) || defined(__aarch64__)
@@ -19,3 +20,5 @@ entry: return 0; } END + +rm $TMPOUT 2>/dev/null 2>&1
Signature · 1 line
2.11.0
Quoted 9 lines · Alexey Kardashevskiy
With just
CONFIG_DEBUG_INFO=y, the makefile adds "-g" to KBUILD_CFLAGS/KBUILD_AFLAGS and the test passes.However, if
CONFIG_DEBUG_INFO_SPLITis also enabled, the makefile adds "-gsplit-dwarf" instead which makes the test fail with $?==1 because of objcopy trying to split the debug info:objcopy: Warning: '
/dev/null' is not an ordinary file
Quoted 7 lines
This changes the output to $(mktemp) which fixes the problem.
I am pretty sure there better ways, this is just to demonstrate the bug.
gcc 5.4.1, ppc64le (does not really matter).
Cc Jason Baron <[email protected]>
Ping?
Quoted 26 lines
Signed-off-by Alexey Kardashevskiy <[email protected]>--- scripts/gcc-goto.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gcc-goto.sh +4
-1@@ -2,7 +2,8 @@ # 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" +TMPOUT=$(mktemp) +cat << "END" | $@ -x c - -c -o $TMPOUT >/dev/null 2>&1 && echo "y" int main(void) { #if defined(__arm__) || defined(__aarch64__)@@ -19,3 +20,5 @@ entry: return 0; } END + +rm $TMPOUT 2>/dev/null 2>&1
Signature · 1 line
Alexey
Quoted 12 lines · Alexey Kardashevskiy
Quoted 11 lines · Alexey Kardashevskiy
With just
CONFIG_DEBUG_INFO=y, the makefile adds "-g" to KBUILD_CFLAGS/KBUILD_AFLAGS and the test passes.However, if
CONFIG_DEBUG_INFO_SPLITis also enabled, the makefile adds "-gsplit-dwarf" instead which makes the test fail with $?==1 because of objcopy trying to split the debug info:objcopy: Warning: '
/dev/null' is not an ordinary fileThis changes the output to $(mktemp) which fixes the problem.
Quoted 8 lines
Quoted 5 lines
I am pretty sure there better ways, this is just to demonstrate the bug.
gcc 5.4.1, ppc64le (does not really matter).
Cc Jason Baron <[email protected]>Ping?
I am adding more folks as Jason's mail server rejects mails with "Recipient address rejected: Access denied ".
Quoted 31 lines
Quoted 29 lines
Signed-off-by Alexey Kardashevskiy <[email protected]>--- scripts/gcc-goto.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gcc-goto.sh +4
-1@@ -2,7 +2,8 @@ # 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" +TMPOUT=$(mktemp) +cat << "END" | $@ -x c - -c -o $TMPOUT >/dev/null 2>&1 && echo "y" int main(void) { #if defined(__arm__) || defined(__aarch64__)@@ -19,3 +20,5 @@ entry: return 0; } END + +rm $TMPOUT 2>/dev/null 2>&1
Signature · 1 line
Alexey
Quoted 17 lines · Alexey Kardashevskiy
Quoted 16 lines · Alexey Kardashevskiy
Quoted 15 lines · Alexey Kardashevskiy
With just
CONFIG_DEBUG_INFO=y, the makefile adds "-g" to KBUILD_CFLAGS/KBUILD_AFLAGS and the test passes.However, if
CONFIG_DEBUG_INFO_SPLITis also enabled, the makefile adds "-gsplit-dwarf" instead which makes the test fail with $?==1 because of objcopy trying to split the debug info:objcopy: Warning: '
/dev/null' is not an ordinary fileThis changes the output to $(mktemp) which fixes the problem.
I am pretty sure there better ways, this is just to demonstrate the bug.
gcc 5.4.1, ppc64le (does not really matter).
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Cc Jason Baron <[email protected]>Ping?
I am adding more folks as Jason's mail server rejects mails with "Recipient address rejected: Access denied ".
Anyone, ping?
Quoted 35 lines
Quoted 33 lines
Quoted 31 lines
Signed-off-by Alexey Kardashevskiy <[email protected]>--- scripts/gcc-goto.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)scripts/gcc-goto.sh +4
-1@@ -2,7 +2,8 @@ # 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" +TMPOUT=$(mktemp) +cat << "END" | $@ -x c - -c -o $TMPOUT >/dev/null 2>&1 && echo "y" int main(void) { #if defined(__arm__) || defined(__aarch64__)@@ -19,3 +20,5 @@ entry: return 0; } END + +rm $TMPOUT 2>/dev/null 2>&1
Signature · 1 line
Alexey