Bug 9311 – shared library file extension incorrectly modified

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-01-12T22:26:00Z
Last change time
2015-06-09T05:11:53Z
Assigned to
nobody
Creator
g.sayol

Comments

Comment #0 by g.sayol — 2013-01-12T22:26:50Z
On Linux, when generating a shared library and the file extension given to "-of" is not "so", dmd always replaces it with "so". i.e. $ dmd -shared -oflibfoo.so.0.2.6 foo.o generates "libfoo.so.0.2.so" when expected "libfoo.so.0.2.6" "release" version number is incorrectly replaced by "so"
Comment #1 by andrej.mitrovich — 2013-01-13T08:15:11Z
My guess is this is to blame in dmars.c: // None of that a.out stuff. Use explicit exe file name, or // generate one from name of first source file. global.params.exefile = FileName::forceExt(global.params.exefile, global.dll_ext)->toChars(); If the only thing wanted is to replace "a.out" with "a.so", then `forceExt` should check the extension before attempting to replace it. @Walter what's your take?
Comment #2 by bugzilla — 2013-04-28T13:37:05Z
Comment #3 by github-bugzilla — 2013-05-04T19:43:04Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fec3a379278f7d5b096295c24ff88b0fc5cbd3fa fix Issue 9311 - shared library file extension incorrectly modified https://github.com/D-Programming-Language/dmd/commit/ab4ec8df244d3948e56dc88efda2aba571b4969b Merge pull request #1944 from WalterBright/fix9311 fix Issue 9311 - shared library file extension incorrectly modified
Comment #4 by github-bugzilla — 2013-05-04T23:39:49Z
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/7fab11e61609ada6eee4140f0888305b13262b7e Merge pull request #1944 from WalterBright/fix9311 fix Issue 9311 - shared library file extension incorrectly modified
Comment #5 by g.sayol — 2013-05-05T02:36:11Z
Fixed bug with Walter's pull request https://github.com/D-Programming-Language/dmd/pull/1944 Many thanks!