From patchwork Fri Aug 11 21:24:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 9896539 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CA18E60351 for ; Fri, 11 Aug 2017 21:24:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BCC2128BE3 for ; Fri, 11 Aug 2017 21:24:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B115728C32; Fri, 11 Aug 2017 21:24:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1C7528BE3 for ; Fri, 11 Aug 2017 21:24:14 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D5929266D58; Fri, 11 Aug 2017 23:24:10 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9FB3B266D69; Fri, 11 Aug 2017 23:24:09 +0200 (CEST) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by alsa0.perex.cz (Postfix) with ESMTP id 0563B266D57 for ; Fri, 11 Aug 2017 23:24:05 +0200 (CEST) Received: by mail.free-electrons.com (Postfix, from userid 110) id F37B020A5A; Fri, 11 Aug 2017 23:24:04 +0200 (CEST) Received: from localhost (unknown [77.147.230.132]) by mail.free-electrons.com (Postfix) with ESMTPSA id A24AF20954; Fri, 11 Aug 2017 23:24:04 +0200 (CEST) From: Thomas Petazzoni To: alsa-devel@alsa-project.org Date: Fri, 11 Aug 2017 23:24:03 +0200 Message-Id: <20170811212403.24607-1-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.9.4 Cc: Takashi Iwai , Thomas Petazzoni Subject: [alsa-devel] [PATCH alsa-lib] src/rawmidi/rawmidi_symbols.c: use rawmidi_virt only when available X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)