From 21a1a5927004787217b19f09e6b113b68f91511e Mon Sep 17 00:00:00 2001 From: Joseph Kogut Date: Sun, 17 May 2020 22:11:12 -0700 Subject: [PATCH] package/alsa-lib: disable versioned symbols only when unsupported Back in commit e90a4bf4af3b6466b2a2d8df12cfe84f5d364cca ("alsa-lib: don't use versioned symbols") from 2009, symbol versioning was disabled in alsa-lib, because it was causing problems with C libraries (such as uClibc) that doesn't support symbol versioning. The thread at http://mailman.alsa-project.org/pipermail/alsa-devel/2009-February/014999.html has some background discussion about this. Essentially, the issue was that alsa-lib in the new version of a given symbol calls into an old version of the same symbol. If your C library has symbol versioning, everything works fine. But if your C library doesn't support symbol versioning, the call from the new symbol into the old symbol will in fact end up in the new symbol, causing an infinite recursion. That problem was solved back then by unconditionally disabling symbol versioning in alsa-lib. However, some libraries such as CEF depend on versioned symbols from alsa-lib, and the build fails during linking with versioning disabled. This patch conditionally disables versioned symbols when unsupported by the toolchain, leaving them enabled otherwise. We assume only glibc has support for symbol versioning. uClibc has no support, and musl has some limited support, so we take the safe route of only enabling symbol versioning for glibc. Signed-off-by: Joseph Kogut Signed-off-by: Thomas Petazzoni --- package/alsa-lib/alsa-lib.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/alsa-lib/alsa-lib.mk b/package/alsa-lib/alsa-lib.mk index c43803f607..b5cd3f0d13 100644 --- a/package/alsa-lib/alsa-lib.mk +++ b/package/alsa-lib/alsa-lib.mk @@ -16,8 +16,11 @@ ALSA_LIB_AUTORECONF = YES ALSA_LIB_CONF_OPTS = \ --with-alsa-devdir=$(call qstrip,$(BR2_PACKAGE_ALSA_LIB_DEVDIR)) \ --with-pcm-plugins="$(call qstrip,$(BR2_PACKAGE_ALSA_LIB_PCM_PLUGINS))" \ - --with-ctl-plugins="$(call qstrip,$(BR2_PACKAGE_ALSA_LIB_CTL_PLUGINS))" \ - --without-versioned + --with-ctl-plugins="$(call qstrip,$(BR2_PACKAGE_ALSA_LIB_CTL_PLUGINS))" + +ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),) +ALSA_LIB_CONF_OPTS += --without-versioned +endif # Can't build with static & shared at the same time (1.0.25+) ifeq ($(BR2_STATIC_LIBS),y)