📒
Loongbian
  • Loongbian 操作系统
  • 系统
    • 安装指南
    • 安装本地 GCC 编译器
    • 安装交叉 GCC 编译器
    • 定制 Linux 内核:交叉编译
    • 更新 PMON 固件(危险)
  • IO
    • Loongpio 库
    • Adafruit Blinka 库
      • 安装
      • 引脚命名
      • 样例程序
        • 板载 GPIO 输出:有源蜂鸣器
        • 板载 GPIO 输出:闪烁 LED 灯
        • 板载 GPIO 输入:按钮模块
        • 板载 GPIO:HC-SR04 超声波传感器
        • 板载 PWM:呼吸灯
        • PCA9685 PWM:舵机
        • 板载 I2C:PN532 RFID 模块
Powered by GitBook
On this page
  • 安装
  • 验证安装是否成功

Was this helpful?

  1. 系统

安装交叉 GCC 编译器

交叉编译器:编译器本身运行的平台与该编译器编译出的二进制程序运行平台不一致。常用于在 PC(x86_64)环境下编译其它平台(如龙芯)的程序。

Loongbian 提供宿主 x86_64 平台,目标 Loongson(mips64el)平台的交叉编译器。

安装

进入 root 用户 shell(如使用 sudo -i 或者 su root -l 命令),然后运行

$ apt install ca-certificates apt-transport-https wget
$ echo "deb https://mirrors.teach.com.cn/toolchain/debian buster main" > /etc/apt/sources.list.d/loongbian-toolchain.list
$ wget https://mirrors.teach.com.cn/loongbian/loongbian-archive-keyring.gpg -O - | apt-key add -
$ apt update
$ apt install gcc-mips64el-linux-gnuabi64 binutils-mips64el-linux-gnuabi64

验证安装是否成功

$ mips64el-linux-gnuabi64-gcc -v
...
gcc version 8.3.0 (Debian 8.3.0-6+loongbian1)

确保版本号中包含 loongbian 字样。

Previous安装本地 GCC 编译器Next定制 Linux 内核:交叉编译

Last updated 4 years ago

Was this helpful?