Skip to content

Commit

Permalink
kbuild: Switch to 'f' variants of integrated assembler flag
Browse files Browse the repository at this point in the history
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.

Also, fix a typo in a comment ("intergrated" -> "integrated").

Link: https://releases.llvm.org/3.5.0/tools/clang/docs/ReleaseNotes.html#new-compiler-flags
Reviewed-by: Nick Desaulniers <[email protected]>
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
nathanchance authored and masahir0y committed Sep 2, 2021
1 parent 6272cc3 commit 2185a7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/Makefile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions scripts/as-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2185a7e

Please sign in to comment.