Skip to contentSkip to conversation

package/alsa-utils: re-enable in BR2_STATIC_LIBS configuration

PATCH New Thomas Petazzoni 2 participants 6 messages Nov 1, 2018 – Nov 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/alsa-utils: re-enable in BR2_STATIC_LIBS configuration

In commit 4707383c5d501a9ad7698579e5d0a4e2ab758c7e ("alsa-utils: needs dynamic library support"), we added a !BR2_STATIC_LIBS dependency because topology/topology.c was including <dlfcn.h>.

However, it turns out that this include is not needed/used at all, so we can instead drop it, and re-enable the package in BR2_STATIC_LIBS configuration.

This was discovered when analyzing why we have package/alsa-lib/0003-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch. This patch fixes the AM_PATH_ALSA autoconf macro, used by alsa-utils, so
that ALSA_LIBS doesn't carry the -ldl option, fixing static-linking scenarios. This patch had become useless since alsa-utils was no
longer available in BR2_STATIC_LIBS configuration.

---
 ...-topology.c-drop-unneeded-dlfcn.h-include.patch | 29 ++++++++++++++++++++++
 package/alsa-utils/Config.in                       |  5 ++--
 2 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 package/alsa-utils/0001-topology-topology.c-drop-unneeded-dlfcn.h-include.patch
package/alsa-utils/0001-topology-topology.c-drop-unneeded-dlfcn.h-include.patch new file +29 -0
new file mode 100644
index 0000000000..2a8be0b0b7
@@ -0,0 +1,29 @@
+From 4c9462a5ef2f680b24ddf6bae7ac7c693fa6a136 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Thu, 1 Nov 2018 15:15:31 +0100
+Subject: [PATCH] topology/topology.c: drop unneeded <dlfcn.h> include
+
+This include is not used/needed and prevents building on systems that
+don't provide <dlfcn.h>.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+Upstream: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-November/141375.html
+---
+ topology/topology.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/topology/topology.c b/topology/topology.c
+index 097c255..b72e341 100644
+--- a/topology/topology.c
++++ b/topology/topology.c
+@@ -27,7 +27,6 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <sys/stat.h>
+-#include <dlfcn.h>
+ #include <getopt.h>
+ #include <assert.h>
+ 
+-- 
+2.14.4
+
package/alsa-utils/Config.in +2 -3
index edf5d39f26..012f28aef4 100644
@@ -1,12 +1,11 @@
-comment "alsa-utils needs a toolchain w/ threads, dynamic library"
+comment "alsa-utils needs a toolchain w/ threads"
 	depends on BR2_USE_MMU # fork
-	depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 menuconfig BR2_PACKAGE_ALSA_UTILS
 	bool "alsa-utils"
 	depends on BR2_USE_MMU # fork
 	depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
-	depends on !BR2_STATIC_LIBS # uses dlfcn.h
 	select BR2_PACKAGE_ALSA_LIB
 	help
 	  This package contains the command line utilities for the ALSA
Signature · 1 line
2.14.4
#1 lore raw

PATCH 2/3 package/alsa-lib: drop patch 0002-alsa-lib-provide-dummy-definitions-of-RTLD_-if-neces.patch

The description of this patch was no longer correct: it no longer provided dummy definitions of RTLD_* macros since commit ccad7db515fa79d2331e4e949aafb32eca0b5214 ("alsa-lib: bump to version 1.1.6"). All it did is make two <dlfcn.h> inclusions optional.

However, this is no longer needed, since the alsa-lib code base contains four inclusions of <dlfcn.h>, which are all properly handled:

- include/local.h, the include is guarded by #ifdef HAVE_LIBDL

- modules/mixer/simple/sbasedl.c, modules are only built if BUILD_MODULES is enabled, and BUILD_MODULES is only enabled if HAVE_LIBDL is enabled

- src/mixer/simple_abst.c, this file is only built if BUILD_MODULES is enabled, which itself is only enabled if HAVE_LIBDL is enabled

- src/pcm/pcm_meter.c, this file is only built if BUILD_PCM_PLUGIN_METER is enabled, and this is not enabled if HAVE_LIBDL is not enabled.

Conclusion: the patch can be dropped. The third patch is renumbered as appropriate.

---
 ...ditionally-enable-libdl-in-AM_PATH_ALSA-.patch} |  0
 ...ovide-dummy-definitions-of-RTLD_-if-neces.patch | 57 ----------------------
 2 files changed, 57 deletions(-)
 rename package/alsa-lib/{0003-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch => 0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch} (100%)
 delete mode 100644 package/alsa-lib/0002-alsa-lib-provide-dummy-definitions-of-RTLD_-if-neces.patch
