fw876 / helloworld

GNU General Public License v3.0
3.64k stars 2.64k forks source link

golang v2ray-plugin-5.7.0 and 5.8.0 compile failed gcc_mipsx.S:27: Error: invalid operands `sw $18,12($29)' #1283

Closed gcp91020 closed 12 months ago

gcp91020 commented 12 months ago

Hi experts,

I could build the image on March 16th 2023 with https://github.com/fw876/helloworld/, and the image worked well.

When I tried to rebuild the image yesterday, I got error "package/feeds/helloworld/v2ray-plugin failed to build" some information as below:

"gcc_mipsx.S: Assembler messages:
gcc_mipsx.S:27: Error: invalid operands `sw $18,12($29)'
gcc_mipsx.S:28: Error: invalid operands `sw $19,16($29)'"

Can anyone help to check?

some of my settings: CONFIG_TARGET_ramips=y CONFIG_TARGET_ramips_mt7621=y CONFIG_TARGET_ramips_mt7621_DEVICE_d-team_newifi-d2=y target-mipsel_24kc_musl/linux-ramips_mt7621/linux-5.15.133

I checked https://github.com/openwrt/packages/issues/8498 , and there was similar error, and fixed with "PKG_USE_MIPS16:=0" I don't whether the issue is similar.

Below is the command from the failed log:

CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" GO_BUILD_CACHE_DIR="/home/runner/work/myRouters/myRouters/openwrt/tmp/go-build" GO_MOD_CACHE_DIR="/home/runner/work/myRouters/myRouters/openwrt/dl/go-mod-cache" GO_MOD_ARGS="-modcacherw" GO_PKG="github.com/shadowsocks/v2ray-plugin" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/shadowsocks/v2ray-plugin/..." GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0" GO_BUILD_DIR="/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0/.go_work/build" GO_BUILD_BIN_DIR="/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0/.go_work/build/bin/linux_mipsle" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/home/runner/work/myRouters/myRouters/openwrt/staging_dir/target-mipsel_24kc_musl/usr/share/gocode/src" GOOS="linux" GOARCH="mipsle" GO386="" GOAMD64="" GOARM="" GOMIPS="softfloat" GOMIPS64="" GOPPC64="" CGO_ENABLED=1 CC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" CGO_CFLAGS="-Os -pipe -mno-branch-likely -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0=v2ray-plugin-5.7.0 -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" CGO_CPPFLAGS="-I/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/include -I/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include/fortify -I/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include" CGO_CXXFLAGS="-Os -pipe -mno-branch-likely -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -msoft-float -fmacro-prefix-map=/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0=v2ray-plugin-5.7.0 -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -mips16 -minterlink-mips16" CGO_LDFLAGS="-L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -fuse-ld=bfd -znow -zrelro" GOPATH="/home/runner/work/myRouters/myRouters/openwrt/build_dir/target-mipsel_24kc_musl/v2ray-plugin-5.7.0/.go_work/build" GOCACHE="/home/runner/work/myRouters/myRouters/openwrt/tmp/go-build" GOMODCACHE="/home/runner/work/myRouters/myRouters/openwrt/dl/go-mod-cache" GOENV=off GOTOOLCHAIN=local /usr/bin/env bash /home/runner/work/myRouters/myRouters/openwrt/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1696622369' -linkmode external -extldflags '-L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -fuse-ld=bfd -Wl,-z,now -Wl,-z,relro'" -installsuffix "softfloat" -ldflags "-X main.VERSION=v5.7.0 -buildid '1696622369' -linkmode external -extldflags '-L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/home/runner/work/myRouters/myRouters/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -fuse-ld=bfd -Wl,-z,now -Wl,-z,relro'"

gcp91020 commented 12 months ago

add below in Makefile

PKG_BUILD_FLAGS:=no-mips16

or modify diy.sh

sed -i 's/PKG_USE_MIPS16/PKG_BUILD_FLAGS:=no-mips16\nPKG_USE_MIPS16/' feeds/helloworld/v2ray-plugin/Makefile

gcp91020 commented 12 months ago

failed to start shadowsocksr, seems some iptables failed to configure prerouting /etc/init.d/shadowsocksr restart rollback to an old version

/etc/init.d/shadowsocksr restart

# Warning: iptables-legacy tables present, use iptables-legacy-save to see them
# Warning: iptables-legacy tables present, use iptables-legacy-save to see them
# Warning: iptables-legacy tables present, use iptables-legacy to see them
# Warning: iptables-legacy tables present, use iptables-legacy-save to see them
# Warning: iptables-legacy tables present, use iptables-legacy-save to see them
iptables v1.8.8 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING
iptables v1.8.8 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING
iptables v1.8.8 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain OUTPUT
ssr-rules[5330]: Start failed!
gcp91020 commented 12 months ago

error:

+ iptables -t nat -I PREROUTING 1 -i br-lan -p tcp -m comment --comment _SS_SPEC_RULE_ -j SS_SPEC_WAN_AC
iptables v1.8.8 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain PREROUTING
+ iptables -t nat -I OUTPUT 1 -p tcp -m comment --comment _SS_SPEC_RULE_ -j SS_SPEC_WAN_AC
iptables v1.8.8 (nf_tables):  CHAIN_ADD failed (No such file or directory): chain OUTPUT

fix opkg update opkg install iptables-legacy vi /usr/bin/ssr-rules

#IPT="iptables -t nat"                                 # alias of iptables
IPT="iptables-legacy -t nat"
gcp91020 commented 12 months ago

the code works for you guys? After some fix, it works for me.

  1. PKG_BUILD_FLAGS:=no-mips16
  2. iptables-nft won't work, use iptables-legacy