2071 views|0 replies

155

Posts

1

Resources
The OP
 

[Sipeed LicheeRV 86 Panel Review] 4. Building a cross-compilation environment [Copy link]

 This post was last edited by sonicfirr on 2022-3-12 13:08

There is a small pit in setting up the Linux cross-toolchain compilation environment for the 86 board. After many attempts, I successfully avoided the pit and summarized it in this article.


1. Avoid pitfalls

The main pitfall is the tool chain version 20210329 provided by the Allwinner official website. The program created by this version will prompt "symbol __libc_start_main version GLIBC_2.29 not defined in file libc.so.6 with link time reference". From the prompt, it can be seen that the compiler did not connect to the __libc_start_main program segment.

Therefore, continue to look for relevant information. It is explained in the D1-H document of "Allwinner Online". The tool chain 20200702 version is provided in the Tina system source code.

I have made many attempts here (learned from the blog of the code farmer who loves learning https://bbs.eeworld.com.cn/thread-1194441-1-1.html ), and also installed the tool chain in d1 Alibaba applet _sdk provided by Pingtou Ge. It is interesting that the installation prompted an error that the python library is missing, but it did not affect the use, and the Hello World example was successfully compiled. I will not repeat the process here.

Anyway, I used a virtual machine, so I installed another version of Ubuntu 20.04, which came with Python 3.8.10, and copied the toolchain from the Tina system source code. Because it was downloaded from another virtual machine before, I used FileZilla to export it to Win10 (my local machine), and then used FileZilla to import it into the Ubuntu 20 virtual machine. This operation caused another problem, that is, the imported file had no execution permission, so I used the chmod command to assign execution permissions to the entire toolchain directory.

The next step is to modify /etc/profile and add the PATH environment variable (I won’t go into details here, if you don’t know how, just search it yourself), and finally compile an executable hello program.

2. Experimental process

First, write a C program. Hello world is very simple, so I won’t post the code.

Then, execute "riscv64-unknown-linux-gnu-gcc hello.c -o hello" and create a programmable program "hello".

The officially recommended way is to use ADB to copy files to the development board. I use FileZilla to export to Windows, and then use MobaXterm's SSH to log in to the development board to copy files. However, there is no execution permission after copying (because the user is different), so just modify it with chmod.

This post is from Domestic Chip Exchange
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list