chipyard icon indicating copy to clipboard operation
chipyard copied to clipboard

(Chipyard 1.13) GLIBC `riscv-isa-sim` build error on non-RHEL9 OS

Open zzulb opened this issue 1 year ago • 9 comments

Background Work

Chipyard Version and Hash

Release: 1.13.0 latest

OS Setup

ubuntu 20.0

Other Setup

Current Behavior

Execute “module_all riscv-isa-sim --prefix="${RISCV}" --with-boost=no --with-boost-asio=no --with-boost-regex=no” and an error is reported. It is prompted to give the --host parameter.

Expected Behavior

"module_all riscv-isa-sim --prefix="${RISCV}" --with-boost=no --with-boost-asio=no --with-boost-regex=no --host=x86_64-linux-gnu" This can be executed. But I don't know if it is correct.

"module_all riscv-isa-sim --prefix="${RISCV}" --with-boost=no --with-boost-asio=no --with-boost-regex=no --host=riscv${XLEN}-unknown-elf" This still reports an error, missing libpthread, I don't know how to deal with it.

Other Information

No response

zzulb avatar Apr 21 '25 14:04 zzulb

This is a screenshot of the error. Image

zzulb avatar Apr 22 '25 13:04 zzulb

I am facing similar issue in Step 3, Building Toolchain Collateral , this is the exact snipped from the log file

========== BEGINNING STEP 3: Building toolchain collateral ==========
Installing extra toolchain utilities/tests to /home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/.conda-env/riscv-tools
==>  Installing Spike
=>  Starting riscv-isa-sim build
==>  Initializing riscv-isa-sim submodule
+ git submodule update --init --recursive /home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/toolchains/riscv-tools/riscv-isa-sim
Cloning into '/home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/toolchains/riscv-tools/riscv-isa-sim'...
Submodule path 'toolchains/riscv-tools/riscv-isa-sim': checked out '76858cc3aa178446584eae52f82e0a933e71f8db'
==>  cd /home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/toolchains/riscv-tools/riscv-isa-sim
+ mkdir -p build
==>  Configuring riscv-isa-sim
+ cd build
+ ../configure --prefix=/home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/.conda-env/riscv-tools --with-boost=no --with-boost-asio=no --with-boost-regex=no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in '/home/idsproj01/trusted/projects/TrEB/Design/TReB_ASIC_01/_cad/Digital/user/farid/chipyard/chipyard/toolchains/riscv-tools/riscv-isa-sim/build':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use '--host'.
See 'config.log' for more details
build-setup.sh: Build script failed with exit code 77 at step 3: Building toolchain collateral
``

MuzamilFarid avatar Apr 30 '25 13:04 MuzamilFarid

This is due to the fact that there is a hard requirement of GLIBC = 2.34 within the script. This is contradictory; considering EDA tools such as VCS (as of today) have no official support for RHEL9; which contains GLIBC 2.34.

A temporary workaround would be to use 'patchelf' with desired GLIBC libraries built separately. This is a somewhat tedious process.

In the long run, scripts should be updated to accommodate GLIBC 2.28 as well (which is, the version that ships with RHEL8).

u-su avatar May 23 '25 08:05 u-su

[changed title to be clearer(?), feel free to modify >_<] Vague thoughts: hm, seems this is coming up for ubuntu users in particular..? We recently upgraded to rhel9 so it's possible some changes got upstreamed that are breaking for others..? A quick check might be for someone who's running into this to revert to some older working commits and compare (e.g. test if the only change is GLIBC =, etc). If there's a minimal changeset that works maybe it can be implemented as a fallback..

Fi50 avatar May 31 '25 03:05 Fi50

Seems like the merge found here is the splitting point. https://github.com/ucb-bar/chipyard/pull/2174

The problem seems to appear from this commit and onwards, while the commit before this (https://github.com/ucb-bar/chipyard/pull/2166) seems to not have this issue with the GLIBC version.

suhwanhong999 avatar Jun 17 '25 21:06 suhwanhong999

Seems that changing the .conda-reqs/chipyard-base.yaml file line from "sysroot_linux-64=2.34" to "sysroot_linux-64=2.28" doesn't fix anything as far as I can tell. Still failing on step 3.

suhwanhong999 avatar Jun 20 '25 19:06 suhwanhong999

Try running generate-conda-lockfiles.sh in the scripts directory to update the lockfiles to use 2.28, then try building again?

marie-anne-xu avatar Jul 11 '25 07:07 marie-anne-xu

doesn't seem to fix the issue as far as I can tell. I know the OS being old is the issue, since all of this works perfectly well on WSL (running on my laptop)

suhwanhong999 avatar Jul 22 '25 16:07 suhwanhong999

Can you attempt to build https://github.com/riscv-software-src/riscv-isa-sim and https://github.com/riscv-collab/riscv-gnu-toolchain in absence of Chipyard? If that fails, might be an issue for those repositories. If those build successfully, feel free to reopen this issue and ping me and we'll take a look!

jimfangx avatar Jun 18 '26 02:06 jimfangx