Skip to contentSkip to conversation

kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS

PATCH In review Masahiro Yamada 3 participants 4 messages Aug 5, 2021 – Aug 10, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS

LLVM_IAS is the user interface to set the -(no-)integrated-as flag, and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type, but it is not precise.

 $ make CC=gcc LLVM_IAS=1

... will use the GNU assembler since LLVM_IAS=1 is effective only when $(CC) is clang.

Of course, the combination of CC=gcc and LLVM_IAS=1 does not make sense, but the build system can be more robust against such insane input.

Commit ba64beb17493a ("kbuild: check the minimum assembler version in Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise because Kconfig checks the version string from the assembler in use.

---

 Makefile            | 2 +-
 arch/riscv/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
index 4ab151060931..8b56c9692c3c 100644
@@ -844,7 +844,7 @@ else
 DEBUG_CFLAGS	+= -g
 endif
 
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
 KBUILD_AFLAGS	+= -Wa,-gdwarf-2
 endif
 
arch/riscv/Makefile +1 -1
index bc74afdbf31e..dcfbd2a87d41 100644
@@ -41,7 +41,7 @@ endif
 ifeq ($(CONFIG_LD_IS_LLD),y)
 	KBUILD_CFLAGS += -mno-relax
 	KBUILD_AFLAGS += -mno-relax
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
 	KBUILD_CFLAGS += -Wa,-mno-relax
 	KBUILD_AFLAGS += -Wa,-mno-relax
 endif
Signature · 7 lines
2.30.2


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Masahiro Yamada

LLVM_IAS is the user interface to set the -(no-)integrated-as flag, and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type, but it is not precise.

 $ make CC=gcc LLVM_IAS=1

... will use the GNU assembler since LLVM_IAS=1 is effective only when $(CC) is clang.

Of course, the combination of CC=gcc and LLVM_IAS=1 does not make sense, but the build system can be more robust against such insane input.

Quoted 5 lines

Commit ba64beb17493a ("kbuild: check the minimum assembler version in Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise because Kconfig checks the version string from the assembler in use.

Quoted 35 lines

---

 Makefile            | 2 +-
 arch/riscv/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
index 4ab151060931..8b56c9692c3c 100644
@@ -844,7 +844,7 @@ else
 DEBUG_CFLAGS   += -g
 endif
 
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
 KBUILD_AFLAGS  += -Wa,-gdwarf-2
 endif
 
arch/riscv/Makefile +1 -2
index bc74afdbf31e..dcfbd2a87d41 100644
@@ -41,7 +41,7 @@ endif
 ifeq ($(CONFIG_LD_IS_LLD),y)
        KBUILD_CFLAGS += -mno-relax
        KBUILD_AFLAGS += -mno-relax
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
        KBUILD_CFLAGS += -Wa,-mno-relax
        KBUILD_AFLAGS += -Wa,-mno-relax
 endif
--

2.30.2

Signature · 2 lines
Thanks,
~Nick Desaulniers
maintainer Reviewed-by on v1 1/1
#2 lore raw
In reply to Masahiro Yamada
Quoted 15 lines · Masahiro Yamada

LLVM_IAS is the user interface to set the -(no-)integrated-as flag, and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type, but it is not precise.

  $ make CC=gcc LLVM_IAS=1

... will use the GNU assembler since LLVM_IAS=1 is effective only when $(CC) is clang.

Of course, the combination of CC=gcc and LLVM_IAS=1 does not make sense, but the build system can be more robust against such insane input.

Quoted 5 lines

Commit ba64beb17493a ("kbuild: check the minimum assembler version in Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise because Kconfig checks the version string from the assembler in use.

Quoted 33 lines

---

  Makefile            | 2 +-
  arch/riscv/Makefile | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
index 4ab151060931..8b56c9692c3c 100644
@@ -844,7 +844,7 @@ else
  DEBUG_CFLAGS	+= -g
  endif
 
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
  KBUILD_AFLAGS	+= -Wa,-gdwarf-2
  endif
 
arch/riscv/Makefile +1 -1
index bc74afdbf31e..dcfbd2a87d41 100644
@@ -41,7 +41,7 @@ endif
  ifeq ($(CONFIG_LD_IS_LLD),y)
  	KBUILD_CFLAGS += -mno-relax
  	KBUILD_AFLAGS += -mno-relax
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
  	KBUILD_CFLAGS += -Wa,-mno-relax
  	KBUILD_AFLAGS += -Wa,-mno-relax
  endif
#3 lore raw
Quoted 17 lines · Nathan Chancellor
Quoted 15 lines · Masahiro Yamada

LLVM_IAS is the user interface to set the -(no-)integrated-as flag, and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type, but it is not precise.

  $ make CC=gcc LLVM_IAS=1

... will use the GNU assembler since LLVM_IAS=1 is effective only when $(CC) is clang.

Of course, the combination of CC=gcc and LLVM_IAS=1 does not make sense, but the build system can be more robust against such insane input.

Quoted 7 lines
Quoted 5 lines

Commit ba64beb17493a ("kbuild: check the minimum assembler version in Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise because Kconfig checks the version string from the assembler in use.

Applied to linux-kbuild.

Quoted 33 lines
Quoted 33 lines

---

  Makefile            | 2 +-
  arch/riscv/Makefile | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
Makefile +1 -1
index 4ab151060931..8b56c9692c3c 100644
@@ -844,7 +844,7 @@ else
  DEBUG_CFLAGS        += -g
  endif
 
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
  KBUILD_AFLAGS       += -Wa,-gdwarf-2
  endif
 
arch/riscv/Makefile +1 -1
index bc74afdbf31e..dcfbd2a87d41 100644
@@ -41,7 +41,7 @@ endif
  ifeq ($(CONFIG_LD_IS_LLD),y)
      KBUILD_CFLAGS += -mno-relax
      KBUILD_AFLAGS += -mno-relax
-ifneq ($(LLVM_IAS),1)
+ifndef CONFIG_AS_IS_LLVM
      KBUILD_CFLAGS += -Wa,-mno-relax
      KBUILD_AFLAGS += -Wa,-mno-relax
  endif
Signature · 2 lines
Best Regards
Masahiro Yamada