diff mbox series

kbuild: Switch to 'f' variants of integrated assembler flag

Message ID 20210816203635.53864-1-nathan@kernel.org (mailing list archive)
State New, archived
Headers show
Series kbuild: Switch to 'f' variants of integrated assembler flag | expand

Commit Message

Nathan Chancellor Aug. 16, 2021, 8:36 p.m. UTC
It has been brought up a few times in various code reviews that clang
3.5 introduced -f{,no-}integrated-as as the preferred way to enable and
disable the integrated assembler, mentioning that -{no-,}integrated-as
are now considered legacy flags.

Switch the kernel over to using those variants in case there is ever a
time where clang decides to remove the non-'f' variants of the flag.

Link: https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 scripts/Makefile.clang | 4 ++--
 scripts/as-version.sh  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)


base-commit: f12b034afeb3a977bbb1c6584dedc0f3dc666f14

Comments

Nick Desaulniers Aug. 16, 2021, 8:48 p.m. UTC | #1
On Mon, Aug 16, 2021 at 1:37 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> It has been brought up a few times in various code reviews that clang
> 3.5 introduced -f{,no-}integrated-as as the preferred way to enable and
> disable the integrated assembler, mentioning that -{no-,}integrated-as
> are now considered legacy flags.
>
> Switch the kernel over to using those variants in case there is ever a
> time where clang decides to remove the non-'f' variants of the flag.
>
> Link: https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Thanks for the patch! Want to fix
tools/testing/selftests/rseq/Makefile and
tools/testing/selftests/sched/Makefile, too? Either way...
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

