[dmd-internals] [PATCH] Add -sL swith to pass linker flags at the end of the linker command

Leandro Lucarella luca at llucax.com.ar
Tue Nov 1 05:53:02 PDT 2011


Hi! I'm working on generating stacktraces (in Linux) for unhandled
exceptions and other situations for D1+Tango and I came across a problem
that I can't find any way to fix but to do it in the compiler.

The problem is I need to pass -ldl to the linker, but for some reason it
has to be passed *after* the standard library. Since DMD pass all the -L
flags before it, I came up with a patch that adds a new -sL flag that
places the passed flags at the end of the linking commands.

I know Walter is not a fan of compiler flags, but I really don't see
other option (besides writing the linker command manually, which is not
really a good option). If you know another way to fix this, please let
me know. If not, please consider reviewing the patch and merging it
after any needed changes. In particular I don't know what to do with the
switch in windows, I don't know if this is needed and I don't know the
windows linker flags, so in the patch I just placed these flags after
the regular linker flags.

Thanks you.

(patch against DMD 1.071)

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
41% of all people take people with curly hair less seriously
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-sL-swith-to-pass-linker-flags-at-the-end.patch
Type: text/x-diff
Size: 4059 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20111101/2fb23817/attachment.patch>


More information about the dmd-internals mailing list