Skip to contentSkip to conversation

alsa-lib: disable libdl for static only builds

PATCH New Lada Trimasova 2 participants 2 messages Jan 20, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 alsa-lib: disable libdl for static only builds

-ldl includes the reference to the library that has the symbols for loading dynamic libraries.
So there is no need for this library for static only builds. Even though alsa-lib uses dlopen, it has functions snd_dlopen and others which can emulate dynamic linking for the static build of the alsa-lib library and there is no need in libdl dlopen when static build only.
This patch fixes build failures of the shairport-sync (and probably other packages) when static libs are used.

Fixes:
http://autobuild.buildroot.net/results/85a/85a3f01bcd4eb2ce7ac480e63b4cc04bf7c8f3e5/

Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
 package/alsa-lib/alsa-lib.mk | 1 +
 1 file changed, 1 insertion(+)
package/alsa-lib/alsa-lib.mk +1 -0
index ea2351c..6a4d14f 100644
@@ -21,6 +21,7 @@ ALSA_LIB_CONF_OPTS = \
 # Can't build with static & shared at the same time (1.0.25+)
 ifeq ($(BR2_STATIC_LIBS),y)
 ALSA_LIB_CONF_OPTS += --enable-shared=no
+ALSA_LIB_CONF_OPTS += --without-libdl
 else
 ALSA_LIB_CONF_OPTS += --enable-static=no
 endif
Signature · 1 line
2.5.0
#1 lore raw

PATCH 1/1 alsa-lib: disable libdl for static only builds

Dear Lada Trimasova,

Quoted 26 lines · Lada Trimasova

-ldl includes the reference to the library that has the symbols for loading dynamic libraries.
So there is no need for this library for static only builds. Even though alsa-lib uses dlopen, it has functions snd_dlopen and others which can emulate dynamic linking for the static build of the alsa-lib library and there is no need in libdl dlopen when static build only.
This patch fixes build failures of the shairport-sync (and probably other packages) when static libs are used.

Fixes:
http://autobuild.buildroot.net/results/85a/85a3f01bcd4eb2ce7ac480e63b4cc04bf7c8f3e5/

Cc Alexey Brodkin <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
---
 package/alsa-lib/alsa-lib.mk | 1 +
 1 file changed, 1 insertion(+)
package/alsa-lib/alsa-lib.mk +0 -0
index ea2351c..6a4d14f 100644

package/alsa-lib/alsa-lib.mk ALSA_LIB_CONF_OPTS = \ · line 24

Quoted 4 lines
package/alsa-lib/alsa-lib.mk +1 -0
@@ -21,6 +21,7 @@ ALSA_LIB_CONF_OPTS = \
 # Can't build with static & shared at the same time (1.0.25+)
 ifeq ($(BR2_STATIC_LIBS),y)
 ALSA_LIB_CONF_OPTS += --enable-shared=no
+ALSA_LIB_CONF_OPTS += --without-libdl

We generally use a single assignment in such cases, so I've changed this to:

ALSA_LIB_CONF_OPTS += \
        --enable-shared=no \
        --without-libdl

and applied your patch. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com