[TRE-general] system-abi

Ville Laurikari ville at laurikari.net
Mon Jan 1 15:38:18 EET 2007


On Fri, Dec 29, 2006 at 09:17:31PM -0500, William J Poser wrote:
>

> I am wondering about the configuration option --enable-system-abi
> and the default to disabled.  In one of my programs that uses
> libtre, I have found that if I use the default configuration I get
> segmentation faults in apparently random circumstances.  I can avoid
> them in two ways.  One is to configure with --enable-system-abi.
> The other, which I discovered by a chain of experiments I no longer
> recall, is to include "regex.h" rather than <tre/regex.h>.

This sounds like you are not linking your program with libtre.  If you
compile a program against <tre/regex.h> but don't link with -ltre,
you'll get the regexp functions from the C library.  This will work
only if TRE was built with --enable-system-abi.

You could try to add a call to tre_version() or something in your
program.  This way you will get errors at link time if -ltre is
missing.

> And could someone perhaps explain exactly what the system-abi
> compatibility options do and why disabled is the default?  Thanks.

This was discussed on this list a while ago.  Try these:
  http://laurikari.net/pipermail/tre-general/2006-May/000034.html
  http://laurikari.net/pipermail/tre-general/2006-May/000044.html

In summary, --enable-system-abi makes libtre ABI/link-time compatible
(as opposed to just API/compile-time compatible) with the system
regexp library.  At least to some extent, that is.  The main use case
is to use
  LD_PRELOAD=libtre.so some-program
to run `some-program' using libtre instead of the system regexp
library for regexp matching.

--
http://www.iki.fi/vl/


More information about the TRE-general mailing list