How to compile SDL with -lefence?

Hello, I have to check my program with the “efence” memory checker.
I’m using “gentoo linux” with libsdl-1.2.5-r2
Is it an environement variable which will make sdl’s ./configure to add
my -lefence lib ?
Thanks for any help!

I suppose you can do something like:

LIBS="-lefence" ./configure

or, if your shell doesn’t like that:

export LIBS="-lefence"
./configure

Anyway, you don’t really have to do this for SDL, unless you’re
debugging SDL, or suspecting that something your code does makes SDL
do nasty things.

In fact, I’m not even sure it makes a difference who links with
efence, as long as someone does. I think libSDL.so will link with
the standard memory handling stuff even if your app links with
efence, but I could be wrong…

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Thursday 02 October 2003 23.23, Nuage wrote:

Hello, I have to check my program with the “efence” memory checker.
I’m using “gentoo linux” with libsdl-1.2.5-r2
Is it an environement variable which will make sdl’s ./configure to
add my -lefence lib ?
Thanks for any help!

Hello, I have to check my program with the “efence” memory checker.
I’m using “gentoo linux” with libsdl-1.2.5-r2
Is it an environement variable which will make sdl’s ./configure to add
my -lefence lib ?
Thanks for any help!

There’s no need to add -lefence.
Just compile everything normally (possibly using debug options) and
launch your program:

ef

To recompile SDL with debug options:

CFLAGS="-g" emerge SDL

Note that gentoo’s stable version is now 1.2.6.

Also take this note from “man efence”:

You can also use dynamic linking. If you're using a  Bourne
shell,  the  statement  export  LD_PRELOAD=libefence.so.0.0  will cause
Electric Fence to be loaded to run all dynamic executables. The  com-
mand ef command runs a single command under Electric Fence.

You can change the efence variables using the shell, too.–
[] Guido Imperiale
[] CRV?ADER//KY
[] CVI.SCIENTIA.IMPERIVM

crusaderky at libero.it
http://www.crusaderky.altervista.org

“Nam et ipsa scientia potestas est” (Knowledge is Power)
– Sir Francis Bacon (1561-1626)
Meditationes Sacrae, de Haeresibus

“I worry about my child and the Internet all the time, even though she’s
too young to have logged on yet.
Here’s what I worry about. I worry that 10 or 15 years from now, she
will come to me and say
’Daddy, where were you when they took freedom of the press away from the
Internet?’”
– Mike Godwin, Electronic Frontier Foundation
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20031003/f7fcb3e3/attachment.pgp

This is not enough, because portage strips all unnecessary (read not
exported) symbols. To prevent this add nostrip to FEATURES.On Friday 03 October 2003 19:53, CRV?ADER//KY wrote:

Hello, I have to check my program with the “efence” memory
checker. I’m using “gentoo linux” with libsdl-1.2.5-r2
Is it an environement variable which will make sdl’s ./configure
to add my -lefence lib ?
Thanks for any help!

There’s no need to add -lefence.
Just compile everything normally (possibly using debug options) and
launch your program:

ef

To recompile SDL with debug options:

CFLAGS="-g" emerge SDL