On Tue, Oct 22, 2024 at 5:17 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote: > > Hi Andreas, > > On Wed, Jul 17, 2024 at 11:10:14PM +0700, Koakuma wrote: > > This changes the CFLAGS for building the SPARC kernel so that it can be > > built with clang, as a follow up from the discussion in this thread: > > > > https://lore.kernel.org/lkml/JAYB7uS-EdLABTR4iWZdtFOVa5MvlKosIrD_cKTzgeozCOGRM7lhxeLigFB1g3exX445I_W5VKB-tAzl2_G1zCVJRQjp67ODfsSqiZWOZ9o=@protonmail.com/T/#u > ... > > Building with these changes still result in a working kernel, > > at least for Sun T5120, Oracle T4-1, and qemu virtual machines. > > > > On the LLVM side, the effort for building Linux/SPARC is tracked here: > > https://github.com/llvm/llvm-project/issues/40792 > > > > Signed-off-by: Koakuma <koachan@xxxxxxxxxxxxxx> > > --- > > Changes in v2: > > - Remove the -mv8plus change; it will be handled on clang side: > > https://github.com/llvm/llvm-project/pull/98713 > > - Add CLANG_TARGET_FLAGS as suggested in v1 review. > > - Link to v1: https://lore.kernel.org/r/20240620-sparc-cflags-v1-1-bba7d0ff7d42@xxxxxxxxxxxxxx > > > > --- > > Koakuma (2): > > sparc/build: Remove all usage of -fcall-used* flags > > sparc/build: Add SPARC target flags for compiling with clang > > > > arch/sparc/Makefile | 4 ++-- > > arch/sparc/vdso/Makefile | 2 +- > > scripts/Makefile.clang | 1 + > > 3 files changed, 4 insertions(+), 3 deletions(-) > > Would you be able to help move this series [1] and its companion patch > for the vDSO [2] along to Linus for 6.13? If you are not able to for > whatever reason but the changes look reasonable to you, would you be > able to provide an Ack so it can be chauffeured by someone else, such as > Masahiro/Kbuild or Andrew/-mm? > > For the record, I retested these three changes on top of 6.12-rc4, where > they still apply cleanly. Now that the LLVM PR linked above (98713) has > been merged into LLVM main, a clang built straight from llvm-project.git > can build the kernel with this series (I tested at dca43a1c82f1). > > [1]: https://lore.kernel.org/all/20240717-sparc-cflags-v2-0-259407e6eb5f@xxxxxxxxxxxxxx/ > [2]: https://lore.kernel.org/all/20240808-sparc-shr64-v2-1-fd18f1b2cea9@xxxxxxxxxxxxxx/ > > Cheers, > Nathan I applied this patch set, but I still observe a build error. masahiro@zoe:~/workspace/linux-kbuild(kbuild)$ ~/tools/llvm-latest/bin/clang --version ClangBuiltLinux clang version 20.0.0git (https://github.com/llvm/llvm-project.git d1401822e2d2753bed3ac597a42cc0b261de40a4) Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /home/masahiro/tools/llvm-latest/bin masahiro@zoe:~/workspace/linux-kbuild(kbuild)$ make LLVM=~/tools/llvm-latest/bin/ ARCH=sparc sparc64_defconfig all HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/menu.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTCC scripts/kconfig/util.o HOSTLD scripts/kconfig/conf # # configuration written to .config # SYNC include/config/auto.conf.cmd HOSTCC scripts/genksyms/genksyms.o HOSTCC scripts/genksyms/parse.tab.o HOSTCC scripts/genksyms/lex.lex.o HOSTLD scripts/genksyms/genksyms HOSTCC scripts/kallsyms UPD include/generated/compile.h CC scripts/mod/empty.o clang: error: unsupported argument '--undeclared-regs' to option '-Wa,' make[3]: *** [scripts/Makefile.build:229: scripts/mod/empty.o] Error 1 make[2]: *** [Makefile:1208: prepare0] Error 2 make[1]: *** [/home/masahiro/workspace/linux-kbuild/Makefile:347: __build_one_by_one] Error 2 make: *** [Makefile:224: __sub-make] Error 2 -- Best Regards Masahiro Yamada