errno_c.obj in druntime

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Sat Aug 9 11:54:20 PDT 2014


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.


More information about the Digitalmars-d mailing list