2008-03-27 07:39:19 relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53127 Hi,
I try to compile a program that use libmysqlclient.a.
I've successfully compiled mysql and libclient.
But when I try to use that library I've the following problem.
bfin-linux-uclibc-gcc -Wall -g -I/home/plegal/opt/blackfin/uclinuxsvn-stamp/user/mysql/include -I/opt/uClinux/bfin-linux-uclibc -c /home/plegal/greta/formation-lcpc/cb/mysql/insertTesteur.c -o obj/Debug/insertTesteur.o
bfin-linux-uclibc-gcc -L/opt/uClinux/bfin-linux-uclibc/lib -o bin/Debug/insertTesteur obj/Debug/insertTesteur.o -mfdpic /home/plegal/opt/blackfin/uclinuxsvn-stamp/user/mysql/libmysql/.libs/libmysqlclient.a
/home/plegal/opt/blackfin/uclinuxsvn-stamp/user/mysql/libmysql/.libs/libmysqlclient.a(libmysql.o): dans la fonction « _mysql_rpl_query_type »:
libmysql.c:(.text+0x22a): AVERTISSEMENT: warning: relocation references a different segment
libmysql.c:(.text+0x22e): AVERTISSEMENT: warning: relocation references a different segment...
Any idea ?
Philippe
QuoteReplyEditDelete
2008-03-27 09:40:49 Re: relocation reference problem with libmysqlclient.a
Mike Frysinger (UNITED STATES)
Message: 53143 please only post your question once
you arent mixing object formats, right ? i would try to clean out the mysql directory first and then build it up as FDPIC ...
what kernel/toolchain versions are you using ?
QuoteReplyEditDelete
2008-03-27 11:59:30 Re: relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53149 Sorry for the double post..
My toolchain is : bfin-uclinux-g++ (GCC) 4.1.2 (ADI svn) (got it from mysql Makefile)
Where can I put the FDPIC option ? Directly in the Makefile ?
Is it a way to compile the mysql client library outside the uclinux/user/ directory ?
I try it but it's difficult to understand the compilation mechanisme :
I try to configure with :
./configure '--host=bfin-uclinux' '--build=i686-pc-linux-gnu' '--prefix=/home/plegal/mysql' '--sysconfdir=/home/plegal/mysql/etc' '--datadir=/home/plegal/mysql/share' '--mandir=/home/plegal/mysql/usr/share/man' '--infodir=/home/plegal/mysql/usr/share/info' '--localstatedir=/home/plegal/mysql/var/lib' '-C' '--prefix=' '--enable-dependency-tracking' '--with-named-thread-libs=-lpthread' '--without-readline' '--disable-shared' '--with-mysql=/home/plegal/opt/mysql/lib/libmysqlclient' '--with-pic' 'CC=bfin-uclinux-gcc' 'CFLAGS=-pipe -Wall -O2 ' 'CPPFLAGS=-DEMBED -D__uClinux__ -I/home/plegal/opt/blackfin/uclinuxsvn-stamp ' 'CXXFLAGS=-pipe -Wall ' 'CXX=bfin-uclinux-g++' 'LDFLAGS= -Wl,-elf2flt' 'build_alias=i686-pc-linux-gnu' 'host_alias=bfin-uclinux' --without-server --with-named-curses-libs=/home/plegal/opt/blackfin/uclinuxsvn-stamp/lib/ncurses/ncurses-5.6/ncurses/llib-lncurses
The configuration is OK but make fail.
Thanks
Philippe
QuoteReplyEditDelete
2008-03-27 12:45:46 Re: relocation reference problem with libmysqlclient.a
Mike Frysinger (UNITED STATES)
Message: 53155 what toolchain/uclinux-dist release are you using though ? the --version doesnt tell us much. did you build it yourself ? are you using svn ? are you using a release ?
are you building mysql by hand or are you using the uclinux-dist build system ?
your configure indicates you're trying to do things as FLAT, but the build snippet you posted included -mfdpic flags ... that just isnt going to work
QuoteReplyEditDelete
2008-03-27 15:45:56 Re: relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53170 Thanks for your answer,
I tried many way to get mysql compiled for my target and I mix differents toolchain...the result was the linking bug I first post...sorry...
I'll try to compile mysql's libclient directly outside the blackfin buildsystem.
The difficulty is to find informations about the parameters to give to the ./configure script.
I'll come back if I can't find a way to compile this library.
Thank again
Philippe
QuoteReplyEditDelete
2008-03-27 16:22:43 Re: relocation reference problem with libmysqlclient.a
Mike Frysinger (UNITED STATES)
Message: 53175 what pieces of mysql do you need exactly ? just the client library ?
mysql in our dist is in sorry shape, so if i could get some direction as to what people normally want, i could focus on making sure the build supports that ...
QuoteReplyEditDelete
2008-03-27 17:51:51 Re: relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53184 I'm testing the differents pieces of an web MVC framework with blackfin.
For the moment, I can make it works fine with lighttpd, clearsilver and CGI scripts in C.
I want to give a database access to that framework and I focus on compiling the client part of mysql. My goal is to put data over internet to public or dmz'ed mysql databases.
But this little piece of mysql client isn't easy to build !
Thanks for some help.
Philippe
QuoteReplyEditDelete
2008-03-27 18:01:19 Re: relocation reference problem with libmysqlclient.a
Mike Frysinger (UNITED STATES)
Message: 53185 what sort of database do you need ? if you just want something local, then sqlite is a much better fit ... and we know that works great right now
QuoteReplyEditDelete
2008-03-27 18:41:53 Re: relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53187 Yes I tried to compile sqlite : it's easy and I'm sure that it works well (I haven't tested yet).
But I need to access remote mysql databases. And I'm not sure that sqlite offer that connectivity.
I think that mysql client has the possibility to send SQL request to remote server.
With the client library, I think that I can do the work.
QuoteReplyEditDelete
2008-03-27 22:53:41 Re: relocation reference problem with libmysqlclient.a
Mike Frysinger (UNITED STATES)
Message: 53200 you're right, the default setup is not geared towards remote access, just local usage. perhaps this page may be useful:
http://www.sqlite.org/cvstrac/wiki?p=SqliteNetwork
QuoteReplyEditDelete
2008-03-28 05:16:42 Re: relocation reference problem with libmysqlclient.a
Philippe Le Gal (FRANCE)
Message: 53244 Thanks for the link, I'll try one theses solutions.
I'll feedback here if I reach my goal !
Philippe