sbwml / luci-app-alist

LuCI support for Alist
https://github.com/AlistGo/alist
1.34k stars 203 forks source link

alist: fix compilation with musl 1.2.4后编译仍然报错 #68

Closed zcy85611 closed 1 year ago

zcy85611 commented 1 year ago

更新了makefile后,仍然报错,但从日志来看已经有-D_LARGEFILE64_SOURCE

用的是github actions,ubuntu 22.04,大佬能否帮助看下如何解决,谢谢!

make[3]: Entering directory '/workdir/openwrt/package/aaa/alist'
rm -f /workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.built
touch /workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.built_check
CONFIG_GOLANG_MOD_CACHE_WORLD_READABLE="" 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/alist-org/alist" GO_INSTALL_EXTRA="" GO_INSTALL_ALL="" GO_SOURCE_ONLY="" GO_BUILD_PKG="github.com/alist-org/alist/..." GO_EXCLUDES="" GO_GO_GENERATE="" GO_INSTALL_BIN_PATH="/usr/bin" BUILD_DIR="/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0" GO_BUILD_DIR="/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.go_work/build" GO_BUILD_BIN_DIR="/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.go_work/build/bin/linux_mipsle" GO_BUILD_DEPENDS_PATH="/usr/share/gocode" GO_BUILD_DEPENDS_SRC="/workdir/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=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0=alist-3.17.0 -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -D_LARGEFILE64_SOURCE" CGO_CPPFLAGS="-I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/include -I/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/include/fortify -I/workdir/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=/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0=alist-3.17.0 -mips16 -minterlink-mips16 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -D_LARGEFILE64_SOURCE -mips16 -minterlink-mips16" CGO_LDFLAGS="-L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -znow -zrelro" GOPATH="/workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.go_work/build" GOCACHE="/workdir/openwrt/tmp/go-build" GOMODCACHE="/workdir/openwrt/dl/go-mod-cache" GOENV=off /usr/bin/env bash /workdir/openwrt/feeds/packages/lang/golang//golang-build.sh build -v -buildvcs=false -trimpath -ldflags "all=-buildid '1685051580' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -Wl,-z,now -Wl,-z,relro'"     -installsuffix "softfloat"   -ldflags "-w -s -X github.com/alist-org/alist/v3/internal/conf.Version=v3.17.0-mipsel -X github.com/alist-org/alist/v3/internal/conf.WebVersion=3.17.0 -buildid '1685051580' -linkmode external -extldflags '-L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/usr/lib -L/workdir/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-12.3.0_musl/lib -Wl,-z,now -Wl,-z,relro'"  
Finding targets

Building targets
runtime/cgo
# runtime/cgo
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)'
gcc_mipsx.S:29: Error: invalid operands `sw $20,20($29)'
gcc_mipsx.S:30: Error: invalid operands `sw $21,24($29)'
gcc_mipsx.S:31: Error: invalid operands `sw $22,28($29)'
gcc_mipsx.S:32: Error: invalid operands `sw $23,32($29)'
gcc_mipsx.S:33: Error: invalid operands `sw $30,36($29)'
gcc_mipsx.S:46: Error: invalid operands `jalr $20'
gcc_mipsx.S:50: Error: invalid operands `lw $18,12($29)'

gcc_mipsx.S:51: Error: invalid operands `lw $19,16($29)'
gcc_mipsx.S:52: Error: invalid operands `lw $20,20($29)'
gcc_mipsx.S:53: Error: invalid operands `lw $21,24($29)'
gcc_mipsx.S:54: Error: invalid operands `lw $22,28($29)'
gcc_mipsx.S:55: Error: invalid operands `lw $23,32($29)'
gcc_mipsx.S:56: Error: invalid operands `lw $30,36($29)'
gcc_mipsx.S:65: Error: invalid operands `lw $31,0($29)'
make[3]: *** [Makefile:81: /workdir/openwrt/build_dir/target-mipsel_24kc_musl/alist-3.17.0/.built] Error 1
sbwml commented 1 year ago

fix https://github.com/sbwml/luci-app-alist/commit/df475d1b5718e26b3b577324dda25e81fc0c717d