kbuild: Switch to 'f' variants of integrated assembler flag
Subsystems (2)
Nathan Chancellor
maintainerPATCH 1/1 kbuild: Switch to 'f' variants of integrated assembler flag
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.
--- scripts/Makefile.clang | 4 ++-- scripts/as-version.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
scripts/Makefile.clang +2 -2
@@ -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)
scripts/as-version.sh +3 -3
@@ -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.
base-commit: f12b034afeb3a977bbb1c6584dedc0f3dc666f14
Signature · 1 line
2.33.0.rc2
Quoted 11 lines · Nathan Chancellor
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.
Thanks for the patch! Want to fix tools/testing/selftests/rseq/Makefile and tools/testing/selftests/sched/Makefile, too? Either way...
Quoted 32 lines
--- scripts/Makefile.clang | 4 ++-- scripts/as-version.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)scripts/Makefile.clang +2
-2@@ -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)scripts/as-version.sh +0
-1@@ -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.
scripts/as-version.sh get_canonical_version() · line 31
Quoted 10 lines
scripts/as-version.sh +3
-2-# 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/
Quoted 7 lines
scripts/as-version.sh +0
-0# 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
Signature · 2 lines
Thanks, ~Nick Desaulniers
Nathan Chancellor
maintainerQuoted 10 lines · Nick Desaulniers' via Clang Built Linux
Quoted 9 lines · Nathan Chancellor
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.
Quoted 7 lines
Quoted 2 lines
Thanks for the patch! Want to fix
tools/testing/selftests/rseq/Makefileandtools/testing/selftests/sched/Makefile, too? Either way...Reviewed-by Nick Desaulniers <[email protected]>
Yes, I was planning to in a separate patch due to different maintainers :)
Quoted 31 lines
Quoted 31 lines
--- scripts/Makefile.clang | 4 ++-- scripts/as-version.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)scripts/Makefile.clang +2
-2@@ -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)scripts/as-version.sh +0
-0@@ -21,13 +21,13 @@ get_canonical_version() echo $((10000 * $1 + 100 * ${2:-0} + ${3:-0})) }
Quoted 13 lines
scripts/as-version.sh get_canonical_version() · line 31
Quoted 11 lines
scripts/as-version.sh +3
-3-# 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.
Quoted 9 lines
Quoted 7 lines
scripts/as-version.sh +0
-0# 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
maintainerPATCH v2 1/1 kbuild: Switch to 'f' variants of integrated assembler flag
In reply to Nathan ChancellorIt 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.
Also, fix a typo in a comment ("intergrated" -> "integrated").
---
v1 -> v2:
* Fix typo in comment in same area as patch.
* Add Nick's reviewed-by tag.
scripts/Makefile.clang | 4 ++-- scripts/as-version.sh | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
scripts/Makefile.clang +2 -2
@@ -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)
scripts/as-version.sh +4 -4
@@ -21,14 +21,14 @@ 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 - # For the intergrated assembler, we do not check the + if [ "$1" = -fintegrated-as ]; then + # For the integrated 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. echo LLVM 0
base-commit: f12b034afeb3a977bbb1c6584dedc0f3dc666f14
Signature · 1 line
2.33.0.rc2
Quoted 9 lines · Nathan Chancellor
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.
Quoted 6 lines
Also, fix a typo in a comment ("intergrated" -> "integrated").
Reviewed-by Nick Desaulniers <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>---
Applied to linux-kbuild.
Thanks.
Signature · 2 lines
Best Regards Masahiro Yamada