Build fails on raspberry pi 4

1
closed
stansotn
stansotn
Posted 9 months ago

Build fails on raspberry pi 4 #5

Describe the bug Compilation throws

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/flash/mflash.lo -MD -MP -MF src/flash/.deps/mflash.Tpo -c src/flash/mflash.c -o src/flash/mflash.o
In file included from /usr/include/string.h:495,
                 from ./src/helper/system.h:27,
                 from ./config.h:338,
                 from src/flash/mflash.c:19:
In function ‘memset’,
    inlined from ‘mg_gen_ataid’ at src/flash/mflash.c:1162:2,
    inlined from ‘mg_storage_config’ at src/flash/mflash.c:1174:2:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [509, 512] from the object at ‘buff’ is out of the bounds of referenced subobject ‘reserved7’ with type ‘mg_io_uint8[186]’ {aka ‘unsigned char[186]’} at offset 322 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |     

How To Reproduce

  1. Clean install Ubuntu 20.04 on Raspberry pi 4 (4gb)
  2. Install libusb and clone this repo.
sudo apt install libusb-1.0-0 libusb-1.0-0-dev
git clone --recursive https://github.com/STMicroelectronics/OpenOCD.git
cd OpenOCD
  1. Try to build
./bootstrap
./configure
make

Also tried with:

./configure --enable-sysfsgpio --enable-bcm2835gpio

Additional Context Raspberry pi support would be very handy. Please let me know if I am doing anything wrong.

stansotn
stansotn
Created 9 months ago

duplicate of #2