I lack some knowledge in the area of shared libraries. I notice that
when running ldd on the fluidsynth executable, it comes up with a
large list of dependencies, which aren't actually used in the
fluidsynth application itself, but are instead dependencies of
libfluidsynth. Perhaps ldd is recursively listing the dependencies
though?
Yes, it is. But you can give -u and -r in the command line to avoid indirect
dependencies. This is what I got here:
$ ldd -u -r /usr/bin/fluidsynth
Unused direct dependencies:
/lib/libreadline.so.5
/lib/libncurses.so.5
/usr/local/lib/libjack.so.0
/usr/lib/libasound.so.2
/lib/libm.so.6
/lib/libdl.so.2
/lib/librt.so.1
/usr/lib/libpulse-simple.so.0
/usr/lib/libpulse.so.0
/lib/libpthread.so.0
(a lot of unused dependencies!)
The src/Makefile.am is using "fluidsynth_LDADD = libfluidsynth.la" to
link in the libfluidsynth library. This seems correct and I'm not
sure where any other unnecessary linkage is occurring.
IMO, the easiest way to fix this would be to add a flag for the linker [1],
one of these lines in src/Makefile.am:
fluidsynth_LDFLAGS = -Wl,--as-needed
or
AM_LDFLAGS = -Wl,--as-needed
or set this environment variable before executing configure:
LDFLAGS=-Wl,--as-needed
Can you test for unwanted side effects?
Regards,
Pedro
[1] http://www.gentoo.org/proj/en/qa/asneeded.xml