Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 7044 - Missing a way to control the order of arguments pass… #4713

Closed
wants to merge 1 commit into from

Conversation

WalterBright
Copy link
Member

…ed to the linker makes impossible to link some programs

https://issues.dlang.org/show_bug.cgi?id=7044

Adds the -confsection=name switch.

@MartinNowak
Copy link
Member

See https://issues.dlang.org/show_bug.cgi?id=7044#c51 for a discussion of the shortcomings of this solution.

@WalterBright
Copy link
Member Author

rebased for ddmd

@andralex
Copy link
Member

andralex commented Jan 3, 2017

@WalterBright @MartinNowak ping?

@dlang-bot
Copy link
Contributor

dlang-bot commented Mar 28, 2017

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Description
7044 Missing a way to control the order of arguments passed to the linker makes impossible to link some programs

@andralex
Copy link
Member

@WalterBright @MartinNowak ping :)

…ed to the linker makes impossible to link some programs
@JinShil
Copy link
Contributor

JinShil commented Jan 15, 2018

I don't care for this solution for much the same reason @MartinNowak mentioned in the bug report and because I think better solutions exist.

I don't think -defaultLib and -debugLib should exist and be given special treatment by the compiler. Rather I think the problem should be generalized and phobos/druntime should be treated just like any other library. If we want to link libraries by default, then those libraries should be added to the default DFLAGS in dmd.conf.

Then to address linker order, we simply use the order specified on the command line appended or prepended to DFLAGS. If we want to make it even more flexible, we can append an order to the -L flag, so -L2=xxx -L0=yyy -L2=www -L1=zzz would create linker flags in the order of yyy zzz xxx www. -L with no order number will always go last (or first if you prefer).

To mitigate breakage, we can always place -defaultLib and -debugLib at -L2 (or some other middle of the road order), so users can easily place libraries before or after at their discretion without overriding the default DFLAGS.

If users need to override the defaults in dmd.conf, they can always do -conf= and build the command line from scratch.

@ibuclaw ibuclaw self-assigned this Jan 30, 2018
@ghost ghost added the Needs Rebase label Aug 15, 2020
@WalterBright
Copy link
Member Author

Should be completely re-evaluated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants