Cannot compile openOCD-ESP32 within msys2 env

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

Cannot compile openOCD-ESP32 within msys2 env

Postby linuxpaul » Thu Jul 20, 2017 7:15 pm

Hello,

I'm using Win7 64bit, msys2, mingw32 from ESP with latest updates and the latest clone of openOCD-ESP32.
Running make results in this output:

Code: Select all

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../src -I../../../src -I../../../src/helper -DPKGDATADIR=\"/mingw32/share/openocd\" -DBINDIR=\"/mingw32/bin\" -I../../../jimtcl -I../../../jimtcl -isystem D:/Source/msys32/mingw32/include/libusb-1.0 -ID:/Source/msys32/mingw32/include -ID:/Source/msys32/mingw32/include/libusb-1.0 -ID:/Source/msys32/mingw32/include/hidapi -g -O2 -D__USE_MINGW_ANSI_STDIO -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -MT libocdjtagdrivers_la-ftdi.lo -MD -MP -MF .deps/libocdjtagdrivers_la-ftdi.Tpo -c ftdi.c -o libocdjtagdrivers_la-ftdi.o
ftdi.c: In function 'ftdi_handle_set_signal_command':
ftdi.c:854:6: error: this statement may fall through [-Werror=implicit-fallthrough=]
   if (CMD_ARGV[1][1] == '\0') {
      ^
ftdi.c:858:2: note: here
  default:
  ^~~~~~~
cc1.exe: all warnings being treated as errors
make[7]: *** [Makefile:789: libocdjtagdrivers_la-ftdi.lo] Fehler 1
Any ideas what went wrong?

Compiling the same sources under debian9 works very fine.

regards,
linuxpaul

f.h-f.s.
Posts: 214
Joined: Thu Dec 08, 2016 2:53 pm

Re: Cannot compile openOCD-ESP32 within msys2 env

Postby f.h-f.s. » Fri Jul 21, 2017 7:19 am

make CFLAGS='-Wno-error=implicit-fallthrough'

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

Re: Cannot compile openOCD-ESP32 within msys2 env

Postby ESP_krzychb » Fri Jul 21, 2017 9:12 am

Compiling the same sources under debian9 works very fine.
Indeed compilation with Linux work very fine (and quick)
make CFLAGS='-Wno-error=implicit-fallthrough'
Expanding on answer by @f.h-f.s., the issue report https://github.com/espressif/openocd-esp32/issues/13 provides a recepie how to handle "error: this statement may fall through"

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

Re: Cannot compile openOCD-ESP32 within msys2 env

Postby linuxpaul » Fri Jul 21, 2017 10:48 am

thank you guys,

leading your Posts I found another solution.
make CFLAGS="" seem override other settings (e.g. headerfile not found) but now I knew what I have to looking for.
Wimplicit-fallthrough=3 is implitit from Wextra and can be disabled by Wimplicit-fallthrough=0

After adding the switch -Wimplicit-fallthrough=0 to this Makefiles: (CFLAGS line)
...\openocd-esp32\src\flash\Makefile
...\openocd-esp32\src\flash\nand\Makefile
...\openocd-esp32\src\helper\Makefile
...\openocd-esp32\src\jtag\drivers\Makefile
...\openocd-esp32\src\svf\Makefile
...\openocd-esp32\src\target\Makefile

I got a successful make from clean.

regards,
linuxpaul

Who is online

Users browsing this forum: No registered users and 89 guests