Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtool: Version mismatch error when building openocd #974

Closed
T-K-233 opened this issue Dec 4, 2023 · 3 comments
Closed

libtool: Version mismatch error when building openocd #974

T-K-233 opened this issue Dec 4, 2023 · 3 comments

Comments

@T-K-233
Copy link

T-K-233 commented Dec 4, 2023

System info

> uname -a
Linux PaperWeight 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov  2 18:01:13 UTC 2 x86_64 GNU/Linux

> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

Error log

~/Documents/RISCV/riscv-openocd$ make
mkdir -p src
cat src/helper/startup.tcl src/jtag/startup.tcl src/target/startup.tcl src/server/startup.tcl src/flash/startup.tcl | ./src/helper/bin2char.sh > src/startup_tcl.inc || { rm -f src/startup_tcl.inc; false; }
make  all-recursive
make[1]: Entering directory '/home/tk/Documents/RISCV/riscv-openocd'
Making all in jimtcl
make[2]: Entering directory '/home/tk/Documents/RISCV/riscv-openocd/jimtcl'
        MKLDEXT _load-static-exts.c
        CC      _load-static-exts.o
        CC      jim-subcmd.o
        CC      jim-interactive.o
        CC      jim-format.o
        CC      jim.o
        CC      utf8.o
        CC      jimregexp.o
        CC      jimiocompat.o
        CC      jim-aio.o
        CC      jim-array.o
        CC      jim-clock.o
        CC      jim-eventloop.o
        CC      jim-exec.o
        CC      jim-file.o
        CC      jim-history.o
        CC      jim-interp.o
        CC      jim-json.o
        CC      jim-load.o
        CC      jim-namespace.o
        CC      jim-pack.o
        CC      jim-package.o
        CC      jim-posix.o
        CC      jim-readdir.o
        CC      jim-regexp.o
        CC      jim-signal.o
        CC      jim-syslog.o
        TCLEXT  _glob.c
        CC      glob.o
        TCLEXT  _jsonencode.c
        CC      jsonencode.o
        TCLEXT  _nshelper.c
        CC      nshelper.o
        TCLEXT  _oo.c
        CC      oo.o
        TCLEXT  _stdlib.c
        CC      stdlib.o
        TCLEXT  _tclcompat.c
        CC      tclcompat.o
        TCLEXT  _tree.c
        CC      tree.o
        AR      libjim.a
        CC      jimsh.o
        TCLEXT  _initjimsh.c
        CC      initjimsh.o
        LINK    jimsh
make[2]: Leaving directory '/home/tk/Documents/RISCV/riscv-openocd/jimtcl'
make[2]: Entering directory '/home/tk/Documents/RISCV/riscv-openocd'
restore=: && backupdir=".am$$" && \
am__cwd=`pwd` && CDPATH="${ZSH_VERSION+.}:" && cd . && \
rm -rf $backupdir && mkdir $backupdir && \
if (echo makeinfo missing; true --version) >/dev/null 2>&1; then \
  for f in doc/openocd.info doc/openocd.info-[0-9] doc/openocd.info-[0-9][0-9] doc/openocd.i[0-9] doc/openocd.i[0-9][0-9]; do \
    if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
  done; \
else :; fi && \
cd "$am__cwd"; \
if echo makeinfo missing; true   -I doc -I ./doc \
 -o doc/openocd.info ./doc/openocd.texi; \
then \
  rc=0; \
  CDPATH="${ZSH_VERSION+.}:" && cd .; \
else \
  rc=$?; \
  CDPATH="${ZSH_VERSION+.}:" && cd . && \
  $restore $backupdir/* `echo "./doc/openocd.info" | sed 's|[^/]*$||'`; \
fi; \
rm -rf $backupdir; exit $rc
makeinfo missing
depbase=`echo src/main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I.   -I./src -I./src -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -DFD_SETSIZE=128 -I./jimtcl -I./jimtcl  -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Wpointer-arith -Wundef -Werror -DFD_SETSIZE=128 -g -O2 -MT src/main.o -MD -MP -MF $depbase.Tpo -c -o src/main.o src/main.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.   -DRELSTR=\"`./guess-rev.sh .`\" -DGITVERSION=\"`cd . && git describe`\" -DPKGBLDDATE=\"`date +%F-%R`\"  -I./src -I./src -DPKGDATADIR=\"/usr/local/share/openocd\" -DBINDIR=\"/usr/local/bin\" -DFD_SETSIZE=128 -I./jimtcl -I./jimtcl   -Wall -Wstrict-prototypes -Wformat-security -Wshadow -Wextra -Wno-unused-parameter -Wbad-function-cast -Wcast-align -Wredundant-decls -Wpointer-arith -Wundef -Werror -DFD_SETSIZE=128 -g -O2 -MT src/libopenocd_la-hello.lo -MD -MP -MF src/.deps/libopenocd_la-hello.Tpo -c -o src/libopenocd_la-hello.lo `test -f 'src/hello.c' || echo './'`src/hello.c
libtool: Version mismatch error.  This is libtool 2.4.7, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.7
libtool: and run autoconf again.
make[2]: *** [Makefile:4030: src/libopenocd_la-hello.lo] Error 63
make[2]: Leaving directory '/home/tk/Documents/RISCV/riscv-openocd'
make[1]: *** [Makefile:4968: all-recursive] Error 1
make[1]: Leaving directory '/home/tk/Documents/RISCV/riscv-openocd'
make: *** [Makefile:2124: all] Error 2
@JanMatCodasip
Copy link
Collaborator

This looks to me like you have configured (./bootstrap && ./configure) your build with libtool 2.4.6 but trying to build (make) with different libtool version.

Please, try a full clean build:

make clean
make distclean
./bootstrap
./configure [.. your args ..]
make -j`nproc`

@T-K-233
Copy link
Author

T-K-233 commented Dec 4, 2023

Resolved:

If you are using conda, then this could be due to libtool and autoconf from different sources. Can check this by executing

which libtool
which autoconf

In my case, although I have exited the conda environment, both libtool and autoconf was still pointed to the binary in a conda environment:

> ~/Documents/RISCV/riscv-openocd$ which libtool
/home/tk/Desktop/chipyard-fpga/.conda-env/bin/libtool
> which autoconf
/home/tk/Desktop/chipyard-fpga/.conda-env/bin/autoconf

which is a older version than what openocd build needs.

I had to remove the conda environment by using the command

conda remove -p /home/tk/Desktop/chipyard-fpga/.conda-env/

after removing the conda environment, it still cannot link to the default system binaries. After rebooting the system, it finally worked.

> ~/Documents/RISCV/riscv-openocd$ which libtool
/usr/bin/libtool
> which autoconf
/usr/bin/autoconf

@T-K-233 T-K-233 closed this as completed Dec 4, 2023
@T-K-233
Copy link
Author

T-K-233 commented Dec 4, 2023

This looks to me like you have configured (./bootstrap && ./configure) your build with libtool 2.4.6 but trying to build (make) with different libtool version.

Please, try a full clean build:

make clean
make distclean
./bootstrap
./configure [.. your args ..]
make -j`nproc`

Thanks for the reply! I figured out that it was indeed the environment issue, and have found the solution. Somehow I forgot to post the update above last night...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants