From beece23b626df1fee191c811a9e010a9a8ed0b22 Mon Sep 17 00:00:00 2001 From: Izumiko Date: Wed, 29 Dec 2021 22:42:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=A4=E5=8F=89=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 +++++++++++ src/nim.cfg | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index dcc8533..f1facde 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,17 @@ cd buaalogin nimble build ``` +交叉编译说明: +假设Host是Linux x64,编译mipsel架构路由上使用的版本,则在`src/nim.cfg`中增加如下配置(具体路径根据openwrt编译路径填写) + +```shell +mipsel.linux.gcc.path = "/home/user/lede/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin" +mipsel.linux.gcc.exe = "mipsel-openwrt-linux-gcc" +mipsel.linux.gcc.linkerexe = "mipsel-openwrt-linux-gcc" +``` + +之后执行 `nim c --cpu:mipsel --os:linux src/main.nim` 来生成程序。 + ## 用法 ``` diff --git a/src/nim.cfg b/src/nim.cfg index 6e85022..c062d42 100644 --- a/src/nim.cfg +++ b/src/nim.cfg @@ -4,3 +4,11 @@ d:ssl d:strip d:lto out:buaalogin + +mipsel.linux.gcc.path = "/home/user/lede/staging_dir/toolchain-mipsel_24kc_gcc-8.4.0_musl/bin" +mipsel.linux.gcc.exe = "mipsel-openwrt-linux-gcc" +mipsel.linux.gcc.linkerexe = "mipsel-openwrt-linux-gcc" + +arm64.linux.gcc.path = "/home/user/gcc-arm-10.2-2020.11-x86_64-aarch64-none-linux-gnu/bin" +arm64.linux.gcc.exe = "aarch64-none-linux-gnu-gcc" +arm64.linux.gcc.linkerexe = "aarch64-none-linux-gnu-gcc"