All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/alsa-lib; fix static build
@ 2021-07-22  5:15 Fabrice Fontaine
  2021-07-24 20:25 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2021-07-22  5:15 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine

Fix the following build failure raised since bump to version 1.2.5.1 in
commit af19131543926879fb6676a3352c63ac0b2038bc:

/home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../src/.libs/libasound.a(control_symbols.o):(.data+0x4): undefined reference to `_snd_module_control_empty'

Fixes:
 - http://autobuild.buildroot.org/results/a8fd791ba4c289cc4fc744a8ff9615bacd9558f3

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...3-control-empty-fix-the-static-build.patch | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/alsa-lib/0003-control-empty-fix-the-static-build.patch

diff --git a/package/alsa-lib/0003-control-empty-fix-the-static-build.patch b/package/alsa-lib/0003-control-empty-fix-the-static-build.patch
new file mode 100644
index 0000000000..3f5013af3a
--- /dev/null
+++ b/package/alsa-lib/0003-control-empty-fix-the-static-build.patch
@@ -0,0 +1,29 @@
+From 81e7923fbfad45b2f353a4d6e3053af51f5f7d0b Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Tue, 15 Jun 2021 23:21:42 +0200
+Subject: [PATCH] control: empty - fix the static build
+
+Reported-by: Jan Palus <atler@pld-linux.org>
+Fixes: https://github.com/alsa-project/alsa-lib/issues/157
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+
+[Retrieved from:
+https://github.com/alsa-project/alsa-lib/commit/81e7923fbfad45b2f353a4d6e3053af51f5f7d0b]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/control/control_empty.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/control/control_empty.c b/src/control/control_empty.c
+index 49d1026c..c9b048c1 100644
+--- a/src/control/control_empty.c
++++ b/src/control/control_empty.c
+@@ -30,7 +30,7 @@
+ 
+ #ifndef PIC
+ /* entry for static linking */
+-const char *_snd_module_ctl_empty = "";
++const char *_snd_module_control_empty = "";
+ #endif
+ 
+ /*! \page control_plugins
-- 
2.30.2

_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/alsa-lib; fix static build
  2021-07-22  5:15 [Buildroot] [PATCH 1/1] package/alsa-lib; fix static build Fabrice Fontaine
@ 2021-07-24 20:25 ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2021-07-24 20:25 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot

On Thu, 22 Jul 2021 07:15:39 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure raised since bump to version 1.2.5.1 in
> commit af19131543926879fb6676a3352c63ac0b2038bc:
> 
> /home/buildroot/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/9.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: ../src/.libs/libasound.a(control_symbols.o):(.data+0x4): undefined reference to `_snd_module_control_empty'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/a8fd791ba4c289cc4fc744a8ff9615bacd9558f3
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...3-control-empty-fix-the-static-build.patch | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 package/alsa-lib/0003-control-empty-fix-the-static-build.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/alsa-lib: fix static build
  2022-01-01 18:36 [Buildroot] [PATCH 1/1] package/alsa-lib: " Fabrice Fontaine
