Chion82 / netfilter-full-cone-nat

A kernel module to turn MASQUERADE into full cone SNAT
GNU General Public License v2.0
433 stars 124 forks source link

请求支援 Kernel 5.4 #30

Closed kiddin9 closed 4 years ago

kiddin9 commented 4 years ago

报错如下

2020-03-17T11:19:53.2575814Z /usr/bin/ld: warning: libc.so, needed by /home/runner/work/Actions-OpenWrt-Snapshot/Actions-OpenWrt-Snapshot/openwrt/staging_dir/target-x86_64_musl/usr/lib/libelf.so, not found (try using -rpath or -rpath-link)
2020-03-17T11:19:53.2581773Z /usr/bin/ld: /home/runner/work/Actions-OpenWrt-Snapshot/Actions-OpenWrt-Snapshot/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.24/tools/objtool/objtool: hidden symbol `fstat' in /usr/lib/x86_64-linux-gnu/libc_nonshared.a(fstat.oS) is referenced by DSO
2020-03-17T11:19:53.2586212Z /usr/bin/ld: final link failed: Bad value
2020-03-17T11:19:53.2586378Z collect2: error: ld returned 1 exit status
2020-03-17T11:19:53.2586943Z make[6]: *** [/home/runner/work/Actions-OpenWrt-Snapshot/Actions-OpenWrt-Snapshot/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.24/tools/objtool/objtool] Error 1
2020-03-17T11:19:53.2587114Z make[5]: *** [objtool] Error 2
2020-03-17T11:19:53.2590034Z make[4]: *** [tools/objtool] Error 2
2020-03-17T11:19:53.2590845Z make[3]: *** [/home/runner/work/Actions-OpenWrt-Snapshot/Actions-OpenWrt-Snapshot/openwrt/build_dir/target-x86_64_musl/linux-x86_64/fullconenat-2018-12-15-latest/.built] Error 2
2020-03-17T11:19:53.2591426Z Makefile:49: recipe for target '/home/runner/work/Actions-OpenWrt-Snapshot/Actions-OpenWrt-Snapshot/openwrt/build_dir/target-x86_64_musl/linux-x86_64/linux-5.4.24/tools/objtool/objtool' failed
2020-03-17T11:19:53.2591797Z Makefile:67: recipe for target 'objtool' failed
2020-03-17T11:19:53.2592136Z Makefile:1794: recipe for target 'tools/objtool' failed
Chion82 commented 4 years ago

这看起来像是链接的问题。在 x86 的 5.4 内核上可以编译通过吗?

kiddin9 commented 4 years ago

我测试的是openwrt x86.

tinnlux commented 4 years ago

@Chion82 openwrt X86用的https://github.com/LGA1150/openwrt-fullconenat的源码同样的错误,LGA1150也是直接引用的netfilter-full-cone-nat项目的源码。请问应该怎么修复?

llccd commented 4 years ago

@garypang13 你用make -j1 V=s单线程编译就能发现这个问题和fullconenat没关系,是编译objtool时报的错。你可以试试在Advanced configuration options (for developers) > Toolchain Options里面把GCC compiler Version Binutils Version都改成最新版再编译。我用gcc 9.3+Binutils 2.34可以正常编译32位的openwrt X86

kiddin9 commented 4 years ago

@llccd 我用的是gcc 8.4+Binutils 2.31 版本并不低,以前都是用的这个版本,都能正常编译 lean的用的gcc 7+Binutils 2.31 也能编译成功. 所以不是gcc和Binutils版本导致的. 就是升级Kernel到5.4才出现的这个问题.

tinnlux commented 4 years ago

@llccd 我自己测试更改gcc和Binutils为最新版后,在openwrt主线5.4内核下依然失败,但是下午要上班没来得及V=s细看具体错误。在openwrt主线4.19内核下低版本gcc和Binutils都无问题,可以编译通过。且5.4内核下,与4.19内核同一个config,只是去掉fullconenat就可编译通过。变量只有fullconenat

llccd commented 4 years ago

@tinnlux 你用我改过的Makefile https://github.com/llccd/openwrt-fullconenat试一下

tinnlux commented 4 years ago

@llccd 十分感谢,我得明天才能测试了。

kiddin9 commented 4 years ago

@tinnlux 我测试编译成功了,感谢 @llccd