[Issue 6019] Phobos imports in autogenerated .di header files break implicit linking with DLLs

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 17 23:57:42 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6019


Rainer Schuetze <r.sagitario at gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario at gmx.de


--- Comment #5 from Rainer Schuetze <r.sagitario at gmx.de> 2011-05-17 23:53:29 PDT ---
The import in the di file tells the compiler that there are dependencies to
other modules that need to be respected during module initialization. That's
why they are placed into the module info.

I agree it is very annoying not to be able to use the generated di files (let
alone the d files). Two possible solutions:

- add a switch to the compiler to only put exported symbols into the di file
and leave out imports. This might make it difficult to compile this file if
there are still references to symbols defined by the imports.

- add a modifier to the "import" declaration that avoids adding dependencies to
the module info. (IIRC this has also been discussed to break cyclic module
initialization.) If used in driver.d, it might even restrict imported symbols
to the symbols marked "export" in the di file. If used for the imports of the
generated di-file, it might break the correct init order when used for modules
built to static libraries (as druntime).

BTW: I checked the generated object files: the buggy version also adds symbols
_D47TypeInfo_S3std6traits15__T8DemangleTkZ8Demangle6__initZ and
_D3std6traits15__T8DemangleTkZ8Demangle6__initZ. I don't know why this happens,
but as these are comdats, they problably won't break anything.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list