summaryrefslogtreecommitdiffstats
path: root/package/alsa-lib
diff options
context:
space:
mode:
Diffstat (limited to 'package/alsa-lib')
-rw-r--r--package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch (renamed from package/alsa-lib/alsa-lib-avr32-bad-inline.patch)0
-rw-r--r--package/alsa-lib/alsa-lib-0002-no-mmu.patch (renamed from package/alsa-lib/alsa-lib-no-mmu.patch)0
-rw-r--r--package/alsa-lib/alsa-lib-0003-dlmisc.patch57
-rw-r--r--package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch35
4 files changed, 92 insertions, 0 deletions
diff --git a/package/alsa-lib/alsa-lib-avr32-bad-inline.patch b/package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch
index 568ba40a4e..568ba40a4e 100644
--- a/package/alsa-lib/alsa-lib-avr32-bad-inline.patch
+++ b/package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch
diff --git a/package/alsa-lib/alsa-lib-no-mmu.patch b/package/alsa-lib/alsa-lib-0002-no-mmu.patch
index 317676af4c..317676af4c 100644
--- a/package/alsa-lib/alsa-lib-no-mmu.patch
+++ b/package/alsa-lib/alsa-lib-0002-no-mmu.patch
diff --git a/package/alsa-lib/alsa-lib-0003-dlmisc.patch b/package/alsa-lib/alsa-lib-0003-dlmisc.patch
new file mode 100644
index 0000000000..05dc70ee7e
--- /dev/null
+++ b/package/alsa-lib/alsa-lib-0003-dlmisc.patch
@@ -0,0 +1,57 @@
+alsa-lib: provide dummy definitions of RTLD_* if necessary
+
+The FLAT GNU toolchain (e.g. blackfin) doesn't include the dlfcn.h header
+file, so we need to guard that include. Additionally, provide dummy
+definitions for parameters RTLD_GLOBAL / RTLD_NOW which are normally
+provided by dlfcn.h.
+
+Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
+[Thomas: don't add separate dlmisc.h, move dummy defs to global.h]
+Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
+
+diff --git a/include/global.h b/include/global.h
+--- a/include/global.h
++++ b/include/global.h
+@@ -97,6 +97,16 @@ extern struct snd_dlsym_link *snd_dlsym_
+ /** \brief Returns the version of a dynamic symbol as a string. */
+ #define SND_DLSYM_VERSION(version) __STRING(version)
+
++/* RTLD_NOW and RTLD_GLOBAL (used for 'mode' in snd_dlopen) are not defined
++ * on all arches (e.g. blackfin), so provide a dummy definition here. */
++#ifndef RTLD_NOW
++#define RTLD_NOW 0
++#endif
++
++#ifndef RTLD_GLOBAL
++#define RTLD_GLOBAL 0
++#endif
++
+ void *snd_dlopen(const char *file, int mode);
+ void *snd_dlsym(void *handle, const char *name, const char *version);
+ int snd_dlclose(void *handle);
+diff --git a/modules/mixer/simple/sbasedl.c b/modules/mixer/simple/sbasedl.c
+--- a/modules/mixer/simple/sbasedl.c
++++ b/modules/mixer/simple/sbasedl.c
+@@ -27,7 +27,9 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <math.h>
++#ifdef HAVE_LIBDL
+ #include <dlfcn.h>
++#endif
+ #include "config.h"
+ #include "asoundlib.h"
+ #include "mixer_abst.h"
+diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c
+--- a/src/mixer/simple_abst.c
++++ b/src/mixer/simple_abst.c
+@@ -34,7 +34,9 @@
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+ #include <math.h>
++#ifdef HAVE_LIBDL
+ #include <dlfcn.h>
++#endif
+ #include "config.h"
+ #include "asoundlib.h"
+ #include "mixer_simple.h"
diff --git a/package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch b/package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch
new file mode 100644
index 0000000000..c533419baa
--- /dev/null
+++ b/package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch
@@ -0,0 +1,35 @@
+alsa-lib: conditionally enable libdl in AM_PATH_ALSA m4 macro
+
+The AM_PATH_ALSA macro in utils/alsa.m4 unconditionally uses -ldl. This
+breaks compilation of alsa-utils (and probably other packages using this
+macro) for targets that do not support dynamic loading, such as for
+Blackfin FLAT binaries.
+
+This patch updates the macro to check if dlopen is available, and use that
+result to conditionally add -ldl to the list of libraries.
+
+Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
+
+---
+
+diff --git a/utils/alsa.m4 b/utils/alsa.m4
+--- a/utils/alsa.m4
++++ b/utils/alsa.m4
+@@ -44,6 +44,8 @@ if test "$alsa_inc_prefix" != "" ; then
+ fi
+ AC_MSG_RESULT($ALSA_CFLAGS)
+
++AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
++
+ dnl add any special lib dirs
+ AC_MSG_CHECKING(for ALSA LDFLAGS)
+ if test "$alsa_prefix" != "" ; then
+@@ -52,7 +54,7 @@ if test "$alsa_prefix" != "" ; then
+ fi
+
+ dnl add the alsa library
+-ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
++ALSA_LIBS="$ALSA_LIBS -lasound -lm $LIBDL -lpthread"
+ LIBS="$ALSA_LIBS $LIBS"
+ AC_MSG_RESULT($ALSA_LIBS)
+
OpenPOWER on IntegriCloud