Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在openwrt 19.07.3 sdk下编译错误 #23

Closed
j3l11234 opened this issue May 24, 2020 · 7 comments
Closed

在openwrt 19.07.3 sdk下编译错误 #23

j3l11234 opened this issue May 24, 2020 · 7 comments

Comments

@j3l11234
Copy link

在openwrt 19.07.3 sdk下编译错误

make[3]: Entering directory '/data00/home/j3l11234/openwrt/openwrt/package/custom/openwrt-ipt2socks'
rm -f /data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7/.built
touch /data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7/.built_check
CFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7:ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/usr/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include/fortify -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include " CXXFLAGS="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7:ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro  -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/usr/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/usr/include -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include/fortify -I/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include " LDFLAGS="-L/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/usr/lib -L/data00/home/j3l11234/openwrt/openwrt/staging_dir/target-mipsel_24kc_musl/lib -L/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/usr/lib -L/data00/home/j3l11234/openwrt/openwrt/staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/lib -znow -zrelro " make  -C /data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7/. AR="mipsel-openwrt-linux-musl-gcc-ar" AS="mipsel-openwrt-linux-musl-gcc -c -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -iremap/data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7:ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro" LD=mipsel-openwrt-linux-musl-ld NM="mipsel-openwrt-linux-musl-gcc-nm" CC="mipsel-openwrt-linux-musl-gcc" GCC="mipsel-openwrt-linux-musl-gcc" CXX="mipsel-openwrt-linux-musl-g++" RANLIB="mipsel-openwrt-linux-musl-gcc-ranlib" STRIP=mipsel-openwrt-linux-musl-strip OBJCOPY=mipsel-openwrt-linux-musl-objcopy OBJDUMP=mipsel-openwrt-linux-musl-objdump SIZE=mipsel-openwrt-linux-musl-size CROSS="mipsel-openwrt-linux-musl-" ARCH="mipsel" ;
make[4]: Entering directory '/data00/home/j3l11234/openwrt/openwrt/build_dir/target-mipsel_24kc_musl/ipt2socks/ipt2socks-1.1.2-cfbc2189356aba7fcafb0bc961a95419f313d8a7'
mipsel-openwrt-linux-musl-gcc -std=c99 -Wall -Wextra -O3 -pthread -c ipt2socks.c -o ipt2socks.o
cc1: note: someone does not honour COPTS correctly, passed 0 times
ipt2socks.c: In function 'tcp_stream_payload_forward_cb':
ipt2socks.c:729:25: warning: implicit declaration of function 'splice'; did you mean 'pipe'? [-Wimplicit-function-declaration]
         ssize_t nrecv = splice(self_watcher->fd, NULL, self_pipefd[1], NULL, TCP_SPLICE_MAXLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
                         ^~~~~~
                         pipe
ipt2socks.c:729:97: error: 'SPLICE_F_MOVE' undeclared (first use in this function)
         ssize_t nrecv = splice(self_watcher->fd, NULL, self_pipefd[1], NULL, TCP_SPLICE_MAXLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
                                                                                                 ^~~~~~~~~~~~~
ipt2socks.c:729:97: note: each undeclared identifier is reported only once for each function it appears in
ipt2socks.c:729:113: error: 'SPLICE_F_NONBLOCK' undeclared (first use in this function); did you mean 'SOCK_NONBLOCK'?
         ssize_t nrecv = splice(self_watcher->fd, NULL, self_pipefd[1], NULL, TCP_SPLICE_MAXLEN, SPLICE_F_MOVE | SPLICE_F_NONBLOCK);
                                                                                                                 ^~~~~~~~~~~~~~~~~
                                                                                                                 SOCK_NONBLOCK
Makefile:28: recipe for target 'ipt2socks.o' failed
make[4]: *** [ipt2socks.o] Error 1
@zfl9
Copy link
Owner

zfl9 commented May 24, 2020

#22

@zfl9
Copy link
Owner

zfl9 commented May 24, 2020

我做个兼容吧。手动选择SPLICE和普通实现方式。

@small-5
Copy link

small-5 commented May 24, 2020

我做了一个patch,可以编译成功,但未具体测试使用是否正常

001-fix-splice.txt

@j3l11234
Copy link
Author

用了新的 openwrt-ipt2socks之后编译过了,目前看起来是可以正常使用。

@zfl9
Copy link
Owner

zfl9 commented May 27, 2020

周末把这个patch合到master。

@zfl9
Copy link
Owner

zfl9 commented May 30, 2020

尝试着合并了这个补丁,测了下能正常编译(我只有glibc环境。。)见最新release版本。

@zfl9 zfl9 closed this as completed May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@j3l11234 @zfl9 @small-5 and others