AFAIK, the Cygwin build using a windows native tool chain has been broken for years. There is no advice anyone can give that that is just going to make it work. It is broken and no one has interest in fixing that which they have broken. People make many changes to the build system but never test on Cygwin with a native toolchain.

The basic Cygwin environment is a GNU/POSIX environment equivalent to the GNU/Linux environment. It is slower for two reasons: The fork() emulation under Cygwin is notoriously slow and the run-time virus detection interferes with every compilation. Tuning things and turning off virus checks can greatly improve performance. We have had 7 second Cygwin builds in the distant past.

The other issue is the toolchain that you use. If you build a GCC toolchain from scratch under Cygwin, then the build probably still works. That is a pure POSIX environment. But most people want to use a Windows native toolchain like the one that comes with Microchip Studio. That does not work in a POSIX environment and the complexity skyrockets:

 * The configuration has to be changed to specify that you use a
   Windows native tool chain (as reflected by the build WINTOOL setting).
 * All of the build paths are standard POSIX paths like
   /cygdrive/c/a/b/c. All of the paths provided as input to the Windows
   native tool have to be converted to Windows paths like C:\a\b\c
 * Similarly, all paths generated by the Windows native toolchain will
   be such Windows paths and must be converted to POSIX paths to be
   used by the build system.
 * In order for the back slash to be usable by make system or passed on
   as a command line argument, it has to be quoted in some fashion,
   perhaps like "C:\a\b\c"
 * When a quoted path is passed on the command line, it gets de-quoted.
   That is, if you passed "C:\a\b\c", it will be received like
   C:\a\b\c. It has been modified. If you tried using it again, it
   becomes C:abc which is useless.

This was all carefully balanced and used for many years. NuttX was developed primarily on Cygwin with a native tool chain. But that has been thrown in the shitter. At this point, it is not not worth resurrecting it. Some one will just break it again since it does not get testing by the CI.

Reply via email to