Kendryte GNU toolchain build flags

We are releasing a wide selection of AI products AIoT projects. Here you'll find the latest AI Hardware updates and comprehensive support. Please feel free to leave comments/suggestions and share your experience.

Moderators: lily.li, violet

Post Reply
andrewjamest1993818
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Fri Apr 05, 2019 12:44 am

Kendryte GNU toolchain build flags

Post by andrewjamest1993818 » Fri Apr 05, 2019 12:57 am

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 (https://github.com/kendryte/kendryte-st ... ello_world), 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! :)

bill.yu
Elementary-5
Elementary-5
Posts: 597
Joined: Mon Apr 02, 2018 11:05 am

Re: Kendryte GNU toolchain build flags

Post by bill.yu » Fri Jun 21, 2019 9:04 am

Hi there~,

The toolchain and sdk do not match, please use the latest version on github. thanks.

Post Reply