@ 2022-01-01 21:39 ` Yann E. MORIN
  0 siblings, 0 replies; 4+ messages in thread
From: Yann E. MORIN @ 2022-01-01 21:39 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Bernd Kuhls, buildroot

Fabrice, All,

On 2022-01-01 19:36 +0100, Fabrice Fontaine spake thusly:
> Fix the following static build failure with alsa-utils raised since bump
> to version 1.2.6 in commit 4d4a588a504a6446dd0a29a353d94c6e86cfd879:
> 
> checking for snd_tplg_new in -latopology... no
> configure: error: No linkable libatopology was found.
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  ...ser.c-drop-duplicate-safe_strtol_bas.patch | 51 +++++++++++
>  ...-safe_strto-functions-from-libasound.patch | 88 +++++++++++++++++++
>  2 files changed, 139 insertions(+)
>  create mode 100644 package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
>  create mode 100644 package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch
> 
> diff --git a/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch b/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
> new file mode 100644
> index 0000000000..a3741c42c0
> --- /dev/null
> +++ b/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
> @@ -0,0 +1,51 @@
> +From 47252054b4a2d5c8382cb1342f5d4eb89dabf95f Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 1 Jan 2022 17:20:47 +0100
> +Subject: [PATCH] src/topology/parser.c: drop duplicate safe_strtol_base
> +
> +The safe_strtol_base() function is defined twice since
> +	f547b2e3 ("conf: introduce safe_strtol_base()") and
> +	5fab157a ("topology: do not call strtol directly")
> +resulting in the following build failure when alsa-utils is built
> +statically because safe_strtol_base is defined twice.
> +
> +Fixes: http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804
> +Fixes: https://github.com/alsa-project/alsa-lib/pull/207
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> +[Retrieved from:
> +https://github.com/alsa-project/alsa-lib/commit/47252054b4a2d5c8382cb1342f5d4eb89dabf95f]
> +---
> + src/topology/parser.c | 19 -------------------
> + 1 file changed, 19 deletions(-)
> +
> +diff --git a/src/topology/parser.c b/src/topology/parser.c
> +index 01c95afa..e70173f6 100644
> +--- a/src/topology/parser.c
> ++++ b/src/topology/parser.c
> +@@ -21,25 +21,6 @@
> + #include "list.h"
> + #include "tplg_local.h"
> + 
> +-/*
> +- * Safe strtol call
> +- */
> +-int safe_strtol_base(const char *str, long *val, int base)
> +-{
> +-	char *end;
> +-	long v;
> +-	if (!*str)
> +-		return -EINVAL;
> +-	errno = 0;
> +-	v = strtol(str, &end, base);
> +-	if (errno)
> +-		return -errno;
> +-	if (*end)
> +-		return -EINVAL;
> +-	*val = v;
> +-	return 0;
> +-}
> +-
> + /*
> +  * Get integer value
> +  */
> diff --git a/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch b/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch
> new file mode 100644
> index 0000000000..3dfcb78b5c
> --- /dev/null
> +++ b/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch
> @@ -0,0 +1,88 @@
> +From c687c482107f746332dd18f7407f6c6efbffccb2 Mon Sep 17 00:00:00 2001
> +From: Jaroslav Kysela <perex@perex.cz>
> +Date: Sat, 1 Jan 2022 19:18:25 +0100
> +Subject: [PATCH] conf: fix the export of safe_strto* functions from libasound
> +
> +Only one library should define the safe_strto function. Export it
> +correctly and add _snd_ prefix to avoid possible clashes with the other
> +application code.
> +
> +Fixes: 47252054 ("src/topology/parser.c: drop duplicate safe_strtol_base")
> +Fixes: https://github.com/alsa-project/alsa-lib/pull/208
> +Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> +
> +[Retrieved from:
> +https://github.com/alsa-project/alsa-lib/commit/c687c482107f746332dd18f7407f6c6efbffccb2]
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + include/local.h | 8 ++++++--
> + src/Versions.in | 6 ++++++
> + src/conf.c      | 6 +++---
> + 3 files changed, 15 insertions(+), 5 deletions(-)
> +
> +diff --git a/include/local.h b/include/local.h
> +index ebc9350c..f64fe9d8 100644
> +--- a/include/local.h
> ++++ b/include/local.h
> +@@ -232,10 +232,14 @@ size_t page_align(size_t size);
> + size_t page_size(void);
> + size_t page_ptr(size_t object_offset, size_t object_size, size_t *offset, size_t *mmap_offset);
> + 
> +-int safe_strtoll_base(const char *str, long long *val, int base);
> ++#define safe_strtoll_base _snd_safe_strtoll_base
> ++int _snd_safe_strtoll_base(const char *str, long long *val, int base);
> + static inline int safe_strtoll(const char *str, long long *val) { return safe_strtoll_base(str, val, 0); }
> +-int safe_strtol_base(const char *str, long *val, int base);
> ++#define safe_strtol_base _snd_safe_strtol_base
> ++int _snd_safe_strtol_base(const char *str, long *val, int base);
> + static inline int safe_strtol(const char *str, long *val) { return safe_strtol_base(str, val, 0); }
> ++#define safe_strtod _snd_safe_strtod
> ++int _snd_safe_strtod(const char *str, double *val);
> + 
> + int snd_send_fd(int sock, void *data, size_t len, int fd);
> + int snd_receive_fd(int sock, void *data, size_t len, int *fd);
> +diff --git a/src/Versions.in b/src/Versions.in
> +index 5daccbd4..85031b38 100644
> +--- a/src/Versions.in
> ++++ b/src/Versions.in
> +@@ -134,3 +134,9 @@ ALSA_1.1.6 {
> + 
> +     @SYMBOL_PREFIX@snd_dlopen;
> + } ALSA_0.9.7;
> ++
> ++ALSA_1.2.6 {
> ++  global:
> ++
> ++    @SYMBOL_PREFIX@_snd_safe_strto*;
> ++} ALSA_1.1.6;
> +diff --git a/src/conf.c b/src/conf.c
> +index d3597cbc..098ebd63 100644
> +--- a/src/conf.c
> ++++ b/src/conf.c
> +@@ -663,7 +663,7 @@ static int input_stdio_open(snd_input_t **inputp, const char *file,
> + 	return err;
> + }
> + 
> +-int safe_strtoll_base(const char *str, long long *val, int base)
> ++int _snd_safe_strtoll_base(const char *str, long long *val, int base)
> + {
> + 	char *end;
> + 	long v;
> +@@ -679,7 +679,7 @@ int safe_strtoll_base(const char *str, long long *val, int base)
> + 	return 0;
> + }
> + 
> +-int safe_strtol_base(const char *str, long *val, int base)
> ++int _snd_safe_strtol_base(const char *str, long *val, int base)
> + {
> + 	char *end;
> + 	long v;
> +@@ -695,7 +695,7 @@ int safe_strtol_base(const char *str, long *val, int base)
> + 	return 0;
> + }
> + 
> +-static int safe_strtod(const char *str, double *val)
> ++int _snd_safe_strtod(const char *str, double *val)
> + {
> + 	char *end;
> + 	double v;
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] package/alsa-lib: fix static build
@ 2022-01-01 18:36 Fabrice Fontaine
  2022-01-01 21:39 ` Yann E. MORIN
  0 siblings, 1 reply; 4+ messages in thread
