Hi Naresh,
On Tue, Jan 25, 2022 at 07:18:16PM +0530, Naresh Kamboju wrote:
Hi Greg,
Regression found on stable-rc 5.4 queue riscv tinyconfig build failed.
Not sure which patch is causing build failures. We will bisect and get back to you.
These should not be recent failures on 5.4, they should have always been there.
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/current LLVM_IAS=1 ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- HOSTCC=clang CC=clang
In file included from /builds/linux/kernel/dma/mapping.c:8: In file included from /builds/linux/include/linux/memblock.h:13: In file included from /builds/linux/include/linux/mm.h:10: In file included from /builds/linux/include/linux/gfp.h:6: In file included from /builds/linux/include/linux/mmzone.h:8: In file included from /builds/linux/include/linux/spinlock.h:51: In file included from /builds/linux/include/linux/preempt.h:78: In file included from ./arch/riscv/include/generated/asm/preempt.h:1: In file included from /builds/linux/include/asm-generic/preempt.h:5: In file included from /builds/linux/include/linux/thread_info.h:22: /builds/linux/arch/riscv/include/asm/current.h:30:9: warning: variable 'tp' is uninitialized when used here [-Wuninitialized] return tp; ^~ /builds/linux/arch/riscv/include/asm/current.h:29:33: note: initialize the variable 'tp' to silence this warning register struct task_struct *tp __asm__("tp"); ^ = NULL
Resolved by commit 52e7c52d2ded ("RISC-V: Stop relying on GCC's register allocator's hueristics").
It had two follow up fixes:
af2bdf828f79 ("RISC-V: stacktrace: Declare sp_in_global outside ifdef") 8356c379cfba ("RISC-V: gp_in_global needs register keyword")
clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
Resolved by commit 7f3d349065d0 ("riscv: Use $(LD) instead of $(CC) to link vDSO"). I don't think that will backport clean but it is not an error so I would not worry about it.
In file included from /builds/linux/arch/riscv/kernel/cpu.c:7: In file included from /builds/linux/include/linux/seq_file.h:8: In file included from /builds/linux/include/linux/mutex.h:14: /builds/linux/arch/riscv/include/asm/current.h:30:9: warning: variable 'tp' is uninitialized when used here [-Wuninitialized] return tp; ^~ /builds/linux/arch/riscv/include/asm/current.h:29:33: note: initialize the variable 'tp' to silence this warning register struct task_struct *tp __asm__("tp"); ^ = NULL 1 warning generated. 1 warning generated. 1 warning generated. 1 warning generated. <instantiation>:1:1: error: unrecognized instruction mnemonic LOCAL _restore_kernel_tpsp ^ /builds/linux/arch/riscv/kernel/entry.S:163:2: note: while in macro instantiation SAVE_ALL ^ <instantiation>:2:2: error: unrecognized instruction mnemonic LOCAL _save_context ^
Should be resolved with commits fdff9911f266 ("RISC-V: Inline the assembly register save/restore macros") and abc71bf0a703 ("RISC-V: Stop using LOCAL for the uaccess fixups").
There might be other issues lurking, I would not say we had decent RISC-V build support with LLVM until maybe 5.10 or so (that is the version that we start testing RISC-V at in our CI).
Cheers, Nathan