What does "&& n" mean in Kconfig?

I’m trying to compile Linux 6.7.2 with support for the x32 ABI and I just can’t figure out what this means:

Symbol: X86_X32_ABI [=n]
Type  : bool
Defined at arch/x86/Kconfig:3007
  Prompt: x32 ABI for 64-bit mode
  Depends on: X86_64 [=y] && n
(3) -> Binary Emulations
      -> x32 ABI for 64-bit mode (X86_X32_ABI [=n])

How do I get rid of the n in X86_64 [=y] && n so that it actually lets me enable this option?

Asked By: Big Temp


The referenced location: arch/x86/Kconfig:3007:

config X86_X32_ABI
  bool "x32 ABI for 64-bit mode"
  depends on X86_64
  # llvm-objcopy does not convert x86_64 .note.gnu.property or
  # compressed debug sections to x86_x32 properly:
  # https://github.com/ClangBuiltLinux/linux/issues/514
  # https://github.com/ClangBuiltLinux/linux/issues/1141
  depends on $(success,$(OBJCOPY) --version | head -n1 | grep -qv llvm)

tells that the LLVM variant of objcopy (rather than the "usual" GNU variant) won’t convert properly some objects from x86_64 to x86_x32.

So a test is added that depends on the environment to prevent this.

Usual (GNU) objcopy would start like:

$ objcopy --version | head -n1
GNU objcopy (GNU Binutils for Debian) 2.40

LLVM starts like:

$ llvm-objcopy --version | head -n1
llvm-objcopy, compatible with GNU objcopy

success above is a macro defined like this in Linux sources:


if-success = $(shell,{ $(1); } >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")

# $(success,<command>)
# Return y if <command> exits with 0, n otherwise
success = $(if-success,$(1),y,n)

All this gets as result n when using the LLVM variant of objcopy, failing the dependency, and else y (which currently should mean using the GNU variant) when evaluating $(OBJCOPY) --version | head -n1 | grep -qv llvm.

Told otherwise: currently the x86_x32 ABI support can not be obtained when compiling using Clang/LLVM: use GCC instead.

Answered By: A.B
Categories: Answers Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.