mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Sankar <nivedita@alum.mit.edu>
To: Arvind Sankar <nivedita@alum.mit.edu>
Cc: Rong Chen <rong.a.chen@intel.com>,
	Fangrui Song <maskray@google.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	kernel test robot <lkp@intel.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	kbuild-all@lists.01.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [kbuild-all] Re: gcc-5: error: -gz is not supported in this configuration
Date: Wed, 10 Jun 2020 00:26:24 -0400	[thread overview]
Message-ID: <20200610042624.GA1950488@rani.riverdale.lan> (raw)
In-Reply-To: <20200610032331.GA1928844@rani.riverdale.lan>

On Tue, Jun 09, 2020 at 11:23:31PM -0400, Arvind Sankar wrote:
> On Tue, Jun 09, 2020 at 11:12:25PM -0400, Arvind Sankar wrote:
> > The output of gcc-5 -dumpspecs may also be useful.
> > 
> > The exact Kconfig check should have been
> > 	gcc-5 -Werror -gz=zlib -S -x c /dev/null -o /dev/null
> > 
> > I can't see how that would succeed if the a.c test didn't but maybe just
> > in case?
> 
> Oh wait, -S instead of -c. Which means it runs neither the assembler nor
> the linker, so gcc won't error out. But if that gcc was originally
> _configured_ with a version of binutils that doesn't support -gz=zlib,
> it will give an error on -c regardless of whether the runtime binutils
> would actually support it or not.

I think the below might be better than passing the option via -Wa, since
gcc will translate -gz=zlib into the right assembler option anyway, and
it will also generate an error if the compiler driver was misconfigured
and won't support the option even if the rest of the toolchain does,
fixing the config dependency.

Unless this doesn't work with Clang?

Alternatively (or even in addition), we should redefine cc-option to use
-c, it uses -S in the Kconfig version, apparently for speed, but -c in
the Kbuild version.

diff --git a/Makefile b/Makefile
index 839f9fee22cb..cb29e56f227a 100644
--- a/Makefile
+++ b/Makefile
@@ -842,7 +842,7 @@ endif
 
 ifdef CONFIG_DEBUG_INFO_COMPRESSED
 DEBUG_CFLAGS	+= -gz=zlib
-KBUILD_AFLAGS	+= -Wa,--compress-debug-sections=zlib
+KBUILD_AFLAGS	+= -gz=zlib
 KBUILD_LDFLAGS	+= --compress-debug-sections=zlib
 endif
 
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index cb98741601bd..94ce36be470c 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -229,7 +229,7 @@ config DEBUG_INFO_COMPRESSED
 	bool "Compressed debugging information"
 	depends on DEBUG_INFO
 	depends on $(cc-option,-gz=zlib)
-	depends on $(as-option,-Wa$(comma)--compress-debug-sections=zlib)
+	depends on $(as-option,-gz=zlib)
 	depends on $(ld-option,--compress-debug-sections=zlib)
 	help
 	  Compress the debug information using zlib.  Requires GCC 5.0+ or Clang

  reply	other threads:[~2020-06-10  4:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 13:11 kernel test robot
2020-06-09 17:28 ` Nick Desaulniers
2020-06-09 17:49   ` Fangrui Song
2020-06-10  0:30     ` [kbuild-all] " Rong Chen
2020-06-10  0:58       ` Fangrui Song
2020-06-10  1:49         ` Rong Chen
2020-06-10  3:12           ` Arvind Sankar
2020-06-10  3:23             ` Arvind Sankar
2020-06-10  4:26               ` Arvind Sankar [this message]
2020-06-10  6:37                 ` Fangrui Song
2020-06-10 19:11                   ` [PATCH] Makefile: Improve compressed debug info support detection Arvind Sankar
2020-06-10 21:27                     ` Nick Desaulniers
2020-06-10 23:30                       ` Arvind Sankar
2020-06-10 23:39                         ` Arvind Sankar
2020-06-11 20:44                           ` Nick Desaulniers
2020-06-11 21:44                             ` Arvind Sankar
2020-06-11 21:09                         ` Nick Desaulniers
2020-06-11 21:52                           ` Arvind Sankar
2020-06-11 22:03                           ` [PATCH v2] " Arvind Sankar
2020-06-11 23:38                             ` Nick Desaulniers
2020-06-14  2:21                               ` Masahiro Yamada

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=20200610042624.GA1950488@rani.riverdale.lan \
    --to=nivedita@alum.mit.edu \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=masahiroy@kernel.org \
    --cc=maskray@google.com \
    --cc=ndesaulniers@google.com \
    --cc=rong.a.chen@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®