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:Sami Tolvanen <samitolvanen@google.com>
Loading
Please register or sign in to comment