digitalmars.D - workaround for `The module 'foo.bar' is already defined` when
- Timothee Cour via Digitalmars-d (9/9) Jun 10 2017 ```
- timotheecour (25/26) Jun 11 2017 NOTE: this is on linux, and the above simple case doesn't
- timotheecour (4/12) Jun 11 2017 On Sunday, 11 June 2017 at 07:09:33 UTC, timotheecour wrote:
``` dmd -shared -oflibfoo.so a1.d a2.d dmd -ofmain -L-lfoo a2.d main.d ./main ``` gives runtime error: `The module 'foo.bar' is already defined in 'main'` How would I work around this error? Use case: allow partial recompilation of a binary without rebuilding everything to optimize compile time for fast edit debug cycles.
Jun 10 2017
On Sunday, 11 June 2017 at 05:21:23 UTC, Timothee Cour wrote:```NOTE: this is on linux, and the above simple case doesn't reproduce the error, but my test case is similar albeit from a larger program that's hard to reduce. the code that crashes is in druntime: /** * Check for module collisions. A module in a shared library collides * with an existing module if it's ModuleInfo is interposed (search * symbol interposition) by another DSO. Therefor two modules with the * same name do not collide if their DSOs are in separate symbol resolution * chains. */ void checkModuleCollisions(in ref dl_phdr_info info, in immutable(ModuleInfo)*[] modules, in void[] copyRelocSection) nothrow Could someone please explain: * what that means * what's the simplest example that would exhibit this error * what's a workaround ? (where i want to do partial recompilation)
Jun 11 2017
On Sunday, 11 June 2017 at 07:09:33 UTC, timotheecour wrote:On Sunday, 11 June 2017 at 05:21:23 UTC, Timothee Cour wrote:On Sunday, 11 June 2017 at 07:09:33 UTC, timotheecour wrote: Removing `-l:libphobos2.so.0.72` from dub.json "lflags" fixed the issue, but I'd like to understand why?[...]NOTE: this is on linux, and the above simple case doesn't reproduce the error, but my test case is similar albeit from a larger program that's hard to reduce. [...]
Jun 11 2017