With gcc-3.4.3 I get:
$ gnatmake -O3 -gnatf -gnatwu -gnato -funwind-tables \
testexception.adb -g -f -largs -g -i -laddr2line -bargs -E
gcc -c -O3 -gnatf -gnatwu -gnato -funwind-tables -g testexception.adb
gnatbind -x testexception.ali
gnatlink testexception.ali -g -g -i -laddr2line
/usr/local/bin/ld: cannot find -laddr2line
I'm using binutils-2.15 (on i686 Linux).
How do I tell binutils to generate a 'libaddr2line.a' for me, that
works with gcc-3.4.3?
libaddr2line.a is a library normally built from the binutils source
distribution. GNAT relies on it for sumbolic traceback of exceptions.
Unfortunately, I am not aware of any binary distribution of GNU/Linux
that ships libaddr2line.a. I am not even sure that recent versions of
binutils (as required by recent versions of GCC) support building
libaddr2line.a.
If you're interested, AdaCore's binary distribution of GNAT 3.15p does
include this library (from binutils-2.9.1), and does support symbolic
tracebacks.
--
Ludovic Brenta.
> libaddr2line.a is a library normally built from the binutils source
> distribution. GNAT relies on it for sumbolic traceback of exceptions.
> Unfortunately, I am not aware of any binary distribution of GNU/Linux
> that ships libaddr2line.a. I am not even sure that recent versions of
> binutils (as required by recent versions of GCC) support building
> libaddr2line.a.
IIRC, libaddr2line has never been part of the official binutils, and
it's source code has not been released (probably by accident, but
still).
Jürgen Pfeifer wrote GNAT patches that invoke /usr/bin/addr2line to
resolve the addresses. This approach avoids the dependency on the BFD
library and is cleaner. Of course, it's a bit slower.
I'm not sure what the Java front end does. This code should probably
be reused.