chipyard icon indicating copy to clipboard operation
chipyard copied to clipboard

Build error when running "./scripts/build-toolchains.sh riscv-tools"

Open g07h4xf00 opened this issue 3 years ago • 4 comments

I get the following error when trying to build the repository with "./scripts/build-toolchains.sh riscv-tools" :

/home/mogleari/vc/chipyard/riscv-tools-install/lib/gcc/riscv64-unknown-linux-gnu/9.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find -lstdc++ /home/mogleari/vc/chipyard/riscv-tools-install/lib/gcc/riscv64-unknown-linux-gnu/9.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find -lgcc_s collect2: error: ld returned 1 exit status make[3]: *** [../Rules:193: /home/mogleari/vc/chipyard/toolchains/riscv-tools/riscv-gnu-toolchain/build/build-glibc-linux-rv64imafdc-lp64d/support/links-dso-program] Error 1 make[3]: *** Waiting for unfinished jobs.... make[3]: Leaving directory '/home/mogleari/vc/chipyard/toolchains/riscv-tools/riscv-gnu-toolchain/riscv-glibc/support' make[2]: *** [Makefile:258: support/others] Error 2 make[2]: Leaving directory '/home/mogleari/vc/chipyard/toolchains/riscv-tools/riscv-gnu-toolchain/riscv-glibc' make[1]: *** [Makefile:9: all] Error 2 make[1]: Leaving directory '/home/mogleari/vc/chipyard/toolchains/riscv-tools/riscv-gnu-toolchain/build/build-glibc-linux-rv64imafdc-lp64d' make: *** [Makefile:243: stamps/build-glibc-linux-rv64imafdc-lp64d] Error 2

The innate ld on my system does recognize flags like "-lstdc++" but it seems like ld binary generated here does not? I'm pretty sure I installed all the dependencies listed.

g07h4xf00 avatar Jan 27 '22 04:01 g07h4xf00

I occur the same question, have you resolved this?

Prerise avatar Feb 23 '22 06:02 Prerise

I met the same problem before, and my solution is to run build-toolchains.sh in an environment without $RISCV and riscv toolchain in your $PATH.

geekLucian avatar Feb 28 '22 07:02 geekLucian

I have the same error when running ./scripts/build-toolchains.sh esp-tools.

Does the arty100t branch support the esp-tools toolchain?

mbelda avatar Jul 14 '22 18:07 mbelda

I met the same problem before, and my solution is to run build-toolchains.sh in an environment without $RISCV and riscv toolchain in your $PATH.

Yes, I met the same problem and solved it by 2 actions:

  1. set $RISCV empty,
  2. remove all the riscv related path in $PATH and $LD_LIBRARY_PATH.

That's all.

LY-Mei avatar Aug 12 '22 18:08 LY-Mei

This is no longer an issue in the new conda-based build flow

jerryz123 avatar Feb 17 '23 07:02 jerryz123