public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 14/16] kconfig: Add support for 'as-option'
       [not found] <1576486038-9899-1-git-send-email-amit.kachhap@arm.com>
@ 2019-12-16  8:47 ` Amit Daniel Kachhap
  2019-12-17 11:43   ` Masahiro Yamada
  2020-01-17 11:33   ` Catalin Marinas
  0 siblings, 2 replies; 5+ messages in thread
From: Amit Daniel Kachhap @ 2019-12-16  8:47 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Mark Rutland, Kees Cook, Ard Biesheuvel, Catalin Marinas,
	Suzuki K Poulose, Will Deacon, Ramana Radhakrishnan,
	Kristina Martsenko, Dave Martin, Amit Daniel Kachhap, James Morse,
	Vincenzo Frascino, Mark Brown, Richard Henderson,
	Vincenzo Frascino, Masahiro Yamada, linux-kbuild

From: Vincenzo Frascino <vincenzo.frascino@arm.com>

Currently kconfig does not have a feature that allows to detect if the
used assembler supports a specific compilation option.

Introduce 'as-option' to serve this purpose in the context of Kconfig:

	config X
		def_bool $(as-option,...)

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-kbuild@vger.kernel.org
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
---
Changes since last version:
* None.

 scripts/Kconfig.include | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
index d4adfbe..cc465dd 100644
--- a/scripts/Kconfig.include
+++ b/scripts/Kconfig.include
@@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /de
 # Return y if the linker supports <flag>, n otherwise
 ld-option = $(success,$(LD) -v $(1))
 
+# $(as-option,<flag>)
+# Return y if the assembler supports <flag>, n otherwise
+as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -E -x assembler /dev/null -o /dev/null)
+
 # check if $(CC) and $(LD) exist
 $(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
 $(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
-- 
2.7.4

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

* Re: [PATCH v3 14/16] kconfig: Add support for 'as-option'
  2019-12-16  8:47 ` [PATCH v3 14/16] kconfig: Add support for 'as-option' Amit Daniel Kachhap
@ 2019-12-17 11:43   ` Masahiro Yamada
  2020-01-17 11:33   ` Catalin Marinas
  1 sibling, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2019-12-17 11:43 UTC (permalink / raw)
  To: Amit Daniel Kachhap
  Cc: linux-arm-kernel, Mark Rutland, Kees Cook, Ard Biesheuvel,
	Catalin Marinas, Suzuki K Poulose, Will Deacon,
	Ramana Radhakrishnan, Kristina Martsenko, Dave Martin,
	James Morse, Vincenzo Frascino, Mark Brown, Richard Henderson,
	Linux Kbuild mailing list

On Mon, Dec 16, 2019 at 5:48 PM Amit Daniel Kachhap
<amit.kachhap@arm.com> wrote:
>
> From: Vincenzo Frascino <vincenzo.frascino@arm.com>
>
> Currently kconfig does not have a feature that allows to detect if the
> used assembler supports a specific compilation option.
>
> Introduce 'as-option' to serve this purpose in the context of Kconfig:
>
>         config X
>                 def_bool $(as-option,...)
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: linux-kbuild@vger.kernel.org
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> Signed-off-by: Amit Daniel Kachhap <amit.kachhap@arm.com>
> ---

If you apply this to arm64 tree, just go ahead.
Acked-by: Masahiro Yamada <masahiroy@kernel.org>

But, please be aware of a possible merge conflict with:
https://patchwork.kernel.org/patch/11285929/




-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v3 14/16] kconfig: Add support for 'as-option'
  2019-12-16  8:47 ` [PATCH v3 14/16] kconfig: Add support for 'as-option' Amit Daniel Kachhap
  2019-12-17 11:43   ` Masahiro Yamada
@ 2020-01-17 11:33   ` Catalin Marinas
  2020-01-17 17:51     ` Masahiro Yamada
  2020-01-20 10:26     ` Vincenzo Frascino
  1 sibling, 2 replies; 5+ messages in thread
From: Catalin Marinas @ 2020-01-17 11:33 UTC (permalink / raw)
  To: Amit Daniel Kachhap
  Cc: linux-arm-kernel, Mark Rutland, Kees Cook, Ard Biesheuvel,
	Suzuki K Poulose, Will Deacon, Ramana Radhakrishnan,
	Kristina Martsenko, Dave Martin, James Morse, Vincenzo Frascino,
	Mark Brown, Richard Henderson, Masahiro Yamada, linux-kbuild

On Mon, Dec 16, 2019 at 02:17:16PM +0530, Amit Daniel Kachhap wrote:
> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
> index d4adfbe..cc465dd 100644
> --- a/scripts/Kconfig.include
> +++ b/scripts/Kconfig.include
> @@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /de
>  # Return y if the linker supports <flag>, n otherwise
>  ld-option = $(success,$(LD) -v $(1))
>  
> +# $(as-option,<flag>)
> +# Return y if the assembler supports <flag>, n otherwise
> +as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -E -x assembler /dev/null -o /dev/null)

I had different experiments with this for MTE and noticed that clang
does not honour the -Wa, option (which you use in a subsequent patch).
So not sure how useful as-option is.

-- 
Catalin

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

* Re: [PATCH v3 14/16] kconfig: Add support for 'as-option'
  2020-01-17 11:33   ` Catalin Marinas
