[Beaglebone] - Python MySQLdb library build errors on Beaglebone

Hello,

I am having a compiler error when trying to build the MySQLdb python library on my Beaglebone. MySQL and other programs all build correctly. Only this particular library is having the issue.

Here is the Python MySQLdb library source I want to use:

http://sourceforge.net/projects/mysql-python/

I am using the default Angstrom distribution on a Beaglebone A6 board.

root@beaglebone:~/MySQL-python-1.2.3# export C_INCLUDE_PATH=/usr/include

root@beaglebone:~/MySQL-python-1.2.3# export PATH=$PATH:/usr/local/mysql/bin

root@beaglebone:~/MySQL-python-1.2.3# python setup.py build
running build
running build_py
copying MySQLdb/release.py → build/lib.linux-armv7l-2.7/MySQLdb
running build_ext
building 'mysql’ extension
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -fno-tree-vectorize -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -D__SOFTFP
_ --sysroot=/OE/angstrom-v2012-05/build/tmp-angstrom_v2012_05-eglibc/sysroots/beaglebone -fno-strict-aliasing -O2 -pipe -g -feliminate-unused-debug-types -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,3,‘final’,0) -D__version__=1.2.3 -I/usr/local/mysql/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-armv7l-2.7/mysql.o
In file included from mysql.c:36:0:
/usr/local/mysql/include/mysql/my_config.h:1066:0: warning: “SIZEOF_OFF_T” redefined
/usr/include/python2.7/pyconfig.h:998:0: note: this is the location of the previous definition
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -fno-tree-vectorize -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a8 -D__SOFTFP
--sysroot=/OE/angstrom-v2012-05/build/tmp-angstrom_v2012_05-eglibc/sysroots/beaglebone -shared -Wl,-O1 -Wl,–hash-style=gnu -Wl,–as-needed build/temp.linux-armv7l-2.7/_mysql.o /usr/local/mysql/lib/mysql/libmysqlclient_r.a -L/usr/local/mysql/lib/mysql -L/usr/lib -lmysqlclient_r -lz -lpthread -lcrypt -lnsl -lm -lpthread -lpython2.7 -o build/lib.linux-armv7l-2.7/_mysql.so
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.5.4/…/…/…/…/arm-angstrom-linux-gnueabi/bin/ld: this linker was not configured to use sysroots
collect2: ld returned 1 exit status
error: command ‘arm-angstrom-linux-gnueabi-gcc’ failed with exit status 1
root@beaglebone:~/MySQL-python-1.2.3#

I see a similar bug for the Ubuntu distribution here:

https://bugs.launchpad.net/ubuntu/+source/armel-cross-toolchain-base/+bug/692987

I am hoping that this is something simple to get cleared up. I have been banging my head trying to get this to work with various combinations (MySQL static build, etc.) but have had no luck so far. It’s interesting that I can build the entire MySQL package from sources with no problems but this simple library is having the issue. I appreciate any help.

Thanks!