On Tue, 18 May 2021 12:01:06 -0700, Nathan Chancellor wrote:
Commit b33fff07e3e3 ("x86, build: allow LTO to be selected") added a couple of '-plugin-opt=' flags to KBUILD_LDFLAGS because the code model and stack alignment are not stored in LLVM bitcode. However, these flags were added to KBUILD_LDFLAGS prior to the emulation flag assignment, which uses ':=', so they were overwritten and never added to $(LD) invocations. The absence of these flags caused misalignment issues in the AMDGPU driver when compiling with CONFIG_LTO_CLANG, resulting in general protection faults.
[...]
(I've slightly adjusted the title.)
Applied to for-next/clang/features, thanks!
[1/1] x86: lto: Fix location of '-plugin-opt=' flags https://git.kernel.org/kees/c/5d6c8592ee5f