All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Jason Baron <jbaron@redhat.com>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linux-kernel@vger.kernel.org
Subject: [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y
Date: Fri,  3 Mar 2017 11:51:05 +1100	[thread overview]
Message-ID: <20170303005105.19425-1-aik@ozlabs.ru> (raw)

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

             reply	other threads:[~2017-03-03  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03  0:51 Alexey Kardashevskiy [this message]
2017-03-14  2:54 ` [RFC PATCH kernel] gcc-goto.sh: Allow to pass with CONFIG_DEBUG_INFO_SPLIT=y Alexey Kardashevskiy
2017-03-15  2:27   ` Alexey Kardashevskiy
2017-03-27  2:33     ` Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170303005105.19425-1-aik@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpe@ellerman.id.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.