2011-06-27 18:36:52     Compiling shared lib (portaudio)

Document created by Aaronwu Employee on Aug 27, 2013
Version 1Show Document
  • View in full screen mode

2011-06-27 18:36:52     Compiling shared lib (portaudio)


Message: 101727   


When I do this:




libtool: link:  bfin-linux-uclibc-gcc -shared  src/common/.libs/pa_allocation.o src/common/.libs/pa_converters.o src/common/.libs/pa_cpuload.o src/common/.libs/pa_dither.o src/common/.libs/pa_debugprint.o src/common/.libs/pa_front.o src/common/.libs/pa_process.o src/common/.libs/pa_stream.o src/common/.libs/pa_trace.o src/hostapi/skeleton/.libs/pa_hostapi_skeleton.o src/hostapi/alsa/.libs/pa_linux_alsa.o src/hostapi/oss/.libs/pa_unix_oss.o src/os/unix/.libs/pa_unix_hostapis.o src/os/unix/.libs/pa_unix_util.o   -lrt -lasound -lm -lpthread  -mcpu=bf548-0.2   -Wl,-soname -Wl,libportaudio.so.2 -Wl,-version-script -Wl,lib/.libs/libportaudio.ver -o lib/.libs/libportaudio.so.2.0.0



Not all the symbols found in pa_front.o are found in the created lib (libportaudio.so.2.0.0) and I am get linking problems when I create an app that is linked against the library.


Am I missing some option to create a shared lib under uClinux?




2011-06-27 18:56:50     Re: Compiling shared lib (portaudio)

Mike Frysinger (UNITED STATES)

Message: 101728   


if you're using the 2010R1 release, you'll probably need to modify libportaudio.ver by hand to add underscore prefixes to all the symbols and then relink the .so




2011-06-28 11:45:17     Re: Compiling shared lib (portaudio)


Message: 101796   


Ok, that worked.  I assume that to modify the scripts to add it automatically in portaudio is my exercise to figure out?




2011-06-28 11:48:22     Re: Compiling shared lib (portaudio)

Mike Frysinger (UNITED STATES)

Message: 101797   


yes, because how many projects do it differently.  no way of knowing without actually looking at the builds guts.




2011-06-28 12:22:34     Re: Compiling shared lib (portaudio)


Message: 101799   


Heh, and libtool was supposed to make our lives easier? 


This is a mess and almost impossible to debug.




2011-06-28 12:27:27     Re: Compiling shared lib (portaudio)

Mike Frysinger (UNITED STATES)

Message: 101800   


problem is that not everyone uses libtool.  it provides a way to export a symbol list, but it doesnt support newer features like symbol versioning.




2011-06-28 12:49:49     Re: Compiling shared lib (portaudio)


Message: 101801   


I have it compiled now and I edited the 'configure' script.  I just had it add the prefix as it was creating the .ver file.  Is this bad practice as that another file should have been looked at first (configure.in, Makefile.in)?


Are there any 'Best Practices' with libtool, or 'Just Get It To Work'?






2011-06-28 13:11:22     Re: Compiling shared lib (portaudio)

Mike Frysinger (UNITED STATES)

Message: 101803   


unfortunately, like everything else, the answer is "it depends".  not only on how the code is written, but on what your goals are.


if you just want to make the package work and keep the result, then modifying configure is probably the start and finish.


if you want to have a patch against the actual source files, and you want to regenerate autotools after that, things get murky.  you have to find the offending source code first.

- is it custom code to portaudio ?

   - if so, look at configure.ac for it ... if there, you're set

   - if not, is it expanded from some custom m4 macro ?  search for that macro in all the m4 files included (acinclude.m4, maybe some m4/ subdir, or `find -name '*.m4'`) ...

- is it code coming from libtool ?

   - not much for you to do other than patch the local libtool files and not regenerate from the installed libtool package from your host distro


then once you've modified the local things, you'll need to regenerate autotools.  usually `autoreconf -f -i` will do the trick, but only if the package itself doesnt have bugs/stupid behavior which breaks this.  you'll also need all the random m4 files that portaudio uses from external packages if it doesnt bundle itself.


there's probably other things i'm forgetting.