Skip to contentSkip to conversation

bluez: Fix linking with lld linker

PATCH New Khem Raj 1 participant 1 message Apr 13

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 bluez: Fix linking with lld linker

Recent upgrades have been breaking with LLD as linker

aarch64-yoe-linux-ld.lld: error: undefined symbol: __stop___debug

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

referenced by log.c:0 (/usr/src/debug/bluez5/5.86/../sources/bluez-5.86/src/log.c:0)

              src/log.o:(__btd_log_init)
referenced by log.c:0 (/usr/src/debug/bluez5/5.86/../sources/bluez-5.86/src/log.c:0)
              src/log.o:(__btd_log_init)

This is described in LLD docs as well [1]

[1] https://lld.llvm.org/ELF/start-stop-gc

---
 meta/recipes-connectivity/bluez5/bluez5_5.86.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-connectivity/bluez5/bluez5_5.86.bb +2 -0
index 7f9972f59e..2d56fc642d 100644
@@ -1,5 +1,7 @@
 require bluez5.inc
 
+LDFLAGS += " ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-lld', '-Wl,-z,nostart-stop-gc', '', d)}"
+
 SRC_URI[sha256sum] = "99f144540c6070591e4c53bcb977eb42664c62b7b36cb35a29cf72ded339621d"
 
 CVE_STATUS[CVE-2020-24490] = "cpe-incorrect: This issue has kernel fixes rather than bluez fixes"