-1

I build openocd on windows using cygwin. Steps followed:

But when I tried to use this openocd on another system, it asked for a few cygwin dlls. Is there any way to escape from requiring cygwin dlls when using openocd.

Clifford
  • 88,407
  • 13
  • 85
  • 165
anandamu16
  • 103
  • 1
  • 2
  • 9

2 Answers2

2

Build using MinGW/msys2 rather than Cygwin. MinGW builds native Windows applications with GCC rather than emulating a Linux runtime environment.

The method is described here: http://www.playembedded.org/blog/en/2015/10/11/building-openocd-under-windows-using-msys2/

You can also get prebuilt Windows binaries from http://www.freddiechopin.info/en/download/category/4-openocd, which is far simpler.

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • But building openocd with MinGW will contain some MinGW dependencies. Pls correct me if my assumption is wrong. I want to build openocd without any dependencies. I can't use Binaries directly as I am planning to write cfg files for board. – anandamu16 Aug 03 '17 at 03:51
  • 1
    Cygwin apps require the Cygwin run time environment in inorder to support the POSIX API in the GNU C library, MinGW uses Microsoft's C runtime library already included in the Windows installation. Consequently MinGW apps do not support POSIX calls not available in Windows such as `fork`. So some POSIX dependant code will require modification, but since the pre-built openocd can be built with MinGW, that should not be an issue, or is already dealt with in the source. – Clifford Aug 03 '17 at 05:54
  • 1
    Looking at the page I linked openocd on Windows does have DLL dependencies but these are related to USB support and pthreads rather than being MinGW dependencies; there is no getting away from that without static linking. – Clifford Aug 03 '17 at 06:10
  • Ok, Can you describe me, is there any way to build openocd via static linking.? I mean using static argument while doing. /configure will that work or is there any other way to do this? – anandamu16 Aug 05 '17 at 15:22
  • 1
    I have no idea; even if technically possible, it is possible that the library licences make it undesirable. Personally, I would use the pre-built binary/installation package, and get on with the real work of building applications rather than building tools. – Clifford Aug 05 '17 at 16:48
0

If anyone is still facing the same issue, I have updated the openocd.git with a github action that automatically generates Windows binary archives for releases and all master commits.