linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>,
	Arvind Sankar <nivedita@alum.mit.edu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brendan Higgins <brendanhiggins@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Changbin Du <changbin.du@intel.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] kconfig: unify cc-option and as-option
Date: Mon, 15 Jun 2020 11:00:08 +0100	[thread overview]
Message-ID: <20200615100007.GD2477@willie-the-truck> (raw)
In-Reply-To: <20200614144341.1077495-2-masahiroy@kernel.org>

On Sun, Jun 14, 2020 at 11:43:41PM +0900, Masahiro Yamada wrote:
> cc-option and as-option are almost the same; both pass the flag to
> $(CC). The main difference is the cc-option stops before the assemble
> stage (-S option) whereas as-option stops after it (-c option).
> 
> I chose -S because it is slightly faster, but $(cc-option,-gz=zlib)
> returns a wrong result (https://lkml.org/lkml/2020/6/9/1529).
> It has been fixed by a separate patch, but using -c is more robust.
> 
> However, you cannot simply replace -S with -c because the following
> code would break:
> 
>     depends on $(cc-option,-gsplit-dwarf)
> 
> The combination of -c and -gsplit-dwarf does not accept /dev/null as
> output.
> 
>   $ cat /dev/null | gcc -gsplit-dwarf -S -x c - -o /dev/null
>   $ echo $?
>   0
> 
>   $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o /dev/null
>   objcopy: Warning: '/dev/null' is not an ordinary file
>   $ echo $?
>   1
> 
>   $ cat /dev/null | gcc -gsplit-dwarf -c -x c - -o tmp.o
>   $ echo $?
>   0
> 
> There is another flag that creates an separate file based on the
> object file path:
> 
>   $ cat /dev/null | gcc -ftest-coverage -c -x c - -o /dev/null
>   <stdin>:1: error: cannot open /dev/null.gcno
> 
> So, we cannot use /dev/null to sink the output.
> 
> Align the cc-option implementation with scripts/Kbuild.include.
> 
> With -c option used in cc-option, as-option is unneeded.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
> 
>  arch/arm64/Kconfig      | 2 +-
>  lib/Kconfig.debug       | 1 -
>  scripts/Kconfig.include | 8 +-------
>  3 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 31380da53689..6eb18f45258e 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -1564,7 +1564,7 @@ config CC_HAS_SIGN_RETURN_ADDRESS
>  	def_bool $(cc-option,-msign-return-address=all)
>  
>  config AS_HAS_PAC
> -	def_bool $(as-option,-Wa$(comma)-march=armv8.3-a)
> +	def_bool $(cc-option,-Wa$(comma)-march=armv8.3-a)

For this arm64 part:

Acked-by: Will Deacon <will@kernel.org>

Will

  reply	other threads:[~2020-06-15 10:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14 14:43 [PATCH 1/2] kbuild: improve cc-option to clean up all temporary files Masahiro Yamada
2020-06-14 14:43 ` [PATCH 2/2] kconfig: unify cc-option and as-option Masahiro Yamada
2020-06-15 10:00   ` Will Deacon [this message]
2021-05-04 20:17   ` Johannes Berg
2021-05-04 20:46     ` Masahiro Yamada
2021-05-04 20:52       ` Johannes Berg
2021-05-04 21:05         ` Masahiro Yamada
2021-05-04 21:08           ` Johannes Berg

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=20200615100007.GD2477@willie-the-truck \
    --to=will@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendanhiggins@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=changbin.du@intel.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nivedita@alum.mit.edu \
    --cc=rdunlap@infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).