May 21, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #42 from Leandro Lucarella <leandro.lucarella@sociomantic.com> --- (In reply to Walter Bright from comment #41) > (In reply to Leandro Lucarella from comment #40) > > Will -confsection=debug be automatically added when -debug is specified? > > No. You'll have to add -confsection=debug to have a [debug] section parsed. We can always add such a feature later, but it would be very hard to subtract it if it turns out to not be right. How is this then different from just specifying a whole new config file? > > For cross-compiling it might be useful to also automatically enable other predefined sections, similar to -version, like linux, x86_64, etc., which is what I think Marting was suggesting. But that would be an extra feature. > > I'd rather do without such, preferring to keep things simple and easy to explain. Same question as above. The whole point of this issue, IMHO, is to select different config options (specifically link flags) automatically depending on how you are building your project. The user shouldn't care about the runtime needing different flags when using -debug or not. The user should be required to just use -debug when he wants to use the debug version of the library, not -debug -confsection=debug, that's overly cryptic IMHO. And not (much) better than what we have now (-debug -config=/whatever/config.debug.ini). -- |
May 22, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 Dicebot <public@dicebot.lv> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |public@dicebot.lv --- Comment #43 from Dicebot <public@dicebot.lv> --- I see two distinct issues here: 1) getting rid from automatic linker flags inserted by compiler and make it fully controllable by packager (preferrably via dmd.conf) instead. This is actual issue that needs to be solved 2) allowing to specify distinct debug library in dmd.conf - this is only needed to enable interface compatibility after (1) is fixed Last proposal seems to address (2) perfectly but not (1) which was the main issue here (because manual intervention with adding compiler flags to build system is required) -- |
June 03, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #44 from Walter Bright <bugzilla@digitalmars.com> --- > How is this then different from just specifying a whole new config file? Because multiple sections can be selected, rather than having a separate config file for each combination of sections, which would be a combinatorial explosion. > The user should be required to just use -debug when he wants to use the debug version of the library, I agree, but I'd like to try this out first to see what the common usage patterns will be, and then adding those later. If we add them now, we may wind up with a bunch of useless clutter that we cannot remove because we don't want to break legacy makefiles. > getting rid from automatic linker flags inserted by compiler and make it fully controllable by packager (preferrably via dmd.conf) instead. This is actual issue that needs to be solved Linker flags can already be specified with the -L switch. The trouble is the order of them. I just do not have a good idea for that, and yet still have the compiler conveniently generate them. It's also good to keep in mind that all dmd does is generate a command line for gcc - that can always be done by the user. Pull 497 does add a switch to add linker switches in front, but I feel this is simply doomed - what happens when a linker switch is needed in the middle? -- |
June 03, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #45 from Dicebot <public@dicebot.lv> --- Leandro is currently on vacation. I suggest to pause this until he is back. -- |
June 03, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #46 from Walter Bright <bugzilla@digitalmars.com> --- https://github.com/D-Programming-Language/dmd/pull/4713 -- |
June 03, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #47 from Walter Bright <bugzilla@digitalmars.com> --- (In reply to Dicebot from comment #45) > Leandro is currently on vacation. I suggest to pause this until he is back. Sure, and meanwhile there's a pull request we can talk about whenever everyone is ready. -- |
June 09, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 Andrei Alexandrescu <andrei@erdani.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|D1 & D2 |D2 -- |
June 15, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #48 from Leandro Lucarella <leandro.lucarella@sociomantic.com> --- (In reply to Walter Bright from comment #44) > > How is this then different from just specifying a whole new config file? > > Because multiple sections can be selected, rather than having a separate config file for each combination of sections, which would be a combinatorial explosion. I don't see how this could explode, as you only need 2: normal and debug. But maybe I'm just looking at my limited use case... > > The user should be required to just use -debug when he wants to use the debug version of the library, > > I agree, but I'd like to try this out first to see what the common usage patterns will be, and then adding those later. If we add them now, we may wind up with a bunch of useless clutter that we cannot remove because we don't want to break legacy makefiles. OK, I can see your concern and conservative approach to the problem. In our particular case, is not something we can test really, to test it you are breaking all our makefiles anyway, as we need to add the new extra flags for the case where we want to build a debug version, so the "do not break the users build system" is not working very well with this approach :) > > getting rid from automatic linker flags inserted by compiler and make it fully controllable by packager (preferrably via dmd.conf) instead. This is actual issue that needs to be solved > > Linker flags can already be specified with the -L switch. The trouble is the order of them. I just do not have a good idea for that, and yet still have the compiler conveniently generate them. It's also good to keep in mind that all dmd does is generate a command line for gcc - that can always be done by the user. Again, this is not a satisfactory solution. We are not talking about users code here, we are using about the runtime. You can't ask the user to link manually just because the compiler can't let the runtime pick the right linker flags to compile a simple hello world. > Pull 497 does add a switch to add linker switches in front, but I feel this is simply doomed - what happens when a linker switch is needed in the middle? Yeah, I agree the current approach suggested here is superior, is just for me the solution is not that useful unless you have a section automatically selected when -debug is used. Let's recap the current problems/facts: * The compiler automatically adds some -llib to the linker command-line, hardcoded with a particular order. This is not good because it highly depends on the runtime implementation, so it shouldn't be done by the compiler. * The compiler links against 2 different libraries depending on whether -debug was specified or not (and according to -defaultlib and -debuglib). So if the runtime uses different libraries in debug and default mode, it might need to pass different linker flags. About the solution, I think the requirements are: * There should be no user intervention to be able to compile a program only depending on the runtime/base library, either using -debug or not (all the linker flags configuration should be set by the runtime developer/packager via configuration files). Do we at least agree on these basic problems and requirements for a solution? -- |
August 09, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #49 from Martin Nowak <code@dawg.eu> --- Great to see some momentum for this. We also need something like this to select different libs based on m32coff or the installed VC version, see https://github.com/D-Programming-Language/druntime/pull/1341. -- |
August 09, 2015 [Issue 7044] Missing a way to control the order of arguments passed to the linker makes impossible to link some programs | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=7044 --- Comment #50 from Dicebot <public@dicebot.lv> --- Leandro is on (quite long) sick leave right now. I will start poking Walter again about this issue once he is back. -- |
Copyright © 1999-2021 by the D Language Foundation