悬赏10 恩山币未解决
本帖最后由 欧哈哈哈 于 2025-2-11 23:13 编辑
不知道论坛里的大佬们有没有研究过,用arm架构的设备编译openwrt,比如n1,比如手机。不是不能用action云编译,电脑配置也足够编译,只不过想玩玩,尝试达到N1自己编译自己然后自己升级的目的,可惜半途而废了。
目前根据别人的研究,arm版的ubuntu 22.04的所有编译依赖都安装上了,如下:
sudo apt update -y
sudo apt full-upgrade -y
sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
bzip2 ccache clang cmake cpio curl device-tree-compiler ecj fastjar flex gawk gettext \
git gnutls-dev gperf haveged help2man intltool libelf-dev \
libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev \
libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool lld llvm lrzsz mkisofs msmtp \
nano ninja-build p7zip p7zip-full patch pkgconf python3 python3-pip python3-ply golang-go \
python3-pyelftools qemu-utils re2c rsync scons squashfs-tools subversion swig \
texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf 复制代码
但是在编译过程中遇到了非常多问题,我解决了一两个,由于水平实在有限,还是不能编译出包。
编译ucl的时候,提示无法获取到系统架构,这个问题百度了一下解决了,需要在./configure 后加 --build=arm-linux,我的方法是修改tools/ucl/Makefile 中./configure一行。 编译到qemu时,提示 Unsupported CPU = aarch64 。我查了很多,qemu最新的源码可以在arm下编译成功,故替换feeds/packages/utils/qemu 到tools/qemu 换编译新三固件,编译到golang ,提示Makefile:380: *** go-bootstrap cannot be installed on linux/arm64. Stop.解决方法为apt install golang-go,然后配置文件修改languages-go-configation-external bootstrap go root directroy ,添加/usr/local/go,或者安装后直接编辑config,找到并修改CONFIG_GOLANG_EXTERNAL_BOOTSTRAP_ROOT="/usr/bin/go" 编译node时,提示 cc1:error:unrecognized command line option "-m64",makefile 的109行--dest-cpu=$(NODEJS_CPU) \ 换成--dest-cpu=arm64 \ naiveproxy报错,删除lean/feeds/helloworld/naiveproxy/src/init_env.sh 的22行: [ "$(uname)" != "Linux" -o "$(uname -m)" != "x86_64" ] && { echo -e "Support Linux AMD64 only."; exit 1; };最新版naiveproxy-92.0.4515.107-1删除这项已经没有用了,仍旧报错:
( cd "/home/123/lede/build_dir/target-x86_64_musl/naiveproxy-92.0.4515.107-1/src" ; . ../init_env.sh "x86_64" "" "" "/home/123/lede/staging_dir/toolchain-x86_64_gcc-8.4.0_musl" ; export naive_flags+=" ${naive_ccache_flags}" ; mkdir -p "out" ; ./gn/out/gn gen "out/Release" --args="${naive_flags}" --script-executable="python" ; )
bash: ./gn/out/gn: cannot execute binary file: Exec format error
以上问题的部分解决方案感谢@mike22437120 ,最基础的编译已经能通过,另外选的luci等部分问题不好解决,直接取消编译,大部分常用插件编译通过
各位大佬群策群力,如能有大佬根据各种解决方案向lean提交commit以支持arm编译就更好了
230815更新依赖安装
重新clone后全新编译,在刚开始就出错,编译libressl时,编译到libcrypto提示
aes/aes-elf-armv4.S: Assembler messages:
aes/aes-elf-armv4.S:3: Error: unknown pseudo-op: `.code'
aes/aes-elf-armv4.S:72: Error: junk at end of line, first unrecognized character is `@'
一大堆这样的错误。前一段时间编译并没有问题,不知道为啥突然出问题了
210320更新:换回18.04,然后重新打包libressl-3.3.1为3.0.2,替换掉,编译成功。应该是18.04的gcc可用
我来回答