[m-dev.] For review: Enable by default the use of the external debugger
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Mar 18 07:58:02 AEDT 1999
On 11-Mar-1999, Erwan Jahier <Erwan.Jahier at irisa.fr> wrote:
>
> Enable by default the use of the external debugger on architectures that
> support sockets.
Unfortunately this change caused the nightly tests to fail on taifun
(a sparc-sun-solaris2.6 machine), because it breaks static linking.
The problem is that mercury_trace_external.o drags in -lsocket,
and -lsocket needs symbols from -lnsl. Adding -lnsl to the linker
invocation doesn't solve the problem, however, because -lnsl wants
the symbols dlopen() etc. These symbols are defined in libdl.so,
but there's no statically linkable version libdl.a because those
functions don't work for statically linked executables.
My recent change to add interactive queries would have a similar effect,
since it too uses dlopen() etc., except that currently the autoconf
stuff for that does not try using -ldl. Thus currently on
sparc-sun-solaris2.6, if you attempt to use `query' in the debugger it
simply reports "dlopen failed: sorry, not implemented: dynamic linking
not supported on this platform:". If/when we fix the autoconf stuff
to try using -ldl, we'll get the same problem with static linking.
Probably the best fix is to:
1. Ensure that ml does not try to link in the debugging libraries
(-lmer_trace -lmer_browser -lsocket -ldl)
automatically in non-debug grades. We'd add a new option -t/--trace
to ml which would cause it to link against those libraries.
This option would not be the default, but it would be implied
by --debug (or the use of a `.debug' grade).
2. Document that on platforms which have dynamic linking, programs
linked with --trace or --debug should not be linked statically.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
More information about the developers
mailing list