ldc-developers / ldc

The LLVM-based D Compiler.
http://wiki.dlang.org/LDC
Other
1.19k stars 258 forks source link

doc generation issue #132

Closed bioinfornatics closed 12 years ago

bioinfornatics commented 12 years ago

binary generated by ldc2 do not works exactly in same way if you build .d or link .o, it is really strange.

If i build my tool dbuilder as this:

ldc2 src/dbuilder/information.d src/dbuilder/ini.dsrc/dbuilder/main.d  -of dbuilder

my array of structure Dfiles save infiormation found:

Dfiles("src/dbuilder/information.d", "build/objects/dbuilder/information.o", "build/doc/dbuilder/information.html", "build/imports/dbuilder/information.di", "src"), Dfiles("src/dbuilder/ini.d", "build/objects/dbuilder/ini.o", "build/doc/dbuilder/ini.html", "build/imports/dbuilder/ini.di", "src"), Dfiles("src/dbuilder/main.d", "build/objects/dbuilder/main.o", "build/doc/dbuilder/main.html", "build/imports/dbuilder/main.di", "src")]

If i link .o this array is empty:

ldc2 -O2 -I/usr/include/d -Isrc -c src/dbuilder/information.d -ofbuild/objects/dbuilder/information.o -Dfbuild/doc/dbuilder/information.html -Hfbuild/imports/dbuilder/information.di
ldc2 -O2 -I/usr/include/d -Isrc -c src/dbuilder/main.d -ofbuild/objects/dbuilder/main.o -Dfbuild/doc/dbuilder/main.html -Hfbuild/imports/dbuilder/main.di
ldc2 -O2 -I/usr/include/d -Isrc -c src/dbuilder/ini.d -ofbuild/objects/dbuilder/ini.o -Dfbuild/doc/dbuilder/ini.html -Hfbuild/imports/dbuilder/ini.di
ldc2 build/objects/dbuilder/information.o build/objects/dbuilder/ini.o build/objects/dbuilder/main.o -ofbuild/bin/dbuilder
[Dfiles("", "", "", "", ""), Dfiles("", "", "", "", ""), Dfiles("", "", "", "", "")]

with same source code i do not have same result if i build .d or link .o

Note : This problem appear into the nested function search inside the builder function.

dnadlinger commented 12 years ago

Test case? Also try turning off doc/.di generation, just in case there is a »rouge« version(D_Ddoc) somewhere.

bioinfornatics commented 12 years ago

i have try without doc/.di generation same result, I repeated these operation many time always same, binary work when i use .d

I do not understand what happen, then doing a test case ...

dnadlinger commented 12 years ago

Wild guess: This might be a linking issue, where some symbols are folded in one case, and kept/disambiguated as separate instances in the other case.

dnadlinger commented 12 years ago

Turns out the issue occurs when -D is passed, could be D-Programming-Language/druntime#146 if my guess from above was right.

dnadlinger commented 12 years ago

Confirmed as issue 5930.