[Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Oct 21 11:05:38 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7044


Leandro Lucarella <leandro.lucarella at sociomantic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|pull                        |


--- Comment #3 from Leandro Lucarella <leandro.lucarella at sociomantic.com> 2012-10-21 11:05:35 PDT ---
See the (deprecated) pull request for more discussion on the topic.

Here I propose a solution that's simple, backwards compatible, and works the
same way DMD already does in terms of environment variables and switches.

We just need to extend -defaultlib and -debuglib to accept not only the name of
the standard library but any other linker flag needed. A simple heuristic
should be enough, like if the argument starts with "-" or "/" it should be
considered raw arguments to pass to the linker instead of just a library name.

This way you could use just -defaultlib=phobos2 or a more complex
-defaultlib="-lphobos2 -lrt -ldl". When using the (deprecated) old way, we can
still add the needed hardcoded linker flags until at some point it can be not
supported anymore and just pass it as raw linker arguments wihout any heuristic
to detect the old behaviour.

This way you can control which runtime to use either in the command line, in
the dmd.conf or in the DFLAGS enviroment variable, with the usual overriding
rules (you can specify a system default in the dmd.conf file, override it in
your user's setup or Makefile using the DFLAGS environment variable and even
override that using regular command line arguments when invoking dmd.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list