Re: Compile sndio as static library

From: Fuzhou Chen <fuzhouch_at_gmail.com>
Date: Wed, 13 Dec 2023 16:31:07 +0800
Hi Jan,

It does. See source code:
https://github.com/ratchov/sndio/blob/3f8bdefa5b4a63915ddd8335f01308756e021a4d/libsndio/sio_alsa.c#L32
I also attached my readelf and ldd output when querying
/usr/lib/libsndio.so.7.2, on the Manjaro unstable branch. You can see it
depends on libasound.so.2, which is part of alsa-lib package.

If you are running on other systems, it's also possible that the system
distributed libsndio.so is built using other backends, maybe OSS?

Actually, the different output from your machine and mine shows a perfect
example to support my previous scenario description, that why a game
developer should not depend on OS provided libraries.

Thanks,
Fuzhou

==== Output of library needed ====
fuzhouch_at_fcdvh01 ~/p/c/s/libsndio (feature-staticlib)> readelf -a -W
/usr/lib/libsndio.so.7.2 |grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libasound.so.2]
 0x0000000000000001 (NEEDED)             Shared library: [libbsd.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

fuzhouch_at_fcdvh01 ~/p/c/s/libsndio (feature-staticlib)> ldd
/usr/lib/libsndio.so.7.2
linux-vdso.so.1 (0x00007ffc93d26000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x00007f318171f000)
libbsd.so.0 => /usr/lib/libbsd.so.0 (0x00007f3181709000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f3181527000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f318143a000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f3181851000)
libmd.so.0 => /usr/lib/libmd.so.0 (0x00007f318142a000)


On Wed, Dec 13, 2023 at 3:41 PM Jan Stary <hans_at_stare.cz> wrote:

> > I hit this problem on my project, HashBLD. The goal is to make a game
> > engine, hashlink, portable: https://github.com/fuzhouch/hashbld. A
> > dependency chain on the audio part is: hashlink(openal.hdll module) ->
> > openal-soft -> libsndio -> alsa-lib.
>
> I don't think libsndio depends on alsa.
>
> /usr/lib/libsndio.so.7.2:
> Start            End              Type  Open Ref GrpRef Name
> 00000344d1de0000 00000344d1df3000 dlib  1    0   0
> /usr/lib/libsndio.so.7.2
>
>
> > I set a fixed backend chain until
> > alsa-lib (since ALSA is available on all Linux distros).
>
>
Received on Wed Dec 13 2023 - 09:31:07 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 14 2023 - 01:30:01 CET