> ---
>  scripts/Makefile.clang | 4 ++--
>  scripts/as-version.sh  | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
> index 3ae63bd35582..4cce8fd0779c 100644
> --- a/scripts/Makefile.clang
> +++ b/scripts/Makefile.clang
> @@ -23,11 +23,11 @@ CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
>  endif # CROSS_COMPILE
>
>  ifeq ($(LLVM_IAS),0)
> -CLANG_FLAGS    += -no-integrated-as
> +CLANG_FLAGS    += -fno-integrated-as
>  GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
>  CLANG_FLAGS    += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
>  else
> -CLANG_FLAGS    += -integrated-as
> +CLANG_FLAGS    += -fintegrated-as
>  endif
>  CLANG_FLAGS    += -Werror=unknown-warning-option
>  KBUILD_CFLAGS  += $(CLANG_FLAGS)
> diff --git a/scripts/as-version.sh b/scripts/as-version.sh
> index 8b9410e329df..a0fc366728f1 100755
> --- a/scripts/as-version.sh
> +++ b/scripts/as-version.sh
> @@ -21,13 +21,13 @@ get_canonical_version()
>         echo $((10000 * $1 + 100 * ${2:-0} + ${3:-0}))
>  }
>
> -# Clang fails to handle -Wa,--version unless -no-integrated-as is given.
> -# We check -(f)integrated-as, expecting it is explicitly passed in for the
> +# Clang fails to handle -Wa,--version unless -fno-integrated-as is given.
> +# We check -fintegrated-as, expecting it is explicitly passed in for the
>  # integrated assembler case.
>  check_integrated_as()
>  {
>         while [ $# -gt 0 ]; do
> -               if [ "$1" = -integrated-as -o "$1" = -fintegrated-as ]; then
> +               if [ "$1" = -fintegrated-as ]; then
>                         # For the intergrated assembler, we do not check the

^ want to fix this typo, too? s/intergrated/integrated/

>                         # version here. It is the same as the clang version, and
>                         # it has been already checked by scripts/cc-version.sh.
>
> base-commit: f12b034afeb3a977bbb1c6584dedc0f3dc666f14
> --
> 2.33.0.rc2
>
Nathan Chancellor Aug. 16, 2021, 8:50 p.m. UTC | #2
On 8/16/2021 1:48 PM, 'Nick Desaulniers' via Clang Built Linux wrote:
> On Mon, Aug 16, 2021 at 1:37 PM Nathan Chancellor <nathan@kernel.org> wrote:
>>
>> It has been brought up a few times in various code reviews that clang
>> 3.5 introduced -f{,no-}integrated-as as the preferred way to enable and
>> disable the integrated assembler, mentioning that -{no-,}integrated-as
>> are now considered legacy flags.
>>
>> Switch the kernel over to using those variants in case there is ever a
>> time where clang decides to remove the non-'f' variants of the flag.
>>
>> Link: https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags
>> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> 
> Thanks for the patch! Want to fix
> tools/testing/selftests/rseq/Makefile and
> tools/testing/selftests/sched/Makefile, too? Either way...
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>

Yes, I was planning to in a separate patch due to different maintainers :)

>> ---
>>   scripts/Makefile.clang | 4 ++--
>>   scripts/as-version.sh  | 6 +++---
>>   2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
>> index 3ae63bd35582..4cce8fd0779c 100644
>> --- a/scripts/Makefile.clang
>> +++ b/scripts/Makefile.clang
>> @@ -23,11 +23,11 @@ CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
>>   endif # CROSS_COMPILE
>>
>>   ifeq ($(LLVM_IAS),0)
>> -CLANG_FLAGS    += -no-integrated-as
>> +CLANG_FLAGS    += -fno-integrated-as
>>   GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
>>   CLANG_FLAGS    += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
>>   else
>> -CLANG_FLAGS    += -integrated-as
>> +CLANG_FLAGS    += -fintegrated-as
>>   endif
>>   CLANG_FLAGS    += -Werror=unknown-warning-option
>>   KBUILD_CFLAGS  += $(CLANG_FLAGS)
>> diff --git a/scripts/as-version.sh b/scripts/as-version.sh
>> index 8b9410e329df..a0fc366728f1 100755
>> --- a/scripts/as-version.sh
>> +++ b/scripts/as-version.sh
>> @@ -21,13 +21,13 @@ get_canonical_version()
>>          echo $((10000 * $1 + 100 * ${2:-0} + ${3:-0}))
>>   }
>>
>> -# Clang fails to handle -Wa,--version unless -no-integrated-as is given.
>> -# We check -(f)integrated-as, expecting it is explicitly passed in for the
>> +# Clang fails to handle -Wa,--version unless -fno-integrated-as is given.
>> +# We check -fintegrated-as, expecting it is explicitly passed in for the
>>   # integrated assembler case.
>>   check_integrated_as()
>>   {
>>          while [ $# -gt 0 ]; do
>> -               if [ "$1" = -integrated-as -o "$1" = -fintegrated-as ]; then
>> +               if [ "$1" = -fintegrated-as ]; then
>>                          # For the intergrated assembler, we do not check the
> 
> ^ want to fix this typo, too? s/intergrated/integrated/

Sounds good, v2 inc.

>>                          # version here. It is the same as the clang version, and
>>                          # it has been already checked by scripts/cc-version.sh.
>>
>> base-commit: f12b034afeb3a977bbb1c6584dedc0f3dc666f14
>> --
>> 2.33.0.rc2
>>
> 
>
diff mbox series

Patch

diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
index 3ae63bd35582..4cce8fd0779c 100644
--- a/scripts/Makefile.clang
+++ b/scripts/Makefile.clang
@@ -23,11 +23,11 @@  CLANG_FLAGS	+= --target=$(notdir $(CROSS_COMPILE:%-=%))
 endif # CROSS_COMPILE
 
 ifeq ($(LLVM_IAS),0)
-CLANG_FLAGS	+= -no-integrated-as
+CLANG_FLAGS	+= -fno-integrated-as
 GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
 CLANG_FLAGS	+= --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
 else
-CLANG_FLAGS	+= -integrated-as
+CLANG_FLAGS	+= -fintegrated-as
 endif
 CLANG_FLAGS	+= -Werror=unknown-warning-option
 KBUILD_CFLAGS	+= $(CLANG_FLAGS)
diff --git a/scripts/as-version.sh b/scripts/as-version.sh
index 8b9410e329df..a0fc366728f1 100755
--- a/scripts/as-version.sh
+++ b/scripts/as-version.sh
@@ -21,13 +21,13 @@  get_canonical_version()
 	echo $((10000 * $1 + 100 * ${2:-0} + ${3:-0}))
 }
 
-# Clang fails to handle -Wa,--version unless -no-integrated-as is given.
-# We check -(f)integrated-as, expecting it is explicitly passed in for the
+# Clang fails to handle -Wa,--version unless -fno-integrated-as is given.
+# We check -fintegrated-as, expecting it is explicitly passed in for the
 # integrated assembler case.
 check_integrated_as()
 {
 	while [ $# -gt 0 ]; do
-		if [ "$1" = -integrated-as -o "$1" = -fintegrated-as ]; then
+		if [ "$1" = -fintegrated-as ]; then
 			# For the intergrated assembler, we do not check the
 			# version here. It is the same as the clang version, and
 			# it has been already checked by scripts/cc-version.sh.