Closed woni928 closed 6 months ago
如果使用了 go1.22 ,mosdns 源码必须包含这个提交 https://github.com/sbwml/luci-app-mosdns/commit/664253d1e2beff1e3ca7134c69aed9abe116bf8c
也就是直接拉取最新代码即可。
如果使用了 go1.22 ,mosdns 源码必须包含这个提交 664253d
也就是直接拉取最新代码即可。
是拉取的最新源码,依然还是这个错误,纳闷了。怎么解?
go1.22 全架构编译成功的证据 https://github.com/sbwml/luci-app-mosdns/blob/v5/.github/workflows/release-build.yml#L54 https://github.com/sbwml/luci-app-mosdns/actions/runs/8050307911
如果你确实得到上述错误,我只能给的唯一建议只有:确保 OpenWrt 源码下只有 https://github.com/sbwml/luci-app-mosdns 这一个 mosdns 源码,如果你无法确定你的 OpenWrt 源码下是否存在其它来源的 mosdns 包,那就认真阅读 README.md 去清除所有 OpenWrt 目录下已有的 mosdns 包,之后再重新拉取。
PS:如果你根本没法完成这种操作,绝对不建议去编译它,https://github.com/sbwml/luci-app-mosdns/releases/tag/v5.3.1 IPK 安装包更适合使用。
GO_BUILD_CACHE_DIR="/workdir/openwrt/tmp/go-build" GO_MOD_CACHE_DIR="/workdir/openwrt/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/IrineSistiana/mosdns" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/IrineSistiana/mosdns/..." GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1" GO_BUILD_DIR="/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1/.go_work/build" GO_BUILD_BIN_DIR="/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1/.go_work/build/bin/linux_arm64" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/workdir/openwrt/staging_dir/target-aarch64_generic_musl/usr/share/gocode/src" GOOS="linux" GOARCH="arm64" GO386="" GOAMD64="" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CC="aarch64-openwrt-linux-musl-gcc" CXX="aarch64-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -march=armv8-a+crypto -mtune=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1=mosdns-5.3.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/include/fortify -I/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/include" CGO_CXXFLAGS="-Os -pipe -march=armv8-a+crypto -mtune=cortex-a53 -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1=mosdns-5.3.1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/lib -znow -zrelro" CGO_ENABLED=0 GOPATH="/workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1/.go_work/build" GOCACHE="/workdir/openwrt/tmp/go-build" GOMODCACHE="/workdir/openwrt/dl/go-mod-cache" GOENV=off GOTOOLCHAIN=local /usr/bin/env bash ../../lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1708791019' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/lib -Wl,-z,now -Wl,-z,relro'" -ldflags " -X main.version=v5.3.1 -buildid '1708791019' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-aarch64_generic_gcc-11.3.0_musl/lib -Wl,-z,now -Wl,-z,relro'"
Finding targets
Building targets -linkmode requires external (cgo) linking, but cgo is not enabled
make[3]: [Makefile:48: /workdir/openwrt/build_dir/target-aarch64_generic_musl/mosdns-5.3.1/.built] Error 1 make[3]: Leaving directory '/workdir/openwrt/feeds/packages/net/mosdns' time: package/feeds/packages/mosdns/compile#0.44#0.41#0.52 ERROR: package/feeds/packages/mosdns failed to build. make[2]: [package/Makefile:116: package/feeds/packages/mosdns/compile] Error 1 make[2]: Leaving directory '/workdir/openwrt' make[1]: *** [package/Makefile:110: /workdir/openwrt/staging_dir/target-aarch64_generic_musl/stamp/.package_compile] Error 2 make[1]: Leaving directory '/workdir/openwrt'