From 93c179932a1a282bb56823ee202e387ced41f388 Mon Sep 17 00:00:00 2001 From: Max Krummenacher Date: Mon, 7 Sep 2020 15:57:36 +0200 Subject: bluez-alsa: fix linking with gcc 10 GCC 10 by default compiles with -fno-common which results in linker erros. | ld: bluez-a2dp.o:...git/src/bluez-a2dp.h:20: multiple definition of `bluez_a2dp_sbc'; .../git/src/bluez-a2dp.h:20: first defined here | ld: bluez-iface.o:...git/src/bluez-iface.h:17: multiple definition of `bluez_iface_profile'; .../git/src/bluez-iface.h:17: first defined here | ld: bluez-iface.o:...git/src/bluez-iface.h:16: multiple definition of `bluez_iface_endpoint'; .../git/src/bluez-iface.h:16: first defined here Declare with 'extern' fixes the linkage. Signed-off-by: Max Krummenacher --- recipes-connectivity/bluez-alsa/bluez-alsa_git.bb | 16 ++++-- ...-linkage-mark-external-variable-as-extern.patch | 65 ++++++++++++++++++++++ 2 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch diff --git a/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb b/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb index 6025981..085792d 100644 --- a/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb +++ b/recipes-connectivity/bluez-alsa/bluez-alsa_git.bb @@ -5,7 +5,11 @@ SECTION = "libs" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=bb3e99e80c5d718213f35ae1def4c106" -SRC_URI = "git://github.com/Arkq/bluez-alsa.git;protocol=https;branch=master" +SRC_URI = " \ + git://github.com/Arkq/bluez-alsa.git;protocol=https;branch=master \ + file://0001-Fix-linkage-mark-external-variable-as-extern.patch \ +" + SRCREV = "9045edb436ea755f395a2e09e4525b5defad286a" SRC_URI += "file://bluez-alsa.service" @@ -32,12 +36,12 @@ do_install_append () { } FILES_${PN} += "\ - ${datadir}/alsa/alsa.conf.d/20-bluealsa.conf\ - ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.so\ - ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.so\ + ${datadir}/alsa/alsa.conf.d/20-bluealsa.conf\ + ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.so\ + ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.so\ " FILES_${PN}-staticdev += "\ - ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.a\ - ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.a\ + ${libdir}/alsa-lib/libasound_module_ctl_bluealsa.a\ + ${libdir}/alsa-lib/libasound_module_pcm_bluealsa.a\ " diff --git a/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch b/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch new file mode 100644 index 0000000..d366e18 --- /dev/null +++ b/recipes-connectivity/bluez-alsa/files/0001-Fix-linkage-mark-external-variable-as-extern.patch @@ -0,0 +1,65 @@ +From 3b7b70fbb70131adf0c0451c95b9a5313ddc8e53 Mon Sep 17 00:00:00 2001 +From: Arkadiusz Bokowy +Date: Sun, 9 Feb 2020 22:26:16 +0100 +Subject: [PATCH] Fix linkage - mark external variable as extern + +(cherry picked from commit 30a23dd7ce9b00c702fa48545f6b03038f9e17c6) + +Conflicts: + src/bluealsa-iface.h + src/bluez-a2dp.h + src/bluez-iface.h + src/ofono-iface.h + test/server-mock.c + test/test-ba.c + test/test-io.c + test/test-rfcomm.c + +Upstream-Status: Backport [master after tag v2.1.0] +Signed-off-by: Max Krummenacher +--- + src/bluez-a2dp.h | 8 ++++---- + src/bluez-iface.h | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/src/bluez-a2dp.h b/src/bluez-a2dp.h +index 4826a6f..715fd89 100644 +--- a/src/bluez-a2dp.h ++++ b/src/bluez-a2dp.h +@@ -17,15 +17,15 @@ + + #include "a2dp-codecs.h" + +-const a2dp_sbc_t bluez_a2dp_sbc; ++extern const a2dp_sbc_t bluez_a2dp_sbc; + #if ENABLE_MP3 +-const a2dp_mpeg_t bluez_a2dp_mpeg; ++extern const a2dp_mpeg_t bluez_a2dp_mpeg; + #endif + #if ENABLE_AAC +-const a2dp_aac_t bluez_a2dp_aac; ++extern const a2dp_aac_t bluez_a2dp_aac; + #endif + #if ENABLE_APTX +-const a2dp_aptx_t bluez_a2dp_aptx; ++extern const a2dp_aptx_t bluez_a2dp_aptx; + #endif + + #endif +diff --git a/src/bluez-iface.h b/src/bluez-iface.h +index 7d61638..a86a1bd 100644 +--- a/src/bluez-iface.h ++++ b/src/bluez-iface.h +@@ -13,7 +13,7 @@ + + #include + +-const GDBusInterfaceInfo bluez_iface_endpoint; +-const GDBusInterfaceInfo bluez_iface_profile; ++extern const GDBusInterfaceInfo bluez_iface_endpoint; ++extern const GDBusInterfaceInfo bluez_iface_profile; + + #endif +-- +2.20.1 + -- cgit v1.2.3