November 18, 2016
Look again, now there is only 5 not defined symbols:

============================
$ dmd `find . -iname "*.d"` C:\\cygwin\\bin\\Cygwin1.lib
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\D\dmd2\windows\bin\..\lib\snn.lib(io)  Offset 02657H Record Type 00C3
 Error 1: Previous Definition Different : _close
C:\D\dmd2\windows\bin\..\lib\snn.lib(io)  Offset 0271CH Record Type 00C3
 Error 1: Previous Definition Different : _remove
time.obj(time)
 Error 42: Symbol Undefined _fstat64
time.obj(time)
 Error 42: Symbol Undefined _open64
time.obj(time)
 Error 42: Symbol Undefined _stat64
time.obj(time)
 Error 42: Symbol Undefined _lstat64
time.obj(time)
 Error 42: Symbol Undefined _readdir64
Error: linker exited with status 216919688
============================

But there is _fstat64:

============================
$ nm /bin/cygwin1.dll | grep _fstat64
610f4550 T __fstat64_r
610dd402 T __sigfe_fstat64
610f43b0 T _fstat64
============================

What maybe the problem??
November 18, 2016
On Friday, 18 November 2016 at 10:43:09 UTC, unDEFER wrote:
> [...]

You have to link with the cygwin.dll to get the symbols.
That is not not done by default I presume.
November 18, 2016
On Friday, 18 November 2016 at 10:54:52 UTC, Stefan Koch wrote:
> You have to link with the cygwin.dll to get the symbols.
> That is not not done by default I presume.

Look attentive, I have done on the last message, cygwin1.lib, which I have created with implib. But 64-bit functions was not found. But there is these functions...
It must be easy, but I can't find the decision.
November 18, 2016
On Friday, 18 November 2016 at 10:43:09 UTC, unDEFER wrote:

>  Error 1: Previous Definition Different : _close
>  Error 1: Previous Definition Different : _remove

Also there is these 2 problem. How to make linker to choose functions from cygwin.dll and ignore other definitions?
November 18, 2016
So.. I have changed my cygwin/core/sys/posix/config.d
> enum _FILE_OFFSET_BITS   = 64;
to
> enum _FILE_OFFSET_BITS   = 32;

and now I have only these 3 problems:

===============================
$ dmd `find . -iname "*.d"` C:\\cygwin\\bin\\Cygwin1.lib
OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
C:\D\dmd2\windows\bin\..\lib\snn.lib(io)  Offset 02387H Record Type 00C3
 Error 1: Previous Definition Different : _open
C:\D\dmd2\windows\bin\..\lib\snn.lib(io)  Offset 02657H Record Type 00C3
 Error 1: Previous Definition Different : _close
C:\D\dmd2\windows\bin\..\lib\snn.lib(io)  Offset 0271CH Record Type 00C3
 Error 1: Previous Definition Different : _remove
Error: linker exited with status 216661336
===============================

I still don't know where defined open/close/remove, but I need to use cygwin versions and I don't know how to make linker to choose it..
November 18, 2016
So, I seems need to rebuild dmd, exactly snn.lib without open/remove/close. Now I have the next error:

========================================================================
$ make -fwin32.mak
cd src
make -f win32.mak auto-tester-build
make -fwin32.mak C=backend TK=tk ROOT=root MAKE="make" HOST_DC="dmd" DMODEL= CC="dmc" LIB="lib" OBJ_MSVC="" "OPT=-o" "DEBUG=" "DDEBUG=" "DOPT=-O -release -inline" "LFLAGS=-L/delexe/la" dmd.exe
Target 'dmd.exe' is up to date