@ 2020-01-17 17:51     ` Masahiro Yamada
  2020-01-20 10:26     ` Vincenzo Frascino
  1 sibling, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-01-17 17:51 UTC (permalink / raw)
  To: Catalin Marinas
  Cc: Amit Daniel Kachhap, linux-arm-kernel, Mark Rutland, Kees Cook,
	Ard Biesheuvel, Suzuki K Poulose, Will Deacon,
	Ramana Radhakrishnan, Kristina Martsenko, Dave Martin,
	James Morse, Vincenzo Frascino, Mark Brown, Richard Henderson,
	Linux Kbuild mailing list

On Fri, Jan 17, 2020 at 8:33 PM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Mon, Dec 16, 2019 at 02:17:16PM +0530, Amit Daniel Kachhap wrote:
> > diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
> > index d4adfbe..cc465dd 100644
> > --- a/scripts/Kconfig.include
> > +++ b/scripts/Kconfig.include
> > @@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /de
> >  # Return y if the linker supports <flag>, n otherwise
> >  ld-option = $(success,$(LD) -v $(1))
> >
> > +# $(as-option,<flag>)
> > +# Return y if the assembler supports <flag>, n otherwise
> > +as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -E -x assembler /dev/null -o /dev/null)
>
> I had different experiments with this for MTE and noticed that clang
> does not honour the -Wa, option (which you use in a subsequent patch).
> So not sure how useful as-option is.


I think this is because it uses '-E' option.

To invoke the assembler, -c is needed.


I replaced -E with -c, and tested it.
It seems working for both gcc and clang.



I noticed a similar case for cc-option:
https://patchwork.kernel.org/patch/11339567/


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v3 14/16] kconfig: Add support for 'as-option'
  2020-01-17 11:33   ` Catalin Marinas
  2020-01-17 17:51     ` Masahiro Yamada
@ 2020-01-20 10:26     ` Vincenzo Frascino
  1 sibling, 0 replies; 5+ messages in thread
From: Vincenzo Frascino @ 2020-01-20 10:26 UTC (permalink / raw)
  To: Catalin Marinas, Amit Daniel Kachhap
  Cc: linux-arm-kernel, Mark Rutland, Kees Cook, Ard Biesheuvel,
	Suzuki K Poulose, Will Deacon, Ramana Radhakrishnan,
	Kristina Martsenko, Dave Martin, James Morse, Mark Brown,
	Richard Henderson, Masahiro Yamada, linux-kbuild

[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]

Hi Catalin,

On 17/01/2020 11:33, Catalin Marinas wrote:
> On Mon, Dec 16, 2019 at 02:17:16PM +0530, Amit Daniel Kachhap wrote:
>> diff --git a/scripts/Kconfig.include b/scripts/Kconfig.include
>> index d4adfbe..cc465dd 100644
>> --- a/scripts/Kconfig.include
>> +++ b/scripts/Kconfig.include
>> @@ -31,6 +31,10 @@ cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /de
>>  # Return y if the linker supports <flag>, n otherwise
>>  ld-option = $(success,$(LD) -v $(1))
>>  
>> +# $(as-option,<flag>)
>> +# Return y if the assembler supports <flag>, n otherwise
>> +as-option = $(success, $(CC) $(CLANG_FLAGS) $(1) -E -x assembler /dev/null -o /dev/null)
> 
> I had different experiments with this for MTE and noticed that clang
> does not honour the -Wa, option (which you use in a subsequent patch).
> So not sure how useful as-option is.
> 

Not sure of your experiments for MTE, the kernel is built with clang but uses
the GNU assembler. The -Wa, option is passed down to the assembler (GNU) which
honors it.

Said that, I agree with Masahiro Yamada about the "-c" option to be used in
place of "-E" and on that sense I provided a patch to Amit last December which
should be integrated in the next series (Amit can confirm, I hope ;) ).

-- 
Regards,
Vincenzo

[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 14291 bytes --]

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

end of thread, other threads:[~2020-01-20 10:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1576486038-9899-1-git-send-email-amit.kachhap@arm.com>
2019-12-16  8:47 ` [PATCH v3 14/16] kconfig: Add support for 'as-option' Amit Daniel Kachhap
2019-12-17 11:43   ` Masahiro Yamada
2020-01-17 11:33   ` Catalin Marinas
2020-01-17 17:51     ` Masahiro Yamada
2020-01-20 10:26     ` Vincenzo Frascino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox