kenzok8 / small

ssr passwall homeprxoy 依赖
Apache License 2.0
1.07k stars 808 forks source link

sing-box无法编译 #105

Closed ChaingTsung closed 11 months ago

ChaingTsung commented 11 months ago

编译环境: Ubuntu22.04 x64, OpenWRT official mainline code 目标环境: x64 make-log.txt

...
re/gocode" GO_BUILD_DEPENDS_SRC="/home/yoki/openwrt/staging_dir/target-x86_64_musl/usr/share/gocode/src" GOOS="linux" GOARCH="amd64" GO386="" GOAMD64="v1" GOARM="" GOMIPS="" GOMIPS64="" GOPPC64="" CGO_ENABLED=1 CC="x86_64-openwrt-linux-musl-gcc" CXX="x86_64-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/yoki/openwrt/build_dir/target-x86_64_musl/sing-box-1.6.0=sing-box-1.6.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/include -I/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/include -I/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/include/fortify" CGO_CXXFLAGS="-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -fmacro-prefix-map=/home/yoki/openwrt/build_dir/target-x86_64_musl/sing-box-1.6.0=sing-box-1.6.0 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_LDFLAGS="-L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/lib -L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/lib -fuse-ld=bfd -znow -zrelro" GOPATH="/home/yoki/openwrt/build_dir/target-x86_64_musl/sing-box-1.6.0/.go_work/build" GOCACHE="/home/yoki/openwrt/tmp/go-build" GOMODCACHE="/home/yoki/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 '1699683085' -linkmode external -extldflags '-L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/lib -L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/lib -fuse-ld=bfd -Wl,-z,now -Wl,-z,relro'"        -ldflags " -X github.com/sagernet/sing-box/constant.Version=1.6.0 -buildid '1699683085' -linkmode external -extldflags '-L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/usr/lib -L/home/yoki/openwrt/staging_dir/toolchain-x86_64_gcc-12.3.0_musl/lib -fuse-ld=bfd -Wl,-z,now -Wl,-z,relro'" -tags "with_acme,with_clash_api,with_dhcp,with_ech,with_embedded_tor,with_grpc,with_gvisor,with_lwip,with_quic,with_reality_server,with_utls,with_wireguard"
Finding targets

Building targets
berty.tech/go-libtor/libtor
# berty.tech/go-libtor/libtor
In file included from ../../../../../dl/go-mod-cache/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:48,
                 from ../../../../../dl/go-mod-cache/berty.tech/go-libtor@v1.0.385/libtor/linux_tor_src_lib_tls_tortls_openssl.go:10:
../../../../../dl/go-mod-cache/berty.tech/go-libtor@v1.0.385/libtor/../linux/tor/src/../src/lib/tls/tortls_openssl.c:1176:3: error: missing binary operator before token "1"
 1176 |   SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION != 0
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

make[3]: *** [Makefile:145: /home/yoki/openwrt/build_dir/target-x86_64_musl/sing-box-1.6.0/.built] Error 1
make[3]: Leaving directory '/home/yoki/openwrt/feeds/packages/net/sing-box'
time: package/feeds/packages/sing-box/compile#3.59#2.20#9.63
    ERROR: package/feeds/packages/sing-box failed to build.
make[2]: *** [package/Makefile:128: package/feeds/packages/sing-box/compile] Error 1
make[1]: *** [package/Makefile:122: /home/yoki/openwrt/staging_dir/target-x86_64_musl/stamp/.package_compile] Error 2
make[2]: Leaving directory '/home/yoki/openwrt'
make[1]: Leaving directory '/home/yoki/openwrt'
make: *** [/home/yoki/openwrt/include/toplevel.mk:232: world] Error 2
la8896 commented 11 months ago

注意 编译新版Sing-box和hysteria,需golang版本1.20或者以上版本 ,可以用以下命令

pushd feeds/packages/lang rm -rf golang && svn co https://github.com/openwrt/packages/branches/openwrt-23.05/lang/golang popd