chipsalliance / rocket-tools

Software tools that support rocket-chip (GNU toolchain, ISA simulator, tests)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to build openocd

hexaglow opened this issue · comments

When running ./build.sh, I get the following error while openocd is being build:

/usr/bin/ld: src/.libs/libopenocd.a(libocdjtagdrivers_la-bitbang.o):/home/matt/clones/rocket-tools/riscv-openocd/build/../src/jtag/drivers/bitbang.h:60: multiple definition of `bitbang_swd'; src/.libs/libopenocd.a(libocdjtagdrivers_la-remote_bitbang.o):/home/matt/clones/rocket-tools/riscv-openocd/build/../src/jtag/drivers/bitbang.h:60: first defined here
collect2: error: ld returned 1 exit status
gmake[2]: *** [Makefile:2968: src/openocd] Error 1
gmake[1]: *** [Makefile:4285: all-recursive] Error 1
gmake: *** [Makefile:1999: all] Error 2

I'm using GCC 10.1.1 on Fedora 32

I also saw this on my end.

I'm guessing the first build_project command in the build.sh file is giving you the error you see:
build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --enable-jtag_vpi --disable-werror

I tried running everything in the build script line by line and this is where it is located. There seems to be a long sequence of gcc compilations that runs from the make file that is called from this point. I will attempt to parse through a bit, but I don't have much experience in this repo or RISCV in general to be honest.

Since the error had issues with this "bitbang_swd" being defined multiple places, I guessing we can try and run the build_project for openocd without the flag "--enable-remote-bitbang". It seem to have ran and completed.

Just for reference, if you think this breaks something, you can go into the riscv-openocd folder and run make distclean.

You can also manually configure and make and install as stated in the folder's "INSTALL" file. Simply run ./configure && make && make install. However, I should point out, when I tried this, it reported acceptable warnings as errors instead (such as uninitialized c variable that was assigned in a later function: jtagspi_read_status returns status to the function that called it: jtagspi_wait for example).

There seems to be another error I received for subsequent tool: riscv-isa-sim. This repo just seems broken at the moment.