[Buildroot] [PATCH 1/1] package/sox: fix static build with libsndfile

Arnout Vandecappelle arnout at mind.be
Wed Aug 4 21:18:48 UTC 2021



On 04/08/2021 11:08, Fabrice Fontaine wrote:
> Fix the following static build failure with libsndfile raised since
> commit dbc6e9e9f385995eb10bbfb0bb08e7674100ce66:
> 
> configure:14720: checking for sf_open_virtual in -lsndfile
> configure:14745: /tmp/instance-1/output-1/host/bin/xtensa-buildroot-linux-uclibc-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mauto-litpools -Os -g0  -static -Wall -Wmissing-prototypes -Wstrict-prototypes  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static -Wl,--as-needed conftest.c -lsndfile    >&5
> conftest.c:73:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
>    73 | char sf_open_virtual ();
>       | ^~~~
> conftest.c:75:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
>    75 | main ()
>       | ^~~~
> /tmp/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: /tmp/instance-1/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libsndfile.a(libsndfile_la-flac.o): in function `flac_byterate':
> flac.c:(.text+0xfc): undefined reference to `FLAC__StreamDecoderErrorStatusString'
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/4bc58ed68b29642876bb02710d0cd4f31540de86
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>

 Applied to master, thanks.

 Regards,
 Arnout

> ---
>  ...e.ac-fix-static-linking-with-sndfile.patch | 44 +++++++++++++++++++
>  1 file changed, 44 insertions(+)
>  create mode 100644 package/sox/0005-configure.ac-fix-static-linking-with-sndfile.patch
> 
> diff --git a/package/sox/0005-configure.ac-fix-static-linking-with-sndfile.patch b/package/sox/0005-configure.ac-fix-static-linking-with-sndfile.patch
> new file mode 100644
> index 0000000000..2233459331
> --- /dev/null
> +++ b/package/sox/0005-configure.ac-fix-static-linking-with-sndfile.patch
> @@ -0,0 +1,44 @@
> +From 06109c84ab6930265287049c4bf9405e7ebc4986 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> +Date: Wed, 4 Aug 2021 10:27:16 +0200
> +Subject: [PATCH] configure.ac: fix static linking with sndfile
> +
> +Use SOX_FMT_PKG to retrieve sndfile dependencies (e.g. flac, opus or
> +vorbis). This will fix the following static build failure:
> +
> +configure:14720: checking for sf_open_virtual in -lsndfile
> +configure:14745: /tmp/instance-1/output-1/host/bin/xtensa-buildroot-linux-uclibc-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls -mauto-litpools -Os -g0  -static -Wall -Wmissing-prototypes -Wstrict-prototypes  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -static -Wl,--as-needed conftest.c -lsndfile    >&5
> +conftest.c:73:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> +   73 | char sf_open_virtual ();
> +      | ^~~~
> +conftest.c:75:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
> +   75 | main ()
> +      | ^~~~
> +/tmp/instance-1/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/10.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: /tmp/instance-1/output-1/host/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libsndfile.a(libsndfile_la-flac.o): in function `flac_byterate':
> +flac.c:(.text+0xfc): undefined reference to `FLAC__StreamDecoderErrorStatusString'
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/4bc58ed68b29642876bb02710d0cd4f31540de86
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> +[Upstream status: not sent yet (waiting for feedback on third patch)]
> +---
> + configure.ac | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 8ae3202c..26510769 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -117,7 +117,7 @@ SOX_FMT_REQ([mp3], [MAD LAME TWOLAME])
> + SOX_FMT_PKG([oggvorbis], [ogg vorbis vorbisenc vorbisfile])
> + SOX_FMT_PKG([opus], [opusfile])
> + 
> +-SOX_DL_LIB([libsndfile], [sndfile.h], [sndfile], [sf_open_virtual])
> ++SOX_FMT_PKG([libsndfile], [sndfile])
> + SOX_FMT_REQ([sndfile], [LIBSNDFILE])
> + 
> + SOX_FMT_LIB([wavpack], [wavpack/wavpack.h], [wavpack], [WavpackGetSampleRate])
> +-- 
> +2.30.2
> +
> 


More information about the buildroot mailing list