All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
@ 2017-03-03  0:51 Alexey Kardashevskiy
  2017-03-14  2:54 ` Alexey Kardashevskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-03  0:51 UTC (permalink / raw)
  To: Jason Baron; +Cc: Alexey Kardashevskiy, Michael Ellerman, linux-kernel

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).

Cc: Jason Baron <jbaron@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 scripts/gcc-goto.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
index c9469d34ecc6..ab21216ab68d 100755
--- a/scripts/gcc-goto.sh
+++ b/scripts/gcc-goto.sh
@@ -2,7 +2,8 @@
 # Test for gcc 'asm goto' support
 # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
 
-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
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
  2017-03-03  0:51 [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y Alexey Kardashevskiy
@ 2017-03-14  2:54 ` Alexey Kardashevskiy
  2017-03-15  2:27   ` Alexey Kardashevskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-14  2:54 UTC (permalink / raw)
  To: Jason Baron; +Cc: Michael Ellerman, linux-kernel

On 03/03/17 11:51, Alexey Kardashevskiy wrote:
> 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).
> 
> Cc: Jason Baron <jbaron@redhat.com>


Ping?



> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  scripts/gcc-goto.sh | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
> index c9469d34ecc6..ab21216ab68d 100755
> --- a/scripts/gcc-goto.sh
> +++ b/scripts/gcc-goto.sh
> @@ -2,7 +2,8 @@
>  # Test for gcc 'asm goto' support
>  # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
>  
> -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
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
  2017-03-14  2:54 ` Alexey Kardashevskiy
@ 2017-03-15  2:27   ` Alexey Kardashevskiy
  2017-03-27  2:33     ` Alexey Kardashevskiy
  0 siblings, 1 reply; 4+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-15  2:27 UTC (permalink / raw)
  To: Jason Baron
  Cc: Michael Ellerman, linux-kernel, Rabin Vincent, Jiang Liu,
	Russell King, Catalin Marinas, Michal Marek

On 14/03/17 13:54, Alexey Kardashevskiy wrote:
> On 03/03/17 11:51, Alexey Kardashevskiy wrote:
>> 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).
>>
>> Cc: Jason Baron <jbaron@redhat.com>
> 
> 
> Ping?

I am adding more folks as Jason's mail server rejects mails with "Recipient
address rejected: Access denied ".


> 
> 
> 
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>  scripts/gcc-goto.sh | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
>> index c9469d34ecc6..ab21216ab68d 100755
>> --- a/scripts/gcc-goto.sh
>> +++ b/scripts/gcc-goto.sh
>> @@ -2,7 +2,8 @@
>>  # Test for gcc 'asm goto' support
>>  # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
>>  
>> -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
>>
> 
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
  2017-03-15  2:27   ` Alexey Kardashevskiy
@ 2017-03-27  2:33     ` Alexey Kardashevskiy
  0 siblings, 0 replies; 4+ messages in thread
From: Alexey Kardashevskiy @ 2017-03-27  2:33 UTC (permalink / raw)
  To: Jason Baron
  Cc: Michael Ellerman, linux-kernel, Rabin Vincent, Jiang Liu,
	Russell King, Catalin Marinas, Michal Marek, Greg Kroah-Hartman

On 15/03/17 13:27, Alexey Kardashevskiy wrote:
> On 14/03/17 13:54, Alexey Kardashevskiy wrote:
>> On 03/03/17 11:51, Alexey Kardashevskiy wrote:
>>> 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).
>>>
>>> Cc: Jason Baron <jbaron@redhat.com>
>>
>>
>> Ping?
> 
> I am adding more folks as Jason's mail server rejects mails with "Recipient
> address rejected: Access denied ".


Anyone, ping?


> 
> 
>>
>>
>>
>>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>>> ---
>>>  scripts/gcc-goto.sh | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/scripts/gcc-goto.sh b/scripts/gcc-goto.sh
>>> index c9469d34ecc6..ab21216ab68d 100755
>>> --- a/scripts/gcc-goto.sh
>>> +++ b/scripts/gcc-goto.sh
>>> @@ -2,7 +2,8 @@
>>>  # Test for gcc 'asm goto' support
>>>  # Copyright (C) 2010, Jason Baron <jbaron@redhat.com>
>>>  
>>> -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
>>>
>>
>>
> 
> 


-- 
Alexey

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-27  2:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03  0:51 [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y Alexey Kardashevskiy
2017-03-14  2:54 ` Alexey Kardashevskiy
2017-03-15  2:27   ` Alexey Kardashevskiy
2017-03-27  2:33     ` Alexey Kardashevskiy

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.