www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - errno_c.obj in druntime

reply "Maxim Fomin" <maxim-fomin outlook.com> writes:
Currently I am building dmd on win64. For some reason some phobos 
code references getErrno() function in errno_c.obj and that 
object file is not included into final binary (linker issues 
symbol absence error - by the way I don't remember it was needed 
on linux). It can be avoided by adding file into linking list, 
however it is only x86 version and during building win64 linker 
issues error due to model mismatch.

1) Why two trivial functions should be placed into separate .c 
file compounding win64 buildings headache instead of placing it 
somewhere in druntime among other D code?

2) How to avoid it? It comes to my mind to write two functions in 
D, compile with -m64 -c, replace x86 version with x64 version, 
add to gitignore, but then there would be repo syncing issues. 
Anyway it seems to be a too strange way to build a project.

P.S.
What's so wrong with D on win64? I had nothing close to win64 
building difficulties when was dealing with linux x64 or x86.
Aug 09 2014
parent "Sean Kelly" <sean invisibleduck.org> writes:
On Saturday, 9 August 2014 at 17:06:00 UTC, Maxim Fomin wrote:
 Currently I am building dmd on win64. For some reason some 
 phobos code references getErrno() function in errno_c.obj and 
 that object file is not included into final binary (linker 
 issues symbol absence error - by the way I don't remember it 
 was needed on linux). It can be avoided by adding file into 
 linking list, however it is only x86 version and during 
 building win64 linker issues error due to model mismatch.

 1) Why two trivial functions should be placed into separate .c 
 file compounding win64 buildings headache instead of placing it 
 somewhere in druntime among other D code?
errno is typically implemented as a macro and often can't be directly translated to D code.
 2) How to avoid it? It comes to my mind to write two functions 
 in D, compile with -m64 -c, replace x86 version with x64 
 version, add to gitignore, but then there would be repo syncing 
 issues. Anyway it seems to be a too strange way to build a 
 project.
I don't think we should have precompiled object files in git. The .c file should be there and explicitly compiled along with everything else.
Aug 09 2014