From: Fabrice Fontaine @ 2022-01-01 18:36 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, Fabrice Fontaine

Fix the following static build failure with alsa-utils raised since bump
to version 1.2.6 in commit 4d4a588a504a6446dd0a29a353d94c6e86cfd879:

checking for snd_tplg_new in -latopology... no
configure: error: No linkable libatopology was found.

Fixes:
 - http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...ser.c-drop-duplicate-safe_strtol_bas.patch | 51 +++++++++++
 ...-safe_strto-functions-from-libasound.patch | 88 +++++++++++++++++++
 2 files changed, 139 insertions(+)
 create mode 100644 package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
 create mode 100644 package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch

diff --git a/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch b/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
new file mode 100644
index 0000000000..a3741c42c0
--- /dev/null
+++ b/package/alsa-lib/0003-src-topology-parser.c-drop-duplicate-safe_strtol_bas.patch
@@ -0,0 +1,51 @@
+From 47252054b4a2d5c8382cb1342f5d4eb89dabf95f Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 1 Jan 2022 17:20:47 +0100
+Subject: [PATCH] src/topology/parser.c: drop duplicate safe_strtol_base
+
+The safe_strtol_base() function is defined twice since
+	f547b2e3 ("conf: introduce safe_strtol_base()") and
+	5fab157a ("topology: do not call strtol directly")
+resulting in the following build failure when alsa-utils is built
+statically because safe_strtol_base is defined twice.
+
+Fixes: http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804
+Fixes: https://github.com/alsa-project/alsa-lib/pull/207
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+[Retrieved from:
+https://github.com/alsa-project/alsa-lib/commit/47252054b4a2d5c8382cb1342f5d4eb89dabf95f]
+---
+ src/topology/parser.c | 19 -------------------
+ 1 file changed, 19 deletions(-)
+
+diff --git a/src/topology/parser.c b/src/topology/parser.c
+index 01c95afa..e70173f6 100644
+--- a/src/topology/parser.c
++++ b/src/topology/parser.c
+@@ -21,25 +21,6 @@
+ #include "list.h"
+ #include "tplg_local.h"
+ 
+-/*
+- * Safe strtol call
+- */
+-int safe_strtol_base(const char *str, long *val, int base)
+-{
+-	char *end;
+-	long v;
+-	if (!*str)
+-		return -EINVAL;
+-	errno = 0;
+-	v = strtol(str, &end, base);
+-	if (errno)
+-		return -errno;
+-	if (*end)
+-		return -EINVAL;
+-	*val = v;
+-	return 0;
+-}
+-
+ /*
+  * Get integer value
+  */
diff --git a/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch b/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch
new file mode 100644
index 0000000000..3dfcb78b5c
--- /dev/null
+++ b/package/alsa-lib/0004-conf-fix-the-export-of-safe_strto-functions-from-libasound.patch
@@ -0,0 +1,88 @@
+From c687c482107f746332dd18f7407f6c6efbffccb2 Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex@perex.cz>
+Date: Sat, 1 Jan 2022 19:18:25 +0100
+Subject: [PATCH] conf: fix the export of safe_strto* functions from libasound
+
+Only one library should define the safe_strto function. Export it
+correctly and add _snd_ prefix to avoid possible clashes with the other
+application code.
+
+Fixes: 47252054 ("src/topology/parser.c: drop duplicate safe_strtol_base")
+Fixes: https://github.com/alsa-project/alsa-lib/pull/208
+Signed-off-by: Jaroslav Kysela <perex@perex.cz>
+
+[Retrieved from:
+https://github.com/alsa-project/alsa-lib/commit/c687c482107f746332dd18f7407f6c6efbffccb2]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ include/local.h | 8 ++++++--
+ src/Versions.in | 6 ++++++
+ src/conf.c      | 6 +++---
+ 3 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/include/local.h b/include/local.h
+index ebc9350c..f64fe9d8 100644
+--- a/include/local.h
++++ b/include/local.h
+@@ -232,10 +232,14 @@ size_t page_align(size_t size);
+ size_t page_size(void);
+ size_t page_ptr(size_t object_offset, size_t object_size, size_t *offset, size_t *mmap_offset);
+ 
+-int safe_strtoll_base(const char *str, long long *val, int base);
++#define safe_strtoll_base _snd_safe_strtoll_base
++int _snd_safe_strtoll_base(const char *str, long long *val, int base);
+ static inline int safe_strtoll(const char *str, long long *val) { return safe_strtoll_base(str, val, 0); }
+-int safe_strtol_base(const char *str, long *val, int base);
++#define safe_strtol_base _snd_safe_strtol_base
++int _snd_safe_strtol_base(const char *str, long *val, int base);
+ static inline int safe_strtol(const char *str, long *val) { return safe_strtol_base(str, val, 0); }
++#define safe_strtod _snd_safe_strtod
++int _snd_safe_strtod(const char *str, double *val);
+ 
+ int snd_send_fd(int sock, void *data, size_t len, int fd);
+ int snd_receive_fd(int sock, void *data, size_t len, int *fd);
+diff --git a/src/Versions.in b/src/Versions.in
+index 5daccbd4..85031b38 100644
+--- a/src/Versions.in
++++ b/src/Versions.in
+@@ -134,3 +134,9 @@ ALSA_1.1.6 {
+ 
+     @SYMBOL_PREFIX@snd_dlopen;
+ } ALSA_0.9.7;
++
++ALSA_1.2.6 {
++  global:
++
++    @SYMBOL_PREFIX@_snd_safe_strto*;
++} ALSA_1.1.6;
+diff --git a/src/conf.c b/src/conf.c
+index d3597cbc..098ebd63 100644
+--- a/src/conf.c
++++ b/src/conf.c
+@@ -663,7 +663,7 @@ static int input_stdio_open(snd_input_t **inputp, const char *file,
+ 	return err;
+ }
+ 
+-int safe_strtoll_base(const char *str, long long *val, int base)
++int _snd_safe_strtoll_base(const char *str, long long *val, int base)
+ {
+ 	char *end;
+ 	long v;
+@@ -679,7 +679,7 @@ int safe_strtoll_base(const char *str, long long *val, int base)
+ 	return 0;
+ }
+ 
+-int safe_strtol_base(const char *str, long *val, int base)
++int _snd_safe_strtol_base(const char *str, long *val, int base)
+ {
+ 	char *end;
+ 	long v;
+@@ -695,7 +695,7 @@ int safe_strtol_base(const char *str, long *val, int base)
+ 	return 0;
+ }
+ 
+-static int safe_strtod(const char *str, double *val)
++int _snd_safe_strtod(const char *str, double *val)
+ {
+ 	char *end;
+ 	double v;
-- 
2.33.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-01 21:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22  5:15 [Buildroot] [PATCH 1/1] package/alsa-lib; fix static build Fabrice Fontaine
2021-07-24 20:25 ` Thomas Petazzoni
2022-01-01 18:36 [Buildroot] [PATCH 1/1] package/alsa-lib: " Fabrice Fontaine
2022-01-01 21:39 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.