Closed timfaner closed 4 years ago
尝试编译riscv-glibc 并找到其中的pthread ,build指南
riscv工具链不支持 某些功能 需要添加编译参数。
Is this a compiler that you built yourself, or one that you downloaded from somewhere?
I would guess that the libraries were not compiled -mcmodel=medany, and you are linking to an address at or above 0x80000000. If this is a compiler you built yourself, then add --with-cmodel=medany when configuring.
Originally posted by @jim-wilson in https://github.com/riscv/riscv-gnu-toolchain/issues/457#issuecomment-504835065
同时g++ 编译时候文件有顺序,
g++ TestAll.cpp functions.cpp functionsTest.cpp -o mm -lgtest -lpthread
编译成功 新的问题:运行时候
assertion failed - (addr & (nr_bytes - 1)) == 0
pthread 不支持,放弃这个路线
CMake 使用CTest作为测试,测试不能在riscv环境里运行,有什么比较好的办法运行测试吗