trouble preparing openOCD env

linuxpaul
Posts: 43
Joined: Thu Jul 20, 2017 6:10 pm

trouble preparing openOCD env

Postby linuxpaul » Sat Jul 22, 2017 2:08 pm

Hello,

after successful preparation a msys2 ESP dev env I try to extend the env for building openOCD.
Except the official dokumentation (README from openOCD-ESP32 clone), i used
this precompiled packages for preperation:

Code: Select all

mingw32/mingw-w64-i686-libusb,  libtool, pkg-config, autoconf, automake, texinfo
which leads me to a successful openOCD build, but obviously destroys the ESP dev env.
I'm running into trouble with mconf similar to:
viewtopic.php?f=2&t=708&hilit=mconf+error

Any ideas what went wrong?

regards,
linuxpaul

linuxpaul
Posts: 43
Joined: Thu Jul 20, 2017 6:10 pm

Re: trouble preparing openOCD env

Postby linuxpaul » Sat Jul 22, 2017 9:40 pm

it is pkg-config.

Installing any package or just copy the pkg-config.exe from pkg-config-lite to .../mingw32/bin
results in this behaviour:

Code: Select all

$ make
including /d/Source/esp/esp-idf/components/bootloader/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/bootloader_support/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/coap/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/esp32/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/esptool_py/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/mbedtls/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/nghttp/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/partition_table/Makefile.projbuild...
including /d/Source/esp/esp-idf/components/ulp/Makefile.projbuild...
MAKEFLAGS= CC=cc LD=ld \
make -C /d/Source/esp/esp-idf/tools/kconfig
make[1]: Verzeichnis „/d/Source/esp/esp-idf/tools/kconfig“ wird betreten
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o mconf.o mconf.c
mconf.c: In Funktion »search_conf«:
mconf.c:424:6: Warnung: Implizite Deklaration der Funktion »strncasecmp« [-Wimplicit-function-declaration]
  if (strncasecmp(dialog_input_result, CONFIG_, strlen(CONFIG_)) == 0)
      ^~~~~~~~~~~
mconf.c: In Funktion »main«:
mconf.c:1029:8: Warnung: Implizite Deklaration der Funktion »strcasecmp« [-Wimplicit-function-declaration]
   if (!strcasecmp(mode, "single_menu"))
        ^~~~~~~~~~
flex -L -P zconf -o zconf.lex.c zconf.l
zconf.l:256: warning, „-s“-Option gegeben, aber Vorgabe-Regel kann nicht passen
bison -t -l -p zconf -o zconf.tab.c zconf.y
sed -E "s/\\x0D$//" zconf.gperf | gperf -t --output-file zconf.hash.c -a -C -E -g -k '1,3,$' -p -t
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o zconf.tab.o zconf.tab.c
lxdialog/check-lxdialog.sh -check cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC                                                             ="<ncurses.h>" -DNCURSES_WIDECHAR=1 -DLOCALE -LD:/Source/msys32/mingw32/lib -lncursesw -lintl
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/checklist.o lxdialog/checklist.c
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/util.o lxdialog/util.c
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/inputbox.o lxdialog/inputbox.c
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/textbox.o lxdialog/textbox.c
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/yesno.o lxdialog/yesno.c
cc  -D_XOPEN_SOURCE=500 -D_POSIX_C_SOURCE=199506L -ID:/Source/msys32/mingw32/include/ncursesw -DCURSES_LOC="<ncurses.h>" -DNCURSES_WIDECHAR=                                                             1 -DLOCALE   -c -o lxdialog/menubox.o lxdialog/menubox.c
cc -o mconf mconf.o zconf.tab.o lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubo                                                             x.o -LD:/Source/msys32/mingw32/lib -lncursesw -lintl
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_color.o):(.text+0x286): undefined reference to `_assert'
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_initscr.o):(.text+0x39): undefined reference to `_imp___iob'
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_initscr.o):(.text+0x78): undefined reference to `_imp___iob'
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_initscr.o):(.text.unlikely+0x1b): undefined reference to `__mingw_vfprintf'
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_newterm.o):(.text+0x89): undefined reference to `_imp___iob'
D:/Source/msys32/mingw32/lib/libncursesw.a(lib_newterm.o):(.text+0x3b1): undefined reference to `_imp___iob'
.......

