Bug 13836 – DMD linker (v2.066) not working with older "ld"
Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-12-08T22:00:00Z
Last change time
2017-06-26T01:44:18Z
Assigned to
nobody
Creator
lh3
Comments
Comment #0 by lh3 — 2014-12-08T22:00:53Z
On CentOS5, compiling a simple D2 program with dmd-2.066 will fail with the following message:
/usr/bin/ld: cannot find -l:libphobos2.a
This is because dmd is calling "gcc -l:libphobos2.a" during the linking phase (as is seen from "dmd -v"). Such a syntax "-l:libphobos2.a" is only supported by recent "ld". The system "/usr/bin/ld" on CentOS5 is too old. There are two solutions on my side:
1. Install "ld" from a more recent GNU-binutils, or
2. Manually link with "gcc -lphobos2" instead of "-l:libphobos2.a".
Both work for me. CentOS5 is still used on some old HPC clusters. I hope the binary release of DMD could consider this. Thank you.
BTW, the issue is related to this thread: <http://www.digitalmars.com/d/archives/digitalmars/D/Linker_not_working_under_dmd_228585.html>
Comment #1 by dlang-bugzilla — 2017-06-26T01:44:18Z
Generally, the solution to situations where you are forced to use unusually old software is to use similarly old software. Old releases of D are available at http://downloads.dlang.org/releases/2.x/.
As this bug was filed over 2 years ago, I'm going to close it; please reopen if you think this issue is still relevant today.