Den 2009-09-03 01:56 skrev David Byron:
Even when I set LDFLAGS to -DEBUG, I can't seem to get libtool to use that
flag when building a dll. So, I want to get debug information into the .dll
but it's not there. I verified that it's not there by looking at the output
of dumpbin -all.
Here's the libtool invocation and output for the linking stage.
/bin/sh ./libtool --tag=CC --mode=link cl -MD -Zi -no-undefined -DEBUG
-export-symbols symfile -o libfoo.la -rpath /usr/local/lib
libfoo_la-public.lo libfoo_la-private.lo
You want to send -DEBUG to link.exe, not to cl.exe. I'm sure you
know this, but simply adding -DEBUG to LDFLAGS is not the way you
do this. The correct way would be to use -Wl,-DEBUG. If the msvc
stuff were complete, libtool would then feed -DEBUG to the linker.
But this does not currently work, and the main reason is that the
-link option to cl.exe is "different". It feeds all options
(instead of just one) after the -link option on the command line
to the linker, so it would be very bad to just transform -Wl,foo
into -link foo.
*snip dirty hack*
Can someone show me how to do this without hacking the libtool file?
You can work around the above -Wl,foo limitation in two ways.
1) Use the LINK enviroment variable, like this:
$ LINK="-DEBUG" /bin/sh ./libtool --tag=CC --mode=link cl -MD -Zi \
-no-undefined -export-symbols symfile -o libfoo.la \
-rpath /usr/local/lib libfoo_la-public.lo libfoo_la-private.lo
(Or LINK="-DEBUG $LINK" if you have other stuff in $LINK already)
2) Use a response file, like this:
$ cat linkdebug
-link -DEBUG
$ /bin/sh ./libtool --tag=CC --mode=link cl @linkdebug -MD -Zi \
-no-undefined -export-symbols symfile -o libfoo.la \
-rpath /usr/local/lib libfoo_la-public.lo libfoo_la-private.lo
Hope that helps.
Cheers,
Peter
_______________________________________________
http://lists.gnu.org/mailman/listinfo/libtool