SparkFun Forums 

Where electronics enthusiasts find answers.

By parrotrupper
#201756
Open OCD version:
openocd-0.10.0

OS:
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

Build command:
./configure && make && make install

Offending code:

libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./src -I./src -I./src/helper -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -I./jimtcl -I./jimtcl -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Werror -g -O2 -MT src/svf/svf.lo -MD -MP -MF src/svf/.deps/svf.Tpo -c src/svf/svf.c -o src/svf/svf.o
src/svf/svf.c: In function ‘svf_read_command_from_file’:
src/svf/svf.c:663:7: error: this statement may fall through [-Werror=implicit-fallthrough=]
i = -1;
~~^~~~
src/svf/svf.c:664:4: note: here
case '\r':
^~~~
src/svf/svf.c:667:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (!cmd_pos)
^
src/svf/svf.c:669:4: note: here
default:
^~~~~~~
cc1: all warnings being treated as errors
Makefile:2790: recipe for target 'src/svf/svf.lo' failed
make[2]: *** [src/svf/svf.lo] Error 1
make[2]: Leaving directory '/home/deya/dev-tools/openocd/openocd-0.10.0'
Makefile:3665: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/deya/dev-tools/openocd/openocd-0.10.0'
Makefile:1578: recipe for target 'all' failed
make: *** [all] Error 2
By mayor
#201934
Hi, remove the -Werror flag! You are getting warnings for deliberate switch fallthroughs that are being treated as errors, hence the failed build.
By fatalfeel
#202303
//////////////////////////////////////////////////////////////////////////////////////////////
//Modify openocd on Ubuntu 16.04
//////////////////////////////////////////////////////////////////////////////////////////////
1.
gedit all configure*.* and Makefile*.*
change keyword 1.14 change to 1.15 for automake

2.
gedit ~/src/flash/nor/jtagspi.c
there are 2 lines
uint32_t status;
change to
uint32_t status = 0;

3.
sudo aclocal
sudo libtoolize --force
sudo automake --add-missing
sudo autoreconf

4.
./configure --prefix=/opt/openocd --enable-maintainer-mode --enable-ftdi
make && make install