i did that but to no avail.  what DID work was changing the config file for libmad.  

in libmad.mk, i changed "--disable-shared" to "--enable-shared" and added "--with-pic"

now when i compile madmodule.so it is PIC friendly.

HOWEVER

loading the module on the gumstix produces this error.  first it says "file not found," which may be a bug in dlopen, and if you import it a second time it seg faults.  if python can't find the module, it says something like "no module named foo."  it's clearly finding madmodule.so, but then it gives the spurious and bizarre "file not found."

the libmad.so's are not transferred to the gumstix with the buildroot.  perhaps they need to be there?


(in python)
>>> import mad
# trying mad.so
# trying madmodule.so
# trying mad.py
# trying mad.pyc
# trying /usr/lib/python24.zip/mad.so
# trying /usr/lib/python24.zip/madmodule.so
# trying /usr/lib/python24.zip/mad.py
# trying /usr/lib/python24.zip/mad.pyc
# trying /usr/lib/python2.4/mad.so
# trying /usr/lib/python2.4/madmodule.so
# trying /usr/lib/python2.4/mad.py
# trying /usr/lib/python2.4/mad.pyc
# trying /usr/lib/python2.4/plat-linux2/mad.so
# trying /usr/lib/python2.4/plat-linux2/madmodule.so
# trying /usr/lib/python2.4/plat-linux2/mad.py
# trying /usr/lib/python2.4/plat-linux2/mad.pyc
# trying /usr/lib/python2.4/lib-tk/mad.so
# trying /usr/lib/python2.4/lib-tk/madmodule.so
# trying /usr/lib/python2.4/lib-tk/mad.py
# trying /usr/lib/python2.4/lib-tk/mad.pyc
# trying /usr/lib/python2.4/lib-dynload/mad.so
# trying /usr/lib/python2.4/lib-dynload/madmodule.so
# trying /usr/lib/python2.4/lib-dynload/mad.py
# trying /usr/lib/python2.4/lib-dynload/mad.pyc
# trying /usr/lib/python2.4/site-packages/mad.so
# trying /usr/lib/python2.4/site-packages/madmodule.so
dlopen("/usr/lib/python2.4/site-packages/madmodule.so", 2);
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: File not found
>>> import mad
# trying mad.so
# trying madmodule.so
# trying mad.py
# trying mad.pyc
# trying /usr/lib/python24.zip/mad.so
# trying /usr/lib/python24.zip/madmodule.so
# trying /usr/lib/python24.zip/mad.py
# trying /usr/lib/python24.zip/mad.pyc
# trying /usr/lib/python2.4/mad.so
# trying /usr/lib/python2.4/madmodule.so
# trying /usr/lib/python2.4/mad.py
# trying /usr/lib/python2.4/mad.pyc
# trying /usr/lib/python2.4/plat-linux2/mad.so
# trying /usr/lib/python2.4/plat-linux2/madmodule.so
# trying /usr/lib/python2.4/plat-linux2/mad.py
# trying /usr/lib/python2.4/plat-linux2/mad.pyc
# trying /usr/lib/python2.4/lib-tk/mad.so
# trying /usr/lib/python2.4/lib-tk/madmodule.so
# trying /usr/lib/python2.4/lib-tk/mad.py
# trying /usr/lib/python2.4/lib-tk/mad.pyc
# trying /usr/lib/python2.4/lib-dynload/mad.so
# trying /usr/lib/python2.4/lib-dynload/madmodule.so
# trying /usr/lib/python2.4/lib-dynload/mad.py
# trying /usr/lib/python2.4/lib-dynload/mad.pyc
# trying /usr/lib/python2.4/site-packages/mad.so
# trying /usr/lib/python2.4/site-packages/madmodule.so
dlopen("/usr/lib/python2.4/site-packages/madmodule.so", 2);
Segmentation fault

On Jul 26, 2006, at 6:04 AM, Alexandre Pereira Nunes wrote:

[cut]

here are my compilation commands

arm-linux-uclibc-gcc -c -g -fPIC 
-I/home/greg/gumstix/gumstix-buildroot/build_arm_nofpu/staging_dir/include 
-I/usr/local/include/python2.4 -c src/madmodule.c -o madmodule.o

arm-linux-uclibc-gcc -c -g -fPIC 
-I/home/greg/gumstix/gumstix-buildroot/build_arm_nofpu/staging_dir/include 
-I/usr/local/include/python2.4 -c src/pymadfile.c -o pymadfile.o

arm-linux-uclibc-gcc -c -g -fPIC 
-I/home/greg/gumstix/gumstix-buildroot/build_arm_nofpu/staging_dir/include 
-I/usr/local/include/python2.4 -c src/xing.c -o xing.o

arm-linux-gcc -pthread -shared madmodule.o pymadfile.o xing.o 
-L/home/greg/gumstix/gumstix-buildroot/build_arm_nofpu/staging_dir/lib 
-lmad -o madmodule.so



I guess you should add -fPIC to the link command line too.
Try something like:

arm-linux-gcc -pthread -shared -fPIC madmodule.o pymadfile.o xing.o 
-L/home/greg/gumstix/gumstix-buildroot/build_arm_nofpu/staging_dir/lib 
-lmad -o madmodule.so



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gumstix-users mailing list
gumstix-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gumstix-users