User avatar
ESP_krzychb
Posts: 403
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: trouble preparing openOCD env

Postby ESP_krzychb » Sun Jul 23, 2017 7:59 am

Hello @linuxpaul,

I run into the same issue with MSYS2.
After installation of additional packages I was able to successfully compile OpenOCD, but then had to redo broken toolchain setup for Windows.
I got suggestion to use Cygwin to build OpenOCD instead but did not try it yet.

Build with Linux on the other hand works without any issues and currently this is what I use.

linuxpaul
Posts: 43
Joined: Thu Jul 20, 2017 6:10 pm

Re: trouble preparing openOCD env

Postby linuxpaul » Sun Jul 23, 2017 3:03 pm

Hello krzychb,

thanks for your reply,
My Idea is simply remove the pkg-config package after building openOCD,
because I think it is only a requirement for building the binaries and there
are no runtime dependencies.

mingw-w64-i686-pkg-config filelist:

Code: Select all

mingw32/
mingw32/bin/
mingw32/bin/i686-w64-mingw32-pkg-config.exe
mingw32/bin/pkg-config.exe
mingw32/share/
mingw32/share/aclocal/
mingw32/share/aclocal/pkg.m4
mingw32/share/doc/
mingw32/share/doc/pkg-config/
mingw32/share/doc/pkg-config/pkg-config-guide.html
mingw32/share/man/
mingw32/share/man/man1/
mingw32/share/man/man1/pkg-config.1.gz
There is no library introduced by the Package.

Depending to openOCD-ESP32 README and the mingw-openocd requirements I used thease packages
for openOCD-ESP32 build preperation:

Code: Select all

mingw-w64-i686-confuse  mingw-w64-i686-hidapi  mingw-w64-i686-libusb mingw-w64-i686-libusb-compat-git
mingw-w64-i686-libftdi mingw-w64-i686-libtool autoconf automake texinfo mingw-w64-i686-pkg-config
Running the ESP32 toolchain with linux is preferred, of cource and i still started a setup on debian9, last week.
For now, I want find out the Windows look an feel.

:)
linuxpaul

User avatar
ESP_krzychb
Posts: 403
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: trouble preparing openOCD env

Postby ESP_krzychb » Mon Jul 24, 2017 9:27 pm

Hi linuxpaul,

Thanks a lot for the tip that the "pkg-config" is the single "troublemaker"!

In fact I was looking for a workflow to compile OpenOCD for Windows.
Here is what I have just successfully tested for MSYS2 / Windows 7:

Building OpenOCD from sources on Windows platform
==============================================


Note:
Steps below assume using prebuild development environment described in http://esp-idf.readthedocs.io/en/latest ... setup.html

1. Clone OpenOCD

Code: Select all

cd ~/esp
git clone --recursive https://github.com/espressif/openocd-esp32
2. Install Packages

Code: Select all

pacman -S libtool
pacman -S autoconf
pacman -S automake
pacman -S texinfo
pacman -S mingw-w64-i686-libusb-compat-git
pacman -S pkg-config
3. Build OpenOCD

Code: Select all

cd ~/esp/openocd-esp32
./bootstrap
./configure
make
4. Unistall pkg-config

Code: Select all

pacman -Rs pkg-config
5. Optional Cleanup
Resolve issue with missing liblto_plugin.dll.a and liblto_plugin-0.dll, if reported by esp-idf's make, ref. https://github.com/espressif/esp-idf/issues/828

Who is online

Users browsing this forum: ivanvasilenok, yuemko and 92 guests