Bug 11251 – Not able to link (Previous Definition Different)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-13T23:55:00Z
Last change time
2013-10-20T19:53:05Z
Keywords
link-failure, pull
Assigned to
nobody
Creator
michal.minich

Comments

Comment #0 by michal.minich — 2013-10-13T23:55:53Z
After building vibe.d in dmd 2.064 beta 1 as a lib I was not able to link it with application. It was working in dmd 2.063. Now I get: Error 1: Previous Definition Different : _D12__entrypoint12__ModuleInfoZ
Comment #1 by bugzilla — 2013-10-14T15:12:22Z
Need a small test case.
Comment #2 by michal.minich — 2013-10-15T01:54:27Z
(In reply to comment #1) > Need a small test case. https://mega.co.nz/#!T5ojET6S!OSP3ezBAvRkbxTtXop7a5lpOgZo1a4MMZgVxJ4fpWko I was not able to build absolutely minimal test case but you can download linked file where you will find prebuild libs using dmd 263 and 264, including source and .bat to rebuild them. Also small app that just links the file. You can find the build scripts for both compiler veresions are identical, yet the .lib fails to link when build and linked with dmd 264. Also invalid executable is generated. Description of folders: * VibeLink is test app just to link vibe*.lib file * vibe-d is latest stable release * VibeLink\build_263.bat run this to link with prebuild VibeLink\lib\vibe_dmd263_snn.lib using dmd 2.063 * VibeLink\build_264.bat run this to link with prebuild VibeLink\lib\vibe_dmd264beta1.lib using dmd 2.064 * vibe-d\build.bat run this to rebuild vibe.lib
Comment #3 by k.hara.pg — 2013-10-19T22:51:57Z
Comment #4 by github-bugzilla — 2013-10-20T12:47:58Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5a117c433d719a63e217e82232a3d0e7e83fd353 fix Issue 11251 - Not able to link (Previous Definition Different) By #2540 , implicitly defined C main has been moved to __entrypoint module. But, the codegen generates ModuleInfo symbol for the module. And vibe.d has its own main function in library. Then, compiling uer progam with vibe.d library will cause the conflict of two ModuleInfo symbols of __entrypoint module. Due to avoid ModuleInfo symbol generation for __entrypoint, I added a special case in Module::genobjfile function. But, I'm not sure that the change won't cause any other problems... https://github.com/D-Programming-Language/dmd/commit/01c985ae3e5eb5f66da8dbb46ed2c1a621fbfcac Merge pull request #2685 from 9rnsr/fix11251 [REG2.064a] Issue 11251 - Not able to link (Previous Definition Different)
Comment #5 by github-bugzilla — 2013-10-20T12:48:28Z
Commit pushed to 2.064 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9e9a329a71ab8cb7664f1b1a7bf9812231a58914 Merge pull request #2685 from 9rnsr/fix11251 [REG2.064a] Issue 11251 - Not able to link (Previous Definition Different)