On Thu, Feb 16, 2023 at 1:02 PM Barry barry@barrys-emacs.org wrote:
On 16 Feb 2023, at 17:18, Chung Chung ctwo0002@gmail.com wrote:
Hi, I am wondering if anyone has successfully compiled latest kernel using clang, I have been having problem with it for the last few month, and here is the error that I have:
In file included from drivers/tty/tty_io.c:103: ./include/linux/termios_internal.h:37:5: error: conflicting types for 'user_termio_to_kernel_termios' int user_termio_to_kernel_termios(struct ktermios *, struct termio __user *); ^ ./include/asm-generic/termios.h:20:19: note: previous definition is here static inline int user_termio_to_kernel_termios(struct ktermios *termios,
Sorry, if it has been discussed before, but I don't seem to find the answer.
I am not sure if clang, llvm, is supported for the linux kernel. Maybe someone else here can comment.
I do know that there are people working on getting it working.
Using gcc will work as that is supported.
I think the LLVM devs presented results of compiling the kernel several years ago. I don't recall the link to the talk, though.
I think some of the kernel devs are the biggest problem. Some of the developers feel GCC is the only compiler to support. They rely on GCC-isms, and don't care about things like undefined behavior since it "works for me using GCC." I've even had some of the devs tell me they don't care about the C standard. That was very befuddling to me.
Jeff