Skip to content

Commit

Permalink
kbuild: clang: Support building UM with SUBARCH=i386
Browse files Browse the repository at this point in the history
The UM builds distinguish i386 from x86_64 via SUBARCH, but we don't
support building i386 directly with Clang. To make SUBARCH work for
i386 UM, we need to explicitly test for it.

This lets me run i386 KUnit tests with Clang:

$ ./tools/testing/kunit/kunit.py run \
	--make_options LLVM=1 \
	--make_options SUBARCH=i386
...

Fixes: c7500c1 ("um: Allow builds with Clang")
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: David Gow <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
kees committed Mar 4, 2025
1 parent d73ef9e commit a3aac12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/Makefile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ CLANG_TARGET_FLAGS_riscv := riscv64-linux-gnu
CLANG_TARGET_FLAGS_s390 := s390x-linux-gnu
CLANG_TARGET_FLAGS_sparc := sparc64-linux-gnu
CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu
# This is only for i386 UM builds, which need the 32-bit target not -m32
CLANG_TARGET_FLAGS_i386 := i386-linux-gnu
CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH))
CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH))

Expand Down

0 comments on commit a3aac12

Please sign in to comment.