0003-dlmisc.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. alsa-lib: provide dummy definitions of RTLD_* if necessary
  2. The FLAT GNU toolchain (e.g. blackfin) doesn't include the dlfcn.h header
  3. file, so we need to guard that include. Additionally, provide dummy
  4. definitions for parameters RTLD_GLOBAL / RTLD_NOW which are normally
  5. provided by dlfcn.h.
  6. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
  7. [Thomas: don't add separate dlmisc.h, move dummy defs to global.h]
  8. Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
  9. diff --git a/include/global.h b/include/global.h
  10. --- a/include/global.h
  11. +++ b/include/global.h
  12. @@ -97,6 +97,16 @@ extern struct snd_dlsym_link *snd_dlsym_
  13. /** \brief Returns the version of a dynamic symbol as a string. */
  14. #define SND_DLSYM_VERSION(version) __STRING(version)
  15. +/* RTLD_NOW and RTLD_GLOBAL (used for 'mode' in snd_dlopen) are not defined
  16. + * on all arches (e.g. blackfin), so provide a dummy definition here. */
  17. +#ifndef RTLD_NOW
  18. +#define RTLD_NOW 0
  19. +#endif
  20. +
  21. +#ifndef RTLD_GLOBAL
  22. +#define RTLD_GLOBAL 0
  23. +#endif
  24. +
  25. void *snd_dlopen(const char *file, int mode);
  26. void *snd_dlsym(void *handle, const char *name, const char *version);
  27. int snd_dlclose(void *handle);
  28. diff --git a/modules/mixer/simple/sbasedl.c b/modules/mixer/simple/sbasedl.c
  29. --- a/modules/mixer/simple/sbasedl.c
  30. +++ b/modules/mixer/simple/sbasedl.c
  31. @@ -27,7 +27,9 @@
  32. #include <fcntl.h>
  33. #include <sys/ioctl.h>
  34. #include <math.h>
  35. +#include "config.h"
  36. +#ifdef HAVE_DLFCN
  37. #include <dlfcn.h>
  38. +#endif
  39. -#include "config.h"
  40. #include "asoundlib.h"
  41. #include "mixer_abst.h"
  42. diff --git a/src/mixer/simple_abst.c b/src/mixer/simple_abst.c
  43. --- a/src/mixer/simple_abst.c
  44. +++ b/src/mixer/simple_abst.c
  45. @@ -34,7 +34,9 @@
  46. #include <fcntl.h>
  47. #include <sys/ioctl.h>
  48. #include <math.h>
  49. +#include "config.h"
  50. +#ifdef HAVE_DLFCN
  51. #include <dlfcn.h>
  52. +#endif
  53. -#include "config.h"
  54. #include "asoundlib.h"
  55. #include "mixer_simple.h"