riscv-collab / riscv-gnu-toolchain

GNU toolchain for RISC-V, including GCC
Other
3.56k stars 1.17k forks source link

Missing libnsl and libsocket #1619

Closed robiwano closed 4 days ago

robiwano commented 4 days ago

I'm trying to compile a project (gcc + glibc, i.e. make linux), and compilation works perfectly. Linking however fails with: /opt/riscv64-unknown-linux-gcc-14/bin/../lib/gcc/riscv64-unknown-linux-gnu/14.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find -lnsl: No such file or directory /opt/riscv64-unknown-linux-gcc-14/bin/../lib/gcc/riscv64-unknown-linux-gnu/14.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find -lsocket: No such file or directory collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.

Adding a symbolic link under ../sysroot/lib: > ln -s libnsl.so.1 libnsl.so

makes the first linker error go away, but I'm still stuck with the second. Ideas?

TommyMurphyTM1234 commented 4 days ago

Presumably, libsocket isn't part of the GCC RISC-V Linux toolchain so you'll need to do a (RISC-V cross) build of it yourself if you need to use it?

robiwano commented 4 days ago

Way ahead of ya!! :) Thanks, that is what I did and it works brilliantly!