Hey guys!
I just got my MAix BiT in the mail, and now I’m trying to run some of the demo code from the Kendryte standalone SDK demo repo (<LINK_TEXT text=“https://github.com/kendryte/kendryte-st … ello_world”>https://github.com/kendryte/kendryte-standalone-demo/tree/develop/hello_world</LINK_TEXT>), but I’m getting linker errors.
I’m building the Kendryte GNU toolchain (https://github.com/kendryte/kendryte-gnu-toolchain) as follows:
./configure --prefix=/opt/riscv-toolchain --with-cmodel=medany --with-arch=rv64imafdc --with-abi=lp64d && make -jX, which finishes without error
Then, I’m trying to build the demo code by cloning the Kendryte standalone SDK (https://github.com/kendryte/kendryte-standalone-sdk), coping the demo into the src/ directory, and then running:
mkdir build && cd build
cmake … -DPROJ=hello_world -DTOOLCHAIN=/opt/riscv-toolchain/bin && make
The compilation step completes, but the linker throws many errors such as:
/opt/riscv-toolchain/lib/gcc/riscv64-unknown-elf/8.2.0/…/…/…/…/riscv64-unknown-elf/bin/ld: CMakeFiles/hello_world.dir/src/hello_world/main.c.obj: can’t link hard-float modules with soft-float modules
/opt/riscv-toolchain/lib/gcc/riscv64-unknown-elf/8.2.0/…/…/…/…/riscv64-unknown-elf/bin/ld: failed to merge target specific data of file CMakeFiles/hello_world.dir/src/hello_world/main.c.obj
My understanding is that the either the toolchain or the SDK is being built with the incorrect ABI, causing the float type to not match between them. But from what little information I’ve been able to gather online, I’m building the toolchain with the correct architecture and ABI flags. Is there something I’m missing here?
I’m new to building for riscv, so I’m not really sure what I’m doing wrong here. I’d appreciate any help y’all can give!
Hi there~,
The toolchain and sdk do not match, please use the latest version on github. thanks.