Skip to content

xiyou-linuxer/busybox-loongarch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

busybox-loongarch

安装工具链muslc

  1. 下载 LoongArch musl libc库
git clone https://github.com/LoongsonLab/oscomp-musl-1.2.4.git
cd ./oscomp-musl-1.2.4
  1. 配置编译参数
./configure --target=loongarch64-linux-gnu CFLAGS="-mabi=lp64d" --prefix=/opt/loongarch-muslc

--prefix=/opt/loongarch-muslc:这个选项指定了安装路径。配置后的软件包将安装到 /opt/loongarch-muslc 目录下。

  1. 编译安装
make -j 16
make install -j 16

busybox 编译

  1. 下载 Linux 并引入相关头文件

下载 Linux源码

进入 Linux 源码的目录后执行以下指令

make ARCH=loongarch INSTALL_HDR_PATH=../temp headers_install
  1. 更改busybox的Makefile
CFLAGS		:= $(CFLAGS) -I /**/include
LDFLAGS		:= $(LDFLAGS) -L/**/lib
  1. 修改编译选项
make defconfig
CONFIG_TC=y ==> CONFIG_TC=n

nvim scripts/kconfig/lxdialog/check-lxdialog.sh
main ==> int main()
make menuconfig 设置静态编译

键入命令后进入 menuconfig 界面,按照图中的选项选择后退出并保存

Alt text

Alt text

  1. 编译生成可执行程序
make  CROSS_COMPILE=musl- -j 16
make  CROSS_COMPILE=musl- install -j 16

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published