embecosm提供了gdbserver+ri5cy/picorv32/gdbsim环境
https://github.com/embecosm/riscv-gdbserver
https://github.com/embecosm/riscv-toolchain.git 里面集成riscv32-unknown-elf-gcc和riscv32-unknown-elf-gdb源码,为了编译这些源码host最好采用自编译的x86_64_gcc-4.8.4,过程如下
【1】x86_64 gcc-4.8.4编译踩坑
参照https://blog.csdn.net/OliverkingLi/article/details/89645710
目录下准备 gmp-4.3.2、 mpc-0.8.1、mpfr-2.4.2
ln -sf gmp-4.3.2 gmp
ln -sf mpc-0.8.1 mpc
ln -sf mpfr-2.4.2 mpfr
mkdir objdir
cd objdir
../configure --disable-checking --enable-languages=c,c++ --disable-multilib --prefix=/work/riscv/embecosm/gcc-4.8.4/install --enable-threads=posix
make -j4
如果出现version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55
参照 https://blog.csdn.net/u010741000/article/details/86513205, 将/usr/lib/x86_64-linux-gnu/libstdc++.so.6链接到对应的文件上
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /work/riscv/embecosm/gcc-4.8.4/objdir/x86_64-unknown-linux-gnu/libstdc-v3/src/.libs/libstdc.so.6
make install
cd gmp/mpc/mpfr 中make install
设置环境变量
export PATH=/work/riscv/embecosm/gcc-4.8.4/install/bin:/work/riscv/embecosm/gcc-4.8.4/install/lib64:$PATH
export LD_LIBRARY_PATH=/work/riscv/embecosm/gcc-4.8.4/install/lib64/:/work/riscv/embecosm/gcc-4.8.4/install/lib/:$LD_LIBRARY_PATH
【2】编译riscv32-unknown-elf-gcc/gdb
【3】编译riscv-gdbserver
【1】x86_64 gcc-4.8.4编译踩坑
参照https://blog.csdn.net/OliverkingLi/article/details/89645710
目录下准备 gmp-4.3.2、 mpc-0.8.1、mpfr-2.4.2
ln -sf gmp-4.3.2 gmp
ln -sf mpc-0.8.1 mpc
ln -sf mpfr-2.4.2 mpfr
mkdir objdir
cd objdir
../configure --disable-checking --enable-languages=c,c++ --disable-multilib --prefix=/work/riscv/embecosm/gcc-4.8.4/install --enable-threads=posix
make -j4
如果出现version `CXXABI_1.3.8' not found (required by /usr/lib/x86_64-linux-gnu/libicuuc.so.55
参照 https://blog.csdn.net/u010741000/article/details/86513205, 将/usr/lib/x86_64-linux-gnu/libstdc++.so.6链接到对应的文件上
ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /work/riscv/embecosm/gcc-4.8.4/objdir/x86_64-unknown-linux-gnu/libstdc-v3/src/.libs/libstdc.so.6
make install
cd gmp/mpc/mpfr 中make install
设置环境变量
export PATH=/work/riscv/embecosm/gcc-4.8.4/install/bin:/work/riscv/embecosm/gcc-4.8.4/install/lib64:$PATH
export LD_LIBRARY_PATH=/work/riscv/embecosm/gcc-4.8.4/install/lib64/:/work/riscv/embecosm/gcc-4.8.4/install/lib/:$LD_LIBRARY_PATH
【2】编译riscv32-unknown-elf-gcc/gdb
【3】编译riscv-gdbserver