Xavier-Francois Roblot on Wed, 20 Jun 2007 16:55:42 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Compilation for debugging

On Wed, 2007-06-20 at 16:29 +0200, Bill Allombert wrote:
> On Wed, Jun 20, 2007 at 03:52:22PM +0200, Xavier-Francois Roblot wrote:
> > Hi,
> > 
> > I have a C-file called series.c that contains a certain number of
> > functions that I use in GP files using install. Previously, when it did
> > not work properly, I was able to compile it in debug mode and run it
> > with dbg to find out what was going on. But when I try to do that now, I
> > get the following error:  
> > 
> > gcc -c -g -o series.o -Wall -fPIC -I/home/roblot/pari/installed/include series.c -L/home/roblot/pari/Olinux-i686.dbg -L/usr/lib && gcc -o series.so -shared -Wall -fPIC -fomit-frame-pointer -Wl,-shared series.o -L/home/roblot/pari/Olinux-i686.dbg -lc -ldl -lm -L/usr/lib -lpari
> > /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../i686-pc-linux-gnu/bin/ld: avma: TLS reference in series.o mismatches non-TLS definition in /home/roblot/pari/Olinux-i686.dbg/libpari.so section .bss
> > /home/roblot/pari/Olinux-i686.dbg/libpari.so: could not read symbols: Bad value
> > collect2: ld returned 1 exit status
> > make: *** [debug] Error 1
> > 
> > For information, I am using GCC v.4.1.2.
> > 
> > If anybody can help, I would be very grateful since it is quite
> > difficult to debug a big program without using gdb :o)
> I wonder whether you have used the option --enable-tls when configuring
> PARI. This breaks the ABI, so you have to do it also for the debugging 
> build.  You cannot use the TLS headers with a non-TLS libpari.

Indeed, I was using the --enable-tls option for the (normal)
configuration of PARI, but not for the debugging configuration. Somehow,
I thought the two were not linked, but they are. Anyway, adding the same
option to the debugging configuration makes the compilation possible. 

Thanks a lot!