package/alsa-lib/0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch renamed from package/alsa-lib/0003-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch +0 -0
similarity index 100%
rename from package/alsa-lib/0003-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch
rename to package/alsa-lib/0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch
package/alsa-lib/0002-alsa-lib-provide-dummy-definitions-of-RTLD_-if-neces.patch deleted +0 -57

57 lines not on this page · raw message

Signature · 1 line
2.14.4
#3 lore raw

PATCH 3/3 package/alsa-lib: update upstream status of patches

In reply to Thomas Petazzoni

The remaining two patches have been submitted upstream for inclusion, so let's update their upstream status.

While at it, I update @free-electrons.com to @bootlin.com in the first patch.

---
 package/alsa-lib/0001-Don-t-use-fork-on-noMMU-platforms.patch        | 5 +++--
 .../0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch  | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)
package/alsa-lib/0001-Don-t-use-fork-on-noMMU-platforms.patch +3 -2
index 29cdf8fed8..5bf9dd2057 100644
@@ -1,14 +1,15 @@
 From 41c029755502acf01ed634db437ac06d09be6c41 Mon Sep 17 00:00:00 2001
-From: Thomas Petazzoni <[email protected]>
+From: Thomas Petazzoni <[email protected]>
 Date: Fri, 13 Apr 2018 09:02:37 +0200
 Subject: [PATCH] Don't use fork() on noMMU platforms
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
 
-Signed-off-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Thomas Petazzoni <[email protected]>
 [J?rg: update patch for 1.1.6]
 Signed-off-by: J?rg Krause <[email protected]>
+Upstream: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-November/141376.html
 ---
  configure.ac         |  2 ++
  src/pcm/pcm_direct.c | 10 +++++++++-
package/alsa-lib/0002-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch +1 -0
index 181e56deb4..3aab64e5e8 100644
@@ -17,6 +17,7 @@ result to conditionally add -ldl to the list of libraries.
 Signed-off-by: Thomas De Schampheleire <[email protected]>
 [J?rg: update for 1.1.6]
 Signed-off-by: J?rg Krause <[email protected]>
+Upstream: http://mailman.alsa-project.org/pipermail/alsa-devel/2018-November/141377.html
 ---
  utils/alsa.m4 | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.14.4
#5 lore raw

PATCH 1/3 package/alsa-utils: re-enable in BR2_STATIC_LIBS configuration

In reply to Thomas Petazzoni
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

In commit 4707383c5d501a9ad7698579e5d0a4e2ab758c7e ("alsa-utils: needs dynamic library support"), we added a !BR2_STATIC_LIBS dependency because topology/topology.c was including <dlfcn.h>.

However, it turns out that this include is not needed/used at all, so we can instead drop it, and re-enable the package in BR2_STATIC_LIBS configuration.

Quoted 8 lines

This was discovered when analyzing why we have package/alsa-lib/0003-alsa-lib-conditionally-enable-libdl-in-AM_PATH_ALSA-.patch. This patch fixes the AM_PATH_ALSA autoconf macro, used by alsa-utils, so
that ALSA_LIBS doesn't carry the -ldl option, fixing static-linking scenarios. This patch had become useless since alsa-utils was no
longer available in BR2_STATIC_LIBS configuration.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 2/3 package/alsa-lib: drop patch 0002-alsa-lib-provide-dummy-definitions-of-RTLD_-if-neces.patch

In reply to Thomas Petazzoni
Quoted 19 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The description of this patch was no longer correct: it no longer provided dummy definitions of RTLD_* macros since commit ccad7db515fa79d2331e4e949aafb32eca0b5214 ("alsa-lib: bump to version 1.1.6"). All it did is make two <dlfcn.h> inclusions optional.

However, this is no longer needed, since the alsa-lib code base contains four inclusions of <dlfcn.h>, which are all properly handled:

- include/local.h, the include is guarded by #ifdef HAVE_LIBDL

- modules/mixer/simple/sbasedl.c, modules are only built if BUILD_MODULES is enabled, and BUILD_MODULES is only enabled if HAVE_LIBDL is enabled

- src/mixer/simple_abst.c, this file is only built if BUILD_MODULES is enabled, which itself is only enabled if HAVE_LIBDL is enabled

Quoted 8 lines

- src/pcm/pcm_meter.c, this file is only built if BUILD_PCM_PLUGIN_METER is enabled, and this is not enabled if HAVE_LIBDL is not enabled.

Conclusion: the patch can be dropped. The third patch is renumbered as appropriate.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 3/3 package/alsa-lib: update upstream status of patches

In reply to Thomas Petazzoni
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

The remaining two patches have been submitted upstream for inclusion, so let's update their upstream status.

While at it, I update @free-electrons.com to @bootlin.com in the first patch.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard