Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency
@ 2017-08-11 21:21 Thomas Petazzoni
  2017-08-11 21:21 ` [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib" Thomas Petazzoni
  2017-08-12 10:00 ` [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Yann E. MORIN
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2017-08-11 21:21 UTC (permalink / raw)
  To: buildroot

This commit adds a patch to alsa-lib that fixes an incorrect code
dependency: some code built when MIDI support is enabled is
unconditionally referencing code that is built when SEQ support is
enabled, both options being independent.

This causes build failures such as:

/home/buildroot/buildroot-test/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
pcm_dmix.c:(.text+0x83c): warning:
/home/buildroot/buildroot-test/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'

Fixes:

  http://autobuild.buildroot.net/results/5964e7028c31a8f75b38a27270410f0b3c5c8422/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 ...-rawmidi_symbols.c-use-rawmidi_virt-only-.patch | 50 ++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch

diff --git a/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch b/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch
new file mode 100644
index 0000000..df04cea
--- /dev/null
+++ b/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch
@@ -0,0 +1,50 @@
+From da16e18f03fc63e1206b93d6a719b177d4f4bb99 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Fri, 11 Aug 2017 22:33:01 +0200
+Subject: [PATCH] src/rawmidi/rawmidi_symbols.c: use rawmidi_virt only when
+ available
+
+src/rawmidi/Makefile.am only brings rawmidi_virt.c into the build when
+BUILD_SEQ is defined (i.e when --enable-seq is passed). However,
+rawmidi_symbols.c unconditionally refers to _snd_module_rawmidi_virt,
+defined in rawmidi_virt.c.
+
+This causes a link failure when BUILD_SEQ is disabled. For example
+when linking ffmpeg against alsa-lib:
+
+/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
+pcm_dmix.c:(.text+0x83c): warning:
+/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'
+collect2: error: ld returned 1 exit status
+
+To fix this, we make sure that rawmidi_symbols.c only uses
+_snd_module_rawmidi_virt when available.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ src/rawmidi/rawmidi_symbols.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/rawmidi/rawmidi_symbols.c b/src/rawmidi/rawmidi_symbols.c
+index cdc06d7..6473433 100644
+--- a/src/rawmidi/rawmidi_symbols.c
++++ b/src/rawmidi/rawmidi_symbols.c
+@@ -21,11 +21,15 @@
+ #ifndef PIC
+ 
+ extern const char *_snd_module_rawmidi_hw;
++#ifdef BUILD_SEQ
+ extern const char *_snd_module_rawmidi_virt;
++#endif
+ 
+ static const char **snd_rawmidi_open_objects[] = {
+ 	&_snd_module_rawmidi_hw,
++#ifdef BUILD_SEQ
+ 	&_snd_module_rawmidi_virt
++#endif
+ };
+ 	
+ void *snd_rawmidi_open_symbols(void)
+-- 
+2.9.4
+
-- 
2.9.4

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

* [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib"
  2017-08-11 21:21 [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Thomas Petazzoni
@ 2017-08-11 21:21 ` Thomas Petazzoni
  2017-08-12 10:01   ` Yann E. MORIN
  2017-08-12 10:00 ` [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Yann E. MORIN
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2017-08-11 21:21 UTC (permalink / raw)
  To: buildroot

This reverts commit c69088b8c35177cecdd0f1f385c13f5b2c509f1d, which is
no longer needed now that alsa-lib has been fixed properly.

Indeed, this commit was made because alsa-utils failed to build with:

/home/buildroot/build/instance-0/output/host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_htimestamp':
pcm_dmix.c:(.text+0x5c0): warning:
/home/buildroot/build/instance-0/output/host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data.rel+0x4): undefined reference to `_snd_module_rawmidi_virt'
collect2: error: ld returned 1 exit status

Which is exactly the problem that we fixed in alsa-lib by making sure
that rawmidi_symbols.c doesn't reference symbols from rawmidi_virt.c
when SEQ support is not enabled.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/alsa-utils/Config.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/package/alsa-utils/Config.in b/package/alsa-utils/Config.in
index d3fd18d..1a48fc0 100644
--- a/package/alsa-utils/Config.in
+++ b/package/alsa-utils/Config.in
@@ -49,7 +49,6 @@ config BR2_PACKAGE_ALSA_UTILS_ALSATPLG
 config BR2_PACKAGE_ALSA_UTILS_AMIDI
 	bool "amidi"
 	select BR2_PACKAGE_ALSA_LIB_RAWMIDI
-	select BR2_PACKAGE_ALSA_LIB_SEQ
 
 config BR2_PACKAGE_ALSA_UTILS_AMIXER
 	bool "amixer"
-- 
2.9.4

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

* [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency
  2017-08-11 21:21 [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Thomas Petazzoni
  2017-08-11 21:21 ` [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib" Thomas Petazzoni
@ 2017-08-12 10:00 ` Yann E. MORIN
  2017-08-12 11:50   ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Yann E. MORIN @ 2017-08-12 10:00 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2017-08-11 23:21 +0200, Thomas Petazzoni spake thusly:
> This commit adds a patch to alsa-lib that fixes an incorrect code
> dependency: some code built when MIDI support is enabled is
> unconditionally referencing code that is built when SEQ support is
> enabled, both options being independent.
> 
> This causes build failures such as:
> 
> /home/buildroot/buildroot-test/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
> pcm_dmix.c:(.text+0x83c): warning:
> /home/buildroot/buildroot-test/instance-1/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'
> 
> Fixes:
> 
>   http://autobuild.buildroot.net/results/5964e7028c31a8f75b38a27270410f0b3c5c8422/
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Minor nit, below...

> ---
>  ...-rawmidi_symbols.c-use-rawmidi_virt-only-.patch | 50 ++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch
> 
> diff --git a/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch b/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch
> new file mode 100644
> index 0000000..df04cea
> --- /dev/null
> +++ b/package/alsa-lib/0005-src-rawmidi-rawmidi_symbols.c-use-rawmidi_virt-only-.patch
> @@ -0,0 +1,50 @@
> +From da16e18f03fc63e1206b93d6a719b177d4f4bb99 Mon Sep 17 00:00:00 2001
> +From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +Date: Fri, 11 Aug 2017 22:33:01 +0200
> +Subject: [PATCH] src/rawmidi/rawmidi_symbols.c: use rawmidi_virt only when
> + available
> +
> +src/rawmidi/Makefile.am only brings rawmidi_virt.c into the build when
> +BUILD_SEQ is defined (i.e when --enable-seq is passed). However,
> +rawmidi_symbols.c unconditionally refers to _snd_module_rawmidi_virt,
> +defined in rawmidi_virt.c.
> +
> +This causes a link failure when BUILD_SEQ is disabled. For example
> +when linking ffmpeg against alsa-lib:
> +
> +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
> +pcm_dmix.c:(.text+0x83c): warning:
> +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'
> +collect2: error: ld returned 1 exit status
> +
> +To fix this, we make sure that rawmidi_symbols.c only uses
> +_snd_module_rawmidi_virt when available.
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Upstream status?

Regards,
Yann E. MORIN.

> +---
> + src/rawmidi/rawmidi_symbols.c | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/src/rawmidi/rawmidi_symbols.c b/src/rawmidi/rawmidi_symbols.c
> +index cdc06d7..6473433 100644
> +--- a/src/rawmidi/rawmidi_symbols.c
> ++++ b/src/rawmidi/rawmidi_symbols.c
> +@@ -21,11 +21,15 @@
> + #ifndef PIC
> + 
> + extern const char *_snd_module_rawmidi_hw;
> ++#ifdef BUILD_SEQ
> + extern const char *_snd_module_rawmidi_virt;
> ++#endif
> + 
> + static const char **snd_rawmidi_open_objects[] = {
> + 	&_snd_module_rawmidi_hw,
> ++#ifdef BUILD_SEQ
> + 	&_snd_module_rawmidi_virt
> ++#endif
> + };
> + 	
> + void *snd_rawmidi_open_symbols(void)
> +-- 
> +2.9.4
> +
> -- 
> 2.9.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib"
  2017-08-11 21:21 ` [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib" Thomas Petazzoni
@ 2017-08-12 10:01   ` Yann E. MORIN
  0 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2017-08-12 10:01 UTC (permalink / raw)
  To: buildroot

Thomas, All,

On 2017-08-11 23:21 +0200, Thomas Petazzoni spake thusly:
> This reverts commit c69088b8c35177cecdd0f1f385c13f5b2c509f1d, which is
> no longer needed now that alsa-lib has been fixed properly.
> 
> Indeed, this commit was made because alsa-utils failed to build with:
> 
> /home/buildroot/build/instance-0/output/host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_htimestamp':
> pcm_dmix.c:(.text+0x5c0): warning:
> /home/buildroot/build/instance-0/output/host/usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data.rel+0x4): undefined reference to `_snd_module_rawmidi_virt'
> collect2: error: ld returned 1 exit status
> 
> Which is exactly the problem that we fixed in alsa-lib by making sure
> that rawmidi_symbols.c doesn't reference symbols from rawmidi_virt.c
> when SEQ support is not enabled.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
>  package/alsa-utils/Config.in | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/package/alsa-utils/Config.in b/package/alsa-utils/Config.in
> index d3fd18d..1a48fc0 100644
> --- a/package/alsa-utils/Config.in
> +++ b/package/alsa-utils/Config.in
> @@ -49,7 +49,6 @@ config BR2_PACKAGE_ALSA_UTILS_ALSATPLG
>  config BR2_PACKAGE_ALSA_UTILS_AMIDI
>  	bool "amidi"
>  	select BR2_PACKAGE_ALSA_LIB_RAWMIDI
> -	select BR2_PACKAGE_ALSA_LIB_SEQ
>  
>  config BR2_PACKAGE_ALSA_UTILS_AMIXER
>  	bool "amixer"
> -- 
> 2.9.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

* [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency
  2017-08-12 10:00 ` [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Yann E. MORIN
@ 2017-08-12 11:50   ` Thomas Petazzoni
  2017-08-12 16:30     ` Arnout Vandecappelle
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2017-08-12 11:50 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 12 Aug 2017 12:00:46 +0200, Yann E. MORIN wrote:

> > +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
> > +pcm_dmix.c:(.text+0x83c): warning:
> > +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'
> > +collect2: error: ld returned 1 exit status
> > +
> > +To fix this, we make sure that rawmidi_symbols.c only uses
> > +_snd_module_rawmidi_virt when available.
> > +
> > +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>  
> 
> Upstream status?

I submitted it upstream after sending the Buildroot patch, so I didn't
had the link. But it's submitted upstream, see
https://www.spinics.net/lists/alsa-devel/msg65902.html.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency
  2017-08-12 11:50   ` Thomas Petazzoni
@ 2017-08-12 16:30     ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2017-08-12 16:30 UTC (permalink / raw)
  To: buildroot



On 12-08-17 13:50, Thomas Petazzoni wrote:
> Hello,
> 
> On Sat, 12 Aug 2017 12:00:46 +0200, Yann E. MORIN wrote:
> 
>>> +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(pcm_dmix.o): In function `snd_pcm_dmix_sync_ptr':
>>> +pcm_dmix.c:(.text+0x83c): warning:
>>> +/home/thomas/projets/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libasound.a(rawmidi_symbols.o):(.data+0x4): undefined reference to `_snd_module_rawmidi_virt'
>>> +collect2: error: ld returned 1 exit status
>>> +
>>> +To fix this, we make sure that rawmidi_symbols.c only uses
>>> +_snd_module_rawmidi_virt when available.
>>> +
>>> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>  
>>
>> Upstream status?
> 
> I submitted it upstream after sending the Buildroot patch, so I didn't
> had the link. But it's submitted upstream, see
> https://www.spinics.net/lists/alsa-devel/msg65902.html.

 I added this link to the patch and applied to master, thanks.

 Regards,
 Arnout
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2017-08-12 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-11 21:21 [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Thomas Petazzoni
2017-08-11 21:21 ` [Buildroot] [PATCH 2/2] Revert "alsa-utils: amidi option needs seq support in alsa-lib" Thomas Petazzoni
2017-08-12 10:01   ` Yann E. MORIN
2017-08-12 10:00 ` [Buildroot] [PATCH 1/2] alsa-lib: add patch to fix incorrect code dependency Yann E. MORIN
2017-08-12 11:50   ` Thomas Petazzoni
2017-08-12 16:30     ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox