2009-06-11 09:38:16     Latest snapshot, ALSA Library

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

2009-06-11 09:38:16     Latest snapshot, ALSA Library

billy walton (UNITED KINGDOM)

Message: 75538   




I have been compiling the latest snapshot for a BF537 fine for some time now


I seem to have a problem trying to compile anything which uses the ALSA Libraries, the undefined reference to _fork issue (i appreciate fork'ing is not an option on the Blackfin)




Making install in aserver

make[5]: Entering directory `/home/billy/Projects/blackfin/uclinux-dist/uclinux-dist/lib/alsa-lib/build-alsa-lib-1.0.18/aserver'

/bin/bash ../libtool --tag=CC --mode=link bfin-linux-uclibc-gcc  -pipe -Wall -g -O2      -mcpu=bf537-0.2  -mcpu=bf537-0.2 -o aserver  aserver.o ../src/libasound.la

bfin-linux-uclibc-gcc -pipe -Wall -g -O2 -mcpu=bf537-0.2 -mcpu=bf537-0.2 -o .libs/aserver aserver.o  ../src/.libs/libasound.so -ldl -lpthread -lrt

../src/.libs/libasound.so: undefined reference to `_fork'

collect2: ld returned 1 exit status


The toolchain is a snapshot too


My question is, is this a problem due to it being a snapshot build or a problem with something i have/have not done?


Do i need to drop back to a release to get this to work as opposed to a snapshot?


I get the error both when trying to include the ALSA utils, or Linphone - its Linphone i really want


Many thanks






2009-06-11 12:07:24     Re: Latest snapshot, ALSA Library

billy walton (UNITED KINGDOM)

Message: 75545   


I have read on a previous post that i need to have the UserSpace compiled for FDPIC not FLAT for the ALSA lib to work.




I have also read that the setting for this is in the Vender/User setting...


...but i cannot find


can anyone confirm where exactly i can find this setting under the SVN release? i have enabled support for it but cant see the UserSpace bit




2009-06-11 12:23:54     Re: Latest snapshot, ALSA Library

billy walton (UNITED KINGDOM)

Message: 75546   


I think i found it in, Blackfin Build Options->Binary Format, but its already on FDPIC so guess its not that




2009-06-11 12:50:44     Re: Latest snapshot, ALSA Library


Message: 75547   




The previous toolchains had a stub for fork - the library would print out "fork is not implmented", and die.


This made this compile nicely, but it really was lieing to the build system (which is bad). We thought it was better off not to lie - since it was actually causing some packages not to build properly (they would detect fork - since it _was_ there, and think it was the real fork (which it wasn't) - and have all kinds of run time failures...


So - on trunk - we decided to remove the fork stub. No more lieing to anything.


What this means is that we are finding the packages that were using fork...


It seems only to be used in src/pcm/pcm_direct.c (in the alsa lib) - for now - just change the fork to vfork. Based on the code - it isn't going to work - but I don't think we ever call that function. We will have to look into it to determine the correct fix later.


I will add it to the list.








2009-06-11 13:15:23     Re: Latest snapshot, ALSA Library

billy walton (UNITED KINGDOM)

Message: 75549   


Hi Robin,


Thanks for that, worked a charm, i found two offending lines in the pcm_direct.c file, and now all is good for the ALSA lib compile.








2009-06-12 08:16:09     Re: Latest snapshot, ALSA Library

billy walton (UNITED KINGDOM)

Message: 75620   


Just incase anyone else is interested in getting Linphone built under the current SVN, it seems to work with just replacing the fork() calls to vfork() (as suggested by Robin) in the following files:




alsa - pcm - pcm_direct.c


libeXosip - tools - sip_reg.c


linphone - console - shell.c




2009-07-29 06:30:38     Re: Latest snapshot, ALSA Library

Rob Maris (GERMANY)

Message: 78151   




upon toolchain update to actual snapshot I get fork error messages several times (e.g. user/ntp (4x)and  dropbear). I replace fork entries by vfork entries, but seen the tracker item 5214 there are quite more cases.


I have no experience in sharing updates anyway, but for any case I find a fork, I'd like to contribute in sharing these updates. I also guess that simple replacing of forks by vforks is only a temporary solution for individual programmers. Please advice how to contribute when it can be done. (BTW: why not let the linking process repoint fork symbols to vfork?).






2009-07-29 08:05:01     Re: Latest snapshot, ALSA Library


Message: 78157   




Like I said - we use to do that - and it caused problems.




You need to wait until we audit things, and fix them up. Changing fork to vfork, while it will allow things to compile - will sometimes crash at runtime. This is what we need to look at each case, and fix up.






2009-07-29 09:36:23     Re: Latest snapshot, ALSA Library

Rob Maris (GERMANY)

Message: 78165   


Okay, I still guessed that each case has to be tested individually. When I'm encountering a case where I have replaced fork by vfork, and tested it, I think I have to comment it under #5214.