#1685·hysteria

关于对openwrt-arm_cortex-a9的构建支持

Author: root-wingsCreated Sep 27, 2026Updated Sep 27, 2026
Labelsenhancement

请求 添加一些openwrt支持的架构 但是测试为了能跑是在https://github.com/klzgrad/naiveproxy/releases 这个releases里面找的 openwrt-arm_cortex-a9那个能运行 然后就有了下面的文章

1.由于我的平台是bcm53xx/generic cpu架构是ARMv7 Processor rev 0 (v7l) 查了下相关的编译 要用openwrt-arm_cortex-a9才能正常路由上运行

2.所以找到了 https://archive.openwrt.org/releases/24.10.8/targets/bcm53xx/generic/openwrt-toolchain-24.10.8-bcm53xx-generic_gcc-13.3.0_musl_eabi.Linux-x86_64.tar.zst openwrt编译工具的工具链里面的 toolchain-arm_cortex-a9_gcc-13.3.0_musl_eabi/bin/arm-openwrt-linux-muslgnueabi-gcc

If your application depends on C libraries (like SQLite or crypto libraries), you cannot use CGO_ENABLED=0. You must instead use OpenWrt's cross-compilation toolchain to link against musl-armhf env GOOS=linux
GOARCH=arm
GOARM=7
CGO_ENABLED=1
CC="/path.../bin/arm-openwrt-linux-muslgnueabi-gcc"
go build -o myapp_openwrt

3.但是我不熟悉的编译参数 -ldflags这些 完整的编译参数是怎么样写的呢?或者以后能不能像上面的releases添加对openwrt的支持(内存和存储不用担心够了1g) 实在不会用脚本 里面的一跑得全部跑吧 我想单独编译 有没有人指导一下