Skip to contentSkip to conversation

alsa-lib/alsa-utils: autobuild fixes

PATCH New Thomas De Schampheleire 3 participants 8 messages Feb 23, 2014

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/1 alsa-lib: add sequence number to existing patches

---

package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch renamed from package/alsa-lib/alsa-lib-avr32-bad-inline.patch +0 -0
rename from package/alsa-lib/alsa-lib-avr32-bad-inline.patch
rename to package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch
package/alsa-lib/alsa-lib-0002-no-mmu.patch renamed from package/alsa-lib/alsa-lib-no-mmu.patch +0 -0
rename from package/alsa-lib/alsa-lib-no-mmu.patch
rename to package/alsa-lib/alsa-lib-0002-no-mmu.patch
#2 lore raw

PATCH v2 1/1 alsa-lib: add sequence number to existing patches

Dear Thomas De Schampheleire,

package/alsa-lib/alsa-lib-0002-no-mmu.patch

Quoted 10 lines · Thomas De Schampheleire

---

package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch renamed from package/alsa-lib/alsa-lib-avr32-bad-inline.patch +0 -0
rename from package/alsa-lib/alsa-lib-avr32-bad-inline.patch
rename to package/alsa-lib/alsa-lib-0001-avr32-bad-inline.patch
package/alsa-lib/alsa-lib-0002-no-mmu.patch renamed from package/alsa-lib/alsa-lib-no-mmu.patch +0 -0
rename from package/alsa-lib/alsa-lib-no-mmu.patch
rename to package/alsa-lib/alsa-lib-0002-no-mmu.patch
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH v2 1/1 alsa-lib: fix build when dynamic load is not supported (e.g. blackfin FLAT)

In reply to Thomas De Schampheleire

The FLAT GNU toolchain doesn't include the dlfcn.h header file. Provide the necessary declarations (RTLD_*) to make alsa-lib happy.

Fixes
http://autobuild.buildroot.org/results/706/7069e1f43cbed745d65f7dd9904a3fff034530ac/build-end.log

[Thomas: change sequence number from 003 to 0003, update patch and commit
message ]

---
 package/alsa-lib/alsa-lib-0003-dlmisc.patch |  57 +++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)
package/alsa-lib/alsa-lib-0003-dlmisc.patch new file +57 -0
new file mode 100644
@@ -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 <[email protected]>
+[Thomas: don't add separate dlmisc.h, move dummy defs to global.h]
+Signed-off-by: Thomas De Schampheleire <[email protected]>
+
+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"
#4 lore raw

PATCH v2 1/1 alsa-lib: add patch to remove hardcoded -ldl

In reply to Thomas De Schampheleire

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.

Fixes
http://autobuild.buildroot.org/results/de2/de286880973be956f6c504aa9a758171d6f49674/build-end.log

---
 package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch |  35 ++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
package/alsa-lib/alsa-lib-0004-conditional-enabling-of-libdl-in-m4.patch new file +35 -0
new file mode 100644
@@ -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 <[email protected]>
+
+---
+
+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)
+ 
#5 lore raw

PATCH v2 1/1 alsa-utils: disable on no-mmu platforms (fork)

In reply to Thomas De Schampheleire

alsa-utils uses fork which is not available on targets without MMU support. It seems to be possible to replace fork with vfork in alsa-utils, but we do not like to carry such patches in buildroot without them being accepted upstream.

Fixes
http://autobuild.buildroot.org/results/9f8/9f8e572c9f1c677155cc7d1828371bcf572ff878

---
 package/alsa-utils/Config.in |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
package/alsa-utils/Config.in +2 -0
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_ALSA_UTILS
 	bool "alsa-utils"
+	depends on BR2_USE_MMU # fork
 	depends on BR2_LARGEFILE
 	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
 	select BR2_PACKAGE_ALSA_LIB
@@ -10,6 +11,7 @@ config BR2_PACKAGE_ALSA_UTILS
 	  http://www.alsa-project.org/
 
 comment "alsa-utils needs a toolchain w/ largefile, threads"
+	depends on BR2_USE_MMU # fork
 	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
 
 if BR2_PACKAGE_ALSA_UTILS
#6 lore raw

PATCH v2 1/1 alsa-utils/Config.in: move comment to top, to fix nesting of config options

In reply to Thomas De Schampheleire

To allow proper nesting of suboptions of a package, the suboptions should come directly after the main option, and cannot be interleaved with a comment.

---
 package/alsa-utils/Config.in |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
package/alsa-utils/Config.in +4 -4
@@ -1,3 +1,7 @@
+comment "alsa-utils needs a toolchain w/ largefile, threads"
+	depends on BR2_USE_MMU # fork
+	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
+
 config BR2_PACKAGE_ALSA_UTILS
 	bool "alsa-utils"
 	depends on BR2_USE_MMU # fork
@@ -10,10 +14,6 @@ config BR2_PACKAGE_ALSA_UTILS
 
 	  http://www.alsa-project.org/
 
-comment "alsa-utils needs a toolchain w/ largefile, threads"
-	depends on BR2_USE_MMU # fork
-	depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
-
 if BR2_PACKAGE_ALSA_UTILS
 menu "ALSA utils selection"
 
#7 lore raw

PATCH v2 1/1 alsa-lib/alsa-utils: autobuild fixes

In reply to Thomas De Schampheleire
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas De Schampheleire <[email protected]> writes:

v2: disable alsa-utils on no-mmu instead of trying to use vfork

---
Note: after 2014.02, I take the action to send the patches upstream.

Committed series, thanks!

Signature · 1 line
Bye, Peter Korsgaard