Bug 19724 – Regression: wrong order of linker arguments, again: -L-l before -L--start-group
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-03-07T11:35:36Z
Last change time
2020-03-21T03:56:32Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2019-03-07T11:35:36Z
When explicitly specifying libraries to be passed to the linker, they are reordered to the end. That's bad, because it breaks -L=--start-group and -L=--end-group.
Linker groups define a set of libraries that are evaluated circularly until all symbols are resolved.
Repro:
touch test.d
dmd -L=--start-group -L=-lfoo -L=--end-group
Expected:
cc -Xlinker --start-group -lfoo -Xlinker --end-group
Actual:
cc -Xlinker --start-group -Xlinker --end-group -lfoo
This is obviously quite useless.
Comment #1 by dlang-bot — 2019-03-07T11:38:18Z
@FeepingCreature created dlang/dmd pull request #9426 "Fix Issue 19724: wrong order of linker flags, take 2" fixing this issue:
- Fix Issue 19724.
On Linux, don't reorder -L-l flags to be before other -L flags. Only reorder -L-L.
This keeps -L-l libs and linker flags that may affect the interpretation of -l flags such as --start-group ordered correctly.
https://github.com/dlang/dmd/pull/9426
Comment #2 by dlang-bot — 2019-03-11T10:50:24Z
dlang/dmd pull request #9426 "Fix Issue 19724: wrong order of linker flags, take 2" was merged into stable:
- b89ac83d11744a49153010f311898022d78ea043 by Mathis Beer:
Fix Issue 19724.
On Linux, don't reorder -L-l flags to be before other -L flags. Only reorder -L-L.
This keeps -L-l libs and linker flags that may affect the interpretation of -l flags such as --start-group ordered correctly.
https://github.com/dlang/dmd/pull/9426
Comment #3 by dlang-bot — 2019-04-10T12:23:09Z
dlang/dmd pull request #9582 "For issue 19724, group library files explicitly listed with `-L=` in with other library-related `-L=` flags." was merged into master:
- a4f755520bda18f8b944760fe4d7ca98dad63b88 by Mathis Beer:
For issue 19724, group library files explicitly listed with `-L=` in with other library-related `-L=` flags.
https://github.com/dlang/dmd/pull/9582