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

Not found -lstdc++ #11

Open
bigmagic123 opened this issue Sep 7, 2021 · 2 comments
Open

Not found -lstdc++ #11

bigmagic123 opened this issue Sep 7, 2021 · 2 comments

Comments

@bigmagic123
Copy link

bigmagic123 commented Sep 7, 2021

通过自己编译riscv-gnu-toolchain,命令行如下:

make clean
./configure --prefix=$RISCV --enable-multilib --with-cmodel=medany
make -j8

riscv-gnu-toolchain:
https://github.com/linsinan1995/riscv-gnu-toolchain
子模块都更新到最新,最后编译的库文件如下:

$RISCV/riscv64-unknown-elf/lib/
crt0.o     libc.a       libg.a      libgloss_nano.a  libm.a       libnosys.a     libsim.a    nosys.specs  rv32iac  rv32imac   rv64imac   rv64imafdc      sim.specs
ldscripts  libc_nano.a  libgloss.a  libg_nano.a      libm_nano.a  libsemihost.a  nano.specs  rv32i        rv32im   rv32imafc  rv64imacp  semihost.specs

而我在官方下载的最新的riscv-gnu-toolchain编译的库如下:

ls $RISCV/riscv64-unknown-elf/lib/
crt0.o     libc.a       libg.a      libgloss_nano.a  libm.a       libnosys.a     libsim.a     libstdc++.a-gdb.py  libsupc++.a   nano.specs   rv32i    rv32im    rv32imafc  semihost.specs
ldscripts  libc_nano.a  libgloss.a  libg_nano.a      libm_nano.a  libsemihost.a  libstdc++.a  libstdc++.la        libsupc++.la  nosys.specs  rv32iac  rv32imac  rv64imac   sim.specs

明显可以看到libstdc++.a缺失了,请问我该如何将libstdc++.a让其编译进去,或者改动哪些编译特性才能正常生成?

@pz9115
Copy link

pz9115 commented Sep 7, 2021

@bigmagic123 你好,因为打开了multilib, 我想你的库会被放在更深层的/rv{$XLEN}{$arch}/{$abi}中,请到$RISCV/riscv64-unknown-elf/lib/rv32i/ilp32下看看

@linsinan1995
Copy link
Owner

linsinan1995 commented Sep 7, 2021

我的toolchain仓库只用来测试的,建议直接用原版的riscv-gnu-toolchain, 然后

cd riscv-gcc
git add remote lin https://github.com/linsinan1995/riscv-gcc.git
git remote update
git checkout lin/riscv-gcc-experiment-p-ext

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

3 participants