Re: [Openocd-development] Build error with mingw32
On Sun, Aug 14, 2011 at 6:39 AM, Steve Bennett ste...@workware.net.au wrote: I pushed a change to jimtcl git which will use Sleep() if usleep() is unavailable on mingw32. Now building OpenOCD with latest jimtcl with mingw32 works for me. Thank you! Jie ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On Aug 14, 2011 10:01 AM, Xiaofan Chen xiaof...@gmail.com wrote: On Sat, Aug 13, 2011 at 9:38 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Aug 12, 2011 at 9:27 PM, Xiaofan Chen xiaof...@gmail.com wrote: This is probably because you have a very old version of MinGW and MinGW Win32-API. Seems to be a problem with Debian. http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/ Debian seems to ship a 3-year old MinGW Win32-API. http://packages.debian.org/search?searchon=sourcenameskeywords=mingw32 Hmm, good point. I have written an email to the mingw32-runtime package maintainer of Debian to see if he has any plan to update it to the latest version. Hmm, it seems you are out of luck. The Debian MinGW32 maintainer seemed to think there is a licensing issue somewhere and refused to update. You may have to build your own 3.17 version as in the following thread. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498529 Ubuntu has it updated since 9.10 but still stuck with the same old MinGW gcc. Luckily the gcc version is not an issue. I am running 10.04 and 11.04 and have no problems with cross-build OpenOCD. http://changelogs.ubuntu.com/changelogs/pool/universe/m/mingw32-runtime/mingw32-runtime_3.15.2-0ubuntu1/changelog http://changelogs.ubuntu.com/changelogs/pool/universe/m/mingw32/ Openocd checks for usleep and already has a replacement if not found. See replacements.h Cheers Spen ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On 14/08/2011, at 7:11 PM, Spencer Oliver wrote: On Aug 14, 2011 10:01 AM, Xiaofan Chen xiaof...@gmail.com wrote: On Sat, Aug 13, 2011 at 9:38 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Aug 12, 2011 at 9:27 PM, Xiaofan Chen xiaof...@gmail.com wrote: This is probably because you have a very old version of MinGW and MinGW Win32-API. Seems to be a problem with Debian. http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/ Debian seems to ship a 3-year old MinGW Win32-API. http://packages.debian.org/search?searchon=sourcenameskeywords=mingw32 Hmm, good point. I have written an email to the mingw32-runtime package maintainer of Debian to see if he has any plan to update it to the latest version. Hmm, it seems you are out of luck. The Debian MinGW32 maintainer seemed to think there is a licensing issue somewhere and refused to update. You may have to build your own 3.17 version as in the following thread. http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498529 Ubuntu has it updated since 9.10 but still stuck with the same old MinGW gcc. Luckily the gcc version is not an issue. I am running 10.04 and 11.04 and have no problems with cross-build OpenOCD. http://changelogs.ubuntu.com/changelogs/pool/universe/m/mingw32-runtime/mingw32-runtime_3.15.2-0ubuntu1/changelog http://changelogs.ubuntu.com/changelogs/pool/universe/m/mingw32/ Openocd checks for usleep and already has a replacement if not found. See replacements.h I pushed a change to jimtcl git which will use Sleep() if usleep() is unavailable on mingw32. Cheers, Steve -- µWeb: Embedded Web Framework - http://uweb.workware.net.au/ WorkWare Systems Pty Ltd W: www.workware.net.au P: +61 434 921 300 E: ste...@workware.net.au F: +61 7 3391 6002 ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On Sat, Aug 13, 2011 at 9:38 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Aug 12, 2011 at 9:27 PM, Xiaofan Chen xiaof...@gmail.com wrote: On Sat, Aug 13, 2011 at 9:00 AM, Jie Zhang jzhang...@gmail.com wrote: Another option is to drop mingw32 and require mingw-w64. Do not do that. usleep is fine with later version of MinGW.org Win32API package. This is probably because you have a very old version of MinGW and MinGW Win32-API. Seems to be a problem with Debian. http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/ Debian seems to ship a 3-year old MinGW Win32-API. http://packages.debian.org/search?searchon=sourcenameskeywords=mingw32 Hmm, good point. I have written an email to the mingw32-runtime package maintainer of Debian to see if he has any plan to update it to the latest version. Hmm, I just test under Ubuntu 11.04 and cross compile the latest git works fine. It comes with mingw32-runtime version 3.15.2.0ubuntu1 and usleep is there. Supposedly Debian testing should come with newer version of packages than ubuntu. mcuee@Ubuntu:~/Desktop/build/openocd/build-win32-libftdi$ cat myconfig-win32-libftdi.sh ../openocd/configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu --enable-maintainer-mode --disable-shared --disable-werror --enable-jlink --enable-ft2232_libftdi --enable-presto_libftdi --enable-usbprog --enable-vsllink --enable-usb_blaster_libftdi --enable-arm-jtag-ew --enable-rlink configure:12133: checking for gettimeofday configure:12133: i586-mingw32msvc-gcc -std=gnu99 -o conftest.exe -g -O2 conftest.c 5 configure:12133: $? = 0 configure:12133: result: yes configure:12144: checking for usleep configure:12144: i586-mingw32msvc-gcc -std=gnu99 -o conftest.exe -g -O2 conftest.c 5 configure:12144: $? = 0 configure:12144: result: yes BTW, your config.log seems to be quite strange. I do not see those things in my config.log. I only see jimtcl mentioned briefly. configure:16681: === configuring in jimtcl (/home/mcuee/Desktop/build/openocd/build-win32-libftdi/jimtcl) configure:16744: running /bin/bash ../../openocd/jimtcl/configure.gnu --disable-option-checking '--prefix=/usr/local' '--host=i586-mingw32msvc' '--build=i686-pc-linux-gnu' '--enable-maintainer-mode' '--disable-shared' '--disable-werror' '--enable-jlink' '--enable-ft2232_libftdi' '--enable-presto_libftdi' '--enable-usbprog' '--enable-vsllink' '--enable-usb_blaster_libftdi' '--enable-arm-jtag-ew' '--enable-rlink' 'build_alias=i686-pc-linux-gnu' 'host_alias=i586-mingw32msvc' --cache-file=/dev/null --srcdir=../../openocd/jimtcl -- Xiaofan ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On 13/08/2011, at 6:41 AM, Jie Zhang wrote: The current HEAD cannot build with mingw32 libtool: link: i586-mingw32msvc-gcc -std=gnu99 -g -O2 -I/home/jie/installs/openocd/include -D__USE_MINGW_ANSI_STDIO -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o openocd.exe main.o -L/home/jie/installs/openocd/lib ./.libs/libopenocd.a -lws2_32 ../jimtcl/libjim.a ./.libs/libopenocd.a(libhelper_la-command.o): In function `process_jim_events': /home/jie/sources/openocd/src/helper/command.c:1398: undefined reference to `_Jim_ProcessEvents' collect2: ld returned 1 exit status make[4]: *** [openocd.exe] Error 1 make[4]: Leaving directory `/home/jie/sources/openocd/src' Jim_ProcessEvents is defined in jimtcl/jim-eventloop.c. set needs(eventloop) {expr {[have-feature select] || [have-feature usleep]}} but Checking for select...not found Checking for usleep...not found Can you send me jimtcl/config.log This is on Linux, right? -- µWeb: Embedded Web Framework - http://uweb.workware.net.au/ WorkWare Systems Pty Ltd W: www.workware.net.au P: +61 434 921 300 E: ste...@workware.net.au F: +61 7 3391 6002 ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On Fri, Aug 12, 2011 at 5:19 PM, Steve Bennett ste...@workware.net.au wrote: On 13/08/2011, at 6:41 AM, Jie Zhang wrote: The current HEAD cannot build with mingw32 libtool: link: i586-mingw32msvc-gcc -std=gnu99 -g -O2 -I/home/jie/installs/openocd/include -D__USE_MINGW_ANSI_STDIO -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -o openocd.exe main.o -L/home/jie/installs/openocd/lib ./.libs/libopenocd.a -lws2_32 ../jimtcl/libjim.a ./.libs/libopenocd.a(libhelper_la-command.o): In function `process_jim_events': /home/jie/sources/openocd/src/helper/command.c:1398: undefined reference to `_Jim_ProcessEvents' collect2: ld returned 1 exit status make[4]: *** [openocd.exe] Error 1 make[4]: Leaving directory `/home/jie/sources/openocd/src' Jim_ProcessEvents is defined in jimtcl/jim-eventloop.c. set needs(eventloop) {expr {[have-feature select] || [have-feature usleep]}} but Checking for select...not found Checking for usleep...not found Can you send me jimtcl/config.log Attached. This is on Linux, right? Yes. Debian testing AMD64. Jie Invoked as: .././jimtcl/configure --with-jim-ext=nvp --disable-lineedit --disable-install-jim --disable-option-checking --prefix=/home/jie/installs/openocd --enable-maintainer-mode --host=i586-mingw32msvc host_alias=i586-mingw32msvc --cache-file=/dev/null --srcdir=. Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:24: error: sys/socket.h: No such file or directory child process exited abnormally The failed code was: #include sys/socket.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:24: error: netinet/in.h: No such file or directory child process exited abnormally The failed code was: #include netinet/in.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:23: error: arpa/inet.h: No such file or directory child process exited abnormally The failed code was: #include arpa/inet.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:19: error: netdb.h: No such file or directory child process exited abnormally The failed code was: #include netdb.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:20: error: sys/un.h: No such file or directory child process exited abnormally The failed code was: #include sys/un.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:19: error: dlfcn.h: No such file or directory child process exited abnormally The failed code was: #include dlfcn.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 -c conftest__.c -o conftest__.o conftest__.c:1:25: error: crt_externs.h: No such file or directory child process exited abnormally The failed code was: #include crt_externs.h int main(void) { return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 conftest__.c -o conftest__.o /tmp/cca3kbgO.o: In function `main': /home/jie/sources/openocd/jimtcl/conftest__.c:3: undefined reference to `_ualarm' collect2: ld returned 1 exit status child process exited abnormally The failed code was: extern void ualarm(void); int main(void) { ualarm(); return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 conftest__.c -o conftest__.o /tmp/ccOSxm7T.o: In function `main': /home/jie/sources/openocd/jimtcl/conftest__.c:3: undefined reference to `_sysinfo' collect2: ld returned 1 exit status child process exited abnormally The failed code was: extern void sysinfo(void); int main(void) { sysinfo(); return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 conftest__.c -o conftest__.o /tmp/ccmzHPx4.o: In function `main': /home/jie/sources/openocd/jimtcl/conftest__.c:3: undefined reference to `_lstat' collect2: ld returned 1 exit status child process exited abnormally The failed code was: extern void lstat(void); int main(void) { lstat(); return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 conftest__.c -o conftest__.o conftest__.c:1: warning: conflicting types for built-in function 'fork' /tmp/cckd557b.o: In function `main': /home/jie/sources/openocd/jimtcl/conftest__.c:3: undefined reference to `_fork' collect2: ld returned 1 exit status child process exited abnormally The failed code was: extern void fork(void); int main(void) { fork(); return 0; } Failed: ccache i586-mingw32msvc-cc -g -O2 conftest__.c -o conftest__.o /tmp/ccQGyG3k.o: In function `main':
Re: [Openocd-development] Build error with mingw32
On Fri, Aug 12, 2011 at 9:27 PM, Xiaofan Chen xiaof...@gmail.com wrote: On Sat, Aug 13, 2011 at 9:00 AM, Jie Zhang jzhang...@gmail.com wrote: Another option is to drop mingw32 and require mingw-w64. Do not do that. usleep is fine with later version of MinGW.org Win32API package. This is probably because you have a very old version of MinGW and MinGW Win32-API. Seems to be a problem with Debian. http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/ Debian seems to ship a 3-year old MinGW Win32-API. http://packages.debian.org/search?searchon=sourcenameskeywords=mingw32 Hmm, good point. I have written an email to the mingw32-runtime package maintainer of Debian to see if he has any plan to update it to the latest version. Regards, Jie ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On Sat, Aug 13, 2011 at 9:38 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Aug 12, 2011 at 9:27 PM, Xiaofan Chen xiaof...@gmail.com wrote: On Sat, Aug 13, 2011 at 9:00 AM, Jie Zhang jzhang...@gmail.com wrote: Another option is to drop mingw32 and require mingw-w64. Do not do that. usleep is fine with later version of MinGW.org Win32API package. This is probably because you have a very old version of MinGW and MinGW Win32-API. Seems to be a problem with Debian. http://sourceforge.net/projects/mingw/files/MinGW/BaseSystem/RuntimeLibrary/Win32-API/ Debian seems to ship a 3-year old MinGW Win32-API. http://packages.debian.org/search?searchon=sourcenameskeywords=mingw32 Hmm, good point. I have written an email to the mingw32-runtime package maintainer of Debian to see if he has any plan to update it to the latest version. BTW, there are other problems with the Linux MinGW packages in Debian/Ubuntu. This is one of them which does not affect C based programs like OpenOCD but it will affect C++ based programs. http://comments.gmane.org/gmane.comp.gnu.mingw.user/36693 Basically MinGW.org native compiler and the Cygwin i686-pc-ming32 cross compiler are built with --disable-sjlj-exceptions whereas many Linux MinGW cross compilers are built with a default option which is --enable-sjlj-exceptions. That is the case with MinGW package inside Ubuntu 11.04. On the other hand, MinGW-w64 packages inside Ubuntu is also not that usable since it is quite old (even for the upcoming 11.10). So I always use other versions. But Debian Sid seems to be better in this aspect. -- Xiaofan ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development
Re: [Openocd-development] Build error with mingw32
On Sat, Aug 13, 2011 at 11:56 AM, Jie Zhang jzhang...@gmail.com wrote: On Fri, Aug 12, 2011 at 10:15 PM, Xiaofan Chen xiaof...@gmail.com wrote: BTW, there are other problems with the Linux MinGW packages in Debian/Ubuntu. This is one of them which does not affect C based programs like OpenOCD but it will affect C++ based programs. http://comments.gmane.org/gmane.comp.gnu.mingw.user/36693 Basically MinGW.org native compiler and the Cygwin i686-pc-ming32 cross compiler are built with --disable-sjlj-exceptions whereas many Linux MinGW cross compilers are built with a default option which is --enable-sjlj-exceptions. That is the case with MinGW package inside Ubuntu 11.04. In GCC, the default is --disable-sjlj-exceptions. So I'm confused. Maybe the word default is too overloaded. But anyway, the thing is that Linux distros are not following the upstream recommendation of MinGW. In Debian testing, mingw32 is configured with --enable-sjlj-exceptions. mingw-w64 is configured without --enable-sjlj-exceptions. But if we compile all code, including libraries, with one compiler, it should be safe. Yes that is true. On the other hand, MinGW-w64 packages inside Ubuntu is also not that usable since it is quite old (even for the upcoming 11.10). So I always use other versions. But Debian Sid seems to be better in this aspect. I use Debian. That is better but I would still consider as not that good. MinGW-w64 Sourceforge website is a mess but the personal build of sezero is good if you want to use it under Linux (or Windows). http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/sezero_20110510/ http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/sezero_20110510/ If you use Windows, then TDM64 is also good. http://tdm-gcc.tdragon.net/download I use mainly TDM64 under Windows and the following build under Linux, http://code.google.com/p/mingw-w64-dgn/downloads/list -- Xiaofan ___ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development