dmd -run checkwhitespace aggregate.h aliasthis.h arraytypes.h    attrib.h complex_t.h cond.h ctfe.h ctfe.h declaration.h dsymbol.h       enum.h errors.h expression.h globals.h hdrgen.h identifier.h idgen.d    import.h init.h intrange.h json.h lexer.h       mars.h module.h mtype.h nspace.h objc.h                          scope.h statement.h staticassert.h target.h template.h tokens.h        version.h visitor.h objc.d access.d aggregate.d aliasthis.d apply.d argtypes.d arrayop.d        arraytypes.d attrib.d builtin.d canthrow.d clone.d complex.d            cond.d constfold.d cppmangle.d ctfeexpr.d dcast.d dclass.d              declaration.d delegatize.d denum.d dimport.d dinifile.d dinterpret.d    dmacro.d dmangle.d dmodule.d doc.d dscope.d dstruct.d dsymbol.d dtemplate.d dversion.d entity.d errors.d escape.d                       expression.d func.d globals.d hdrgen.d id.d identifier.d imphint.d      impcnvtab.d init.d inline.d intrange.d json.d lexer.d lib.d link.d      mars.d mtype.d nogc.d nspace.d objc_stubs.d opover.d optimize.d parse.d         sapply.d sideeffect.d statement.d staticassert.d target.d tokens.d      safe.d  traits.d utf.d utils.d visitor.d libomf.d scanomf.d typinf.d  libmscoff.d scanmscoff.d statementsem.d irstate.d toctype.d glue.d gluelayer.d todt.d tocsym.d toir.d dmsc.d backend/bcomplex.d backend/cc.d backend/cdef.d backend/cgcv.d backend/code.d backend/dt.d backend/el.d backend/global.d  backend/obj.d backend/oper.d backend/outbuf.d backend/rtlsym.d  backend/ty.d backend/type.d tk/dlist.d s2ir.c e2ir.c  toobj.c tocvdebug.c toir.h  irstate.h iasm.c  toelfdebug.d libelf.d scanelf.d libmach.d scanmach.d  tk.c eh.c objc_glue_stubs.c objc_glue.c  irstate.d toctype.d glue.d gluelayer.d todt.d tocsym.d toir.d dmsc.d root\root.h root\stringtable.h  root\longdouble.h root\outbuffer.h root\object.h root\ctfloat.h  root\filename.h root\file.h root\array.h root\rmem.h root\newdelete.c  root\rmem.d root\stringtable.d root\man.d root\port.d  root\response.d root\rootobject.d root\speller.d root\aav.d  root\ctfloat.d root\outbuffer.d root\filename.d  root\file.d root\array.d
Error: cannot find source code for runtime library file 'object.d'
       dmd might not be correctly installed. Run 'dmd -man' for installation instructions.
       config file: C:\cygwin\home\unDEFER\dmd-sources\src\sc.ini
Specify path to file 'object.d' with -I switch

--- errorlevel 1

--- errorlevel 1
========================================================================

At the first seems needed to be fix:
> DMODEL=
and
> OBJ_MSVC=""

But I don't know what to write there.

Also in the sources I can't find any build instructions of snn.lib:
===========
$ grep -Ir snn .
./src/glue.d:                objmod.includelib("snn.lib");          // bring in C runtime library
===========

So how to recompile snn.lib?
November 18, 2016
So, I know now, that dmd, druntime and phobos are three different repositories...
I have compiled druntime, phobos, but never found snn.lib.
Where snn.lib sources???
November 18, 2016
On Friday, 18 November 2016 at 16:40:14 UTC, unDEFER wrote:
> Where snn.lib sources???

http://digitalmars.com/shop.html

It is considered part of the proprietary compiler source. You can't build it yourself without buying a license.
November 18, 2016
On Friday, 18 November 2016 at 16:53:02 UTC, Adam D. Ruppe wrote:
> On Friday, 18 November 2016 at 16:40:14 UTC, unDEFER wrote:
>> Where snn.lib sources???
>
> http://digitalmars.com/shop.html
>
> It is considered part of the proprietary compiler source. You can't build it yourself without buying a license.

Wow, Thank you! I have bought. I'm waiting instructions for download.
November 20, 2016
On Friday, 18 November 2016 at 17:33:41 UTC, unDEFER wrote:
> Wow, Thank you! I have bought. I'm waiting instructions for download.

Google is a stranger to fear: it have sent to spam the message from Walter Bright himself!
Walter prompt to me LIB.EXE utility, and I have removed from snn.lib "io" module.
After it I have written short file to hide 2 undefined symbols:
======================================
$ cat cygwin/snn_io.d
module cygwin.snn_io;

extern(C):
version (Windows):

ubyte[512] __fhnd_info;

void _dos_sethandlecount(long count)
{
}
======================================

And the result:

$ ./try.exe
-bash: ./try.exe: cannot execute binary file: Exec format error

Ha-ha :-)))) LOL

I don't know what to do more.. Seems I will close this theme..
So work with cygwin under D is impossible..