Make tools failed

I did git clone Monday afternoon and
make tools
failed :
libtool: compile: gcc -DHAVE_CONFIG_H -I.
-I/home/sal2/SiFive/freedom-e-sdk/openocd/src/target -I…/…
-I/home/sal2/SiFive/freedom-e-sdk/openocd/src -I…/…/src
-I/home/sal2/SiFive/freedom-e-sdk/openocd/jimtcl -I…/…/jimtcl -g -O2
-Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra
-Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls
-Werror -MT riscv/riscv.lo -MD -MP -MF riscv/.deps/riscv.Tpo -c
/home/sal2/SiFive/freedom-e-sdk/openocd/src/target/riscv/riscv.c -o

In file included from /home/sal2/SiFive/freedom-e-sdk/openocd/src/target/riscv/riscv.c:12:0:

/home/sal2/SiFive/freedom-e-sdk/openocd/src/target/riscv/riscv.c: In function ‘riscv_examine’:

error: left shift of negative value [-Werror=shift-negative-value]

#define get_field(reg, mask) (((reg) & (mask)) / ((mask) & ~((mask) << 1)))


/home/sal2/SiFive/freedom-e-sdk/openocd/src/helper/log.h:108:5: note: in definition of macro ‘LOG_DEBUG’

 expr); \


/home/sal2/SiFive/freedom-e-sdk/openocd/src/target/riscv/riscv.c:1868:31: note: in expansion of macro ‘get_field’

LOG_DEBUG(" abussize=0x%x", get_field(dminfo, DMINFO_ABUSSIZE));


cc1: all warnings being treated as errors

Makefile:799: recipe for target ‘riscv/riscv.lo’ failed

make[7]: *** [riscv/riscv.lo] Error 1

make[7]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd/src/target’

Makefile:844: recipe for target ‘all-recursive’ failed

make[6]: *** [all-recursive] Error 1

make[6]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd/src/target’

Makefile:642: recipe for target ‘all’ failed

make[5]: *** [all] Error 2

make[5]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd/src/target’

Makefile:620: recipe for target ‘all-recursive’ failed

make[4]: *** [all-recursive] Error 1

make[4]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd/src’

Makefile:457: recipe for target ‘all’ failed

make[3]: *** [all] Error 2

make[3]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd/src’

Makefile:514: recipe for target ‘all-recursive’ failed

make[2]: *** [all-recursive] Error 1

make[2]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd’

Makefile:422: recipe for target ‘all’ failed

make[1]: *** [all] Error 2

make[1]: Leaving directory ‘/home/sal2/SiFive/freedom-e-sdk/work/openocd’

Makefile:70: recipe for target ‘/home/sal2/SiFive/freedom-e-sdk/toolchain/bin/openocd’ failed

make: *** [/home/sal2/SiFive/freedom-e-sdk/toolchain/bin/openocd] Error 2

It would appear that DMINFO_ABUSSIZE is defined as signed and is also negative.

Would you entertain a patch? (It probably would take me longer and likely not to standard) but I would enjoy giving it a try.

Thank you so much.

I thought making it unsigned would work - but I had not found it yet.

1 Like

Thanks for helping report the issue. The freedom-e-sdk master is now pointing to the corrected version of OpenOCD.