Hi!
On Wed, Nov 06, 2024 at 08:21:14AM -0700, Nathan Chancellor wrote:
(r2 is the default for -m32, r13 is the default for -m64, it appears that clang does not implement this option at all, it simply checks if you set the default, and explodes if not).
Not sure that I would say it has not been implemented correctly, more that it has not been implemented in the same manner as GCC. Keith chose not to open up support for arbitrary registers to keep the implementation of this option in LLVM simple:
LLVM claims to be compatible to GCC. It is not. This is a bug. As it is, LLVM can not be used to compile the PowerPC kernel.
These flags (-mstack-protector-guard-{reg,offset}=) are there *specifically* so that the user can choose to use something different from the default. I added this (back in 2017) because the kernel needed it. Some other GCC ports (aarch64, arm, riscv, x86) have followed suit since then, btw.
Segher