From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: alsa-devel@alsa-project.org
Cc: Takashi Iwai <tiwai@suse.de>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: [PATCH alsa-lib] src/rawmidi/rawmidi_symbols.c: use rawmidi_virt only when available
Date: Fri, 11 Aug 2017 23:24:03 +0200 [thread overview]
Message-ID: <20170811212403.24607-1-thomas.petazzoni@free-electrons.com> (raw)
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
next reply other threads:[~2017-08-11 21:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 21:24 Thomas Petazzoni [this message]
2017-08-12 21:41 ` [PATCH alsa-lib] src/rawmidi/rawmidi_symbols.c: use rawmidi_virt only when available Takashi Iwai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170811212403.24607-1-thomas.petazzoni@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=alsa-devel@alsa-project.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.