linux/arch
Nathan Chancellor e44e1f38be UPSTREAM: x86/build: Fix location of '-plugin-opt=' flags
Commit b33fff07e3 ("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:

  ce99d0bf31 ("kbuild: clear LDFLAGS in the top Makefile")

Fixes: b33fff07e3 ("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
(cherry picked from commit 0024430e92)
Bug: 187129171
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: I9f9c056829483f341251cc7407d0029c05e8b503
2021-06-10 20:26:52 -07:00
..
alpha BACKPORT: FROMGIT: mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() 2021-06-07 20:38:48 +00:00
arc ARC: mm: Use max_high_pfn as a HIGHMEM zone border 2021-05-19 10:13:10 +02:00
arm Revert "Revert "clocksource/drivers/timer-ti-dm: Handle dra7 timer wrap errata i940"" 2021-06-04 11:15:17 -07:00
arm64 UPSTREAM: KVM: arm64: Fix error return code in init_hyp_mode() 2021-06-10 20:26:43 -07:00
c6x
csky Merge 5.10.33 into android12-5.10 2021-04-29 13:57:47 +02:00
h8300 Merge 5.10.17 into android12-5.10 2021-02-18 11:21:01 +01:00
hexagon
ia64 BACKPORT: FROMGIT: mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() 2021-06-07 20:38:48 +00:00
m68k BACKPORT: FROMGIT: mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() 2021-06-07 20:38:48 +00:00
microblaze
mips Merge 5.10.42 into android12-5.10 2021-06-03 18:47:38 +02:00
nds32 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-14 08:41:58 +02:00
nios2 nios2: fixed broken sys_clone syscall 2021-03-04 11:38:16 +01:00
openrisc openrisc: Define memory barrier mb 2021-06-03 09:00:44 +02:00
parisc UPSTREAM: parisc: select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY 2021-06-10 20:26:03 -07:00
powerpc Merge 5.10.40 into android12-5.10 2021-05-27 08:36:46 +02:00
riscv This is the 5.10.39 stable release 2021-05-22 15:34:48 +02:00
s390 BACKPORT: FROMGIT: mm: arch: remove indirection level in alloc_zeroed_user_highpage_movable() 2021-06-07 20:38:48 +00:00
sh BACKPORT: FROMGIT: hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share() 2021-04-09 15:35:58 -07:00
sparc BACKPORT: FROMGIT: hugetlb: pass vma into huge_pte_alloc() and huge_pmd_share() 2021-04-09 15:35:58 -07:00
um This is the 5.10.39 stable release 2021-05-22 15:34:48 +02:00
x86 UPSTREAM: x86/build: Fix location of '-plugin-opt=' flags 2021-06-10 20:26:52 -07:00
xtensa Merge 5.10.28 into android12-5.10 2021-04-09 09:29:17 +02:00
.gitignore
Kconfig ANDROID: Allow HAS_LTO_CLANG with KASAN_HW_TAGS 2021-03-06 01:39:52 +00:00