Skip to content

Commit

Permalink
增加交叉编译说明
Browse files Browse the repository at this point in the history
  • Loading branch information
Izumiko committed Dec 29, 2021
1 parent a2fe09a commit beece23
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` 来生成程序。

## 用法

```
Expand Down
8 changes: 8 additions & 0 deletions src/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit beece23

Please sign in to comment.