Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8108aab7 authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Alistair Strachan
Browse files

ANDROID: arm64: add atomic_ll_sc.o to obj-y if using lld

__ll_sc_* functions are only referenced in inline assembly, which means lld
won't see them when CONFIG_LTO_CLANG is enabled due to a bug in LLVM:

  https://bugs.llvm.org/show_bug.cgi?id=35841



When LTO and CONFIG_ARM64_LSE_ATOMICS are both enabled, linking fails with
the following type of errors:

ld.lld: error: relocation R_AARCH64_CALL26 cannot refer to absolute
  symbol: __ll_sc_atomic64_add_return_acquire
>>> defined in vmlinux.o
>>> referenced by atomic_lse.h:299 (arch/arm64/include/asm/atomic_lse.h:299)
>>>               vmlinux.o:(kernel_init_freeable)
...

This change works around the problem by always linking in atomic_ll_sc.o to
vmlinux, instead of placing it in arch/arm64/lib/lib.a.

Bug: 63740206
Bug: 117299373
Bug: 124318741
Bug: 133186739
Change-Id: Idf2211034cce9cb0b6b2007bbdb1dfc1c1a1053d
Signed-off-by: default avatarSami Tolvanen <samitolvanen@google.com>
parent 3bd6dd6a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment