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

Re: Porting valgrind to Debian/kFreeBSD



On Tue, Mar 05, 2013 at 06:36:26PM +0100, Carlos Alberto Lopez Perez wrote:
> Hi!
> 
> From some time ago there is available a port of Valgrind to FreeBSD [1]
> 
> I tried to compile it on Debian/kFreeBSD, and after some patching
> I was able to compile it on kfreebsd-amd64 sid (didn't tested i386).
> 
> Here are some quick instructions to replicate what I did
> (valgrind_kfreebsd.patch is attached)
> 
> # wget https://bitbucket.org/stass/valgrind-freebsd/downloads/valgrind-freebsd-3.8.0.tar.bz2
> # tar xfav valgrind-freebsd-3.8.0.tar.bz2
> # cd valgrind-freebsd-3.8.0
> # wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' -qO config.guess
> # wget 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' -qO config.sub
> # cat /tmp/valgrind_kfreebsd.patch | patch -p1
> # ./autogen.sh
> # ./configure --prefix=/usr --enable-only64bit
> # make
> # make install [2]
> 
> However, it don't works as expected when you run it.
> 
> It fails with the error:
> cannot set up thread-local storage: cannot set %fs base address for thread-local storage
> 
> Which I have no real idea about how to fix.

The error message does not come from valgrind, but from the libc.

According to [0], FreeBSD fully supports TLS only on i386 and ia64 which kinda
explains why your amd64 build does not run (that page looks old though). Try
disabling TLS explicitly on the valgrind build by passing --disable-tls to
./configure.

Cheers

[0] https://wiki.freebsd.org/ThreadLocalStorage

-- 
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'

Attachment: signature.asc
Description: Digital signature


Reply to: