ldc-developers / ldc

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

dlib doesn't build in either debug or release mode #955

Closed ronniec95 closed 7 years ago

ronniec95 commented 9 years ago

https://github.com/gecko0307/dlib

Doesn't appear to build with an assertion failure

Debug Mode

echo dlib\coding\huffman.d >Debug\dlib.build.rsp echo dlib\coding\package.d >>Debug\dlib.build.rsp echo dlib\coding\varint.d >>Debug\dlib.build.rsp ... ldc2 -m64 -gc -X -Xf="Debug\dlib.json" -deps="Debug\dlib.dep" -c -od="Debug" @Debug\dlib.build.rsp -oq if errorlevel 1 goto reportError

echo huffman.obj >Debug\dlib.build.lnkarg echo package.obj >>Debug\dlib.build.lnkarg ... ar cru "Debug\dlib.lib" @Debug\dlib.build.lnkarg

fails with

Assertion failed: (p == 'e' || p == 'E') && "Invalid character in significand", file D:\Temp\LDC-BUILD\src\llvm-3.6.0.src\lib\Support\APFloat.cpp, line 272

Release Mode

echo dlib\coding\huffman.d >Release\dlib.build.rsp echo dlib\coding\package.d >>Release\dlib.build.rsp echo dlib\coding\varint.d >>Release\dlib.build.rsp ... "H:\apps\VisualD\pipedmd.exe" ldc2 -lib -m64 -release -X -Xf="Release\dlib.json" -deps="Release\dlib.dep" -of="Release\dlib.lib" -L/MAP:"Release\dlib.map" @Release\dlib.build.rsp

\ fails with **

Assertion failed: !(Pair.first != Ty && Pair.second == Ty) && "mapping to a source type", file D:\Temp\LDC-BUILD\src\llvm-3.6.0.src\lib\Linker\LinkModules.cpp, line 265

This fails before getting to the linking step unlike Debug mode

Found the file that doesn't work:-

dlib.geometry.ray.d: struct Ray { Vector3f p0; Vector3f p1; float t;

// Commenting out this constructor seems to fix the problem this(Vector3f begin = Vector3f(), Vector3f end = Vector3f()) { p0 = begin; p1 = end; } }

redstar commented 9 years ago

Which version and operating system do you use? The first failure looks like you are using Windows. The problem is fixed in the current development trunk merge-2.067. The second failure is #821 and #855 which is an LLVM bug.

redstar commented 9 years ago

I checked ldc2 0.15.1 on Linux that dlib can be build in debug mode.

ronniec95 commented 9 years ago

Both errors on windows. OK will wait till milestone 0.15.2 release before checking again. Back to dmd on windows.

kinke commented 7 years ago

Latest dlib 0.10.1 can be built successfully with LDC 1.2-beta2 (both debug and release configs).