diff options
author | Nathan Chancellor <nathan@kernel.org> | 2021-05-18 22:01:06 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-05-19 14:05:53 +0300 |
commit | 0024430e920f2900654ad83cd081cf52e02a3ef5 (patch) | |
tree | c82f2820b1f474eaca539e113088eee54571f6ee /arch/x86/kernel/sev.c | |
parent | a50c5bebc99c525e7fbc059988c6a5ab8680cb76 (diff) | |
download | linux-0024430e920f2900654ad83cd081cf52e02a3ef5.tar.xz |
x86/build: Fix location of '-plugin-opt=' flags
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.
Shuffle the assignment below the initial one so that the flags are
properly passed along and all of the linker flags stay together.
At the same time, avoid any future issues with clobbering flags by
changing the emulation flag assignment to '+=' since KBUILD_LDFLAGS is
already defined with ':=' in the main Makefile before being exported for
modification here as a result of commit:
ce99d0bf312d ("kbuild: clear LDFLAGS in the top Makefile")
Fixes: b33fff07e3e3 ("x86, build: allow LTO to be selected")
Reported-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Cc: stable@vger.kernel.org
Link: https://github.com/ClangBuiltLinux/linux/issues/1374
Link: https://lore.kernel.org/r/20210518190106.60935-1-nathan@kernel.org
Diffstat (limited to 'arch/x86/kernel/sev.c')
0 files changed, 0 insertions, 0 deletions