Message ID | 1524069781-671-1-git-send-email-guillaume.bressaix@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [1/1] reaver: add missing dependency on non static lib. | expand |
On 18-04-18 18:43, Guillaume W. Bres wrote: > Fixes > > http://autobuild.buildroot.net/results/519b4347f496c043ddecdf15f57efb0b3addee42 > http://autobuild.buildroot.net/results/c3daad76473a704e379634e3b87d51468a353f41 > > lpcap is not found when BR2_STATIC_LIBS=y Instead of just blindly disabling static, it's worthwhile to try to fix it instead. You can use the pattern that is used in e.g. arp-scan: ifeq ($(BR2_STATIC_LIBS),y) REAVER_CONF_OPTS += \ LDFLAGS="$(TARGET_LDFLAGS) `$(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs`" endif (untested). Regards, Arnout > > Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com> > --- > package/reaver/Config.in | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/package/reaver/Config.in b/package/reaver/Config.in > index 0fd8ab7..3e73d0e 100644 > --- a/package/reaver/Config.in > +++ b/package/reaver/Config.in > @@ -1,5 +1,6 @@ > config BR2_PACKAGE_REAVER > bool "reaver" > + depends on !BR2_STATIC_LIBS > select BR2_PACKAGE_LIBPCAP > help > Reaver is a tool to audit networks against brute WPS pins > @@ -7,3 +8,6 @@ config BR2_PACKAGE_REAVER > > https://code.google.com/archive/p/reaver-wps/wikis/README.wiki > https://github.com/t6x/reaver-wps-fork-t6x > + > +comment "reaver needs a toolchain w/ dynamic library" > + depends on BR2_STATIC_LIBS >
Thank you, yes you are right. I improved my methods, I reproduced the build error here by copying the config file. I improved things a little bit with ifeq ($(BR2_STATIC_LIBS),y) # --static seems to cause the pb REAVER_CONF_ENV += ac_cv_lib_pcap_pcap_open_live=yes endif it's less dramatic but still a dirty work around: libpcap is properly selected by the package, so has been previously downloaded & installed by buildroot. -lpcap is properly passed to the linker from my first submission. Yet pcap_open_live test by configure still fails. My understanding is the line I just added avoids testing "pcap_open_live" which causes a failure. Dunno if you're okay with that. Make now actually proceeds further & produces some new errors, yet still somehow related to pcap, I could use your input on them: step that fails now: $buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/lib64/../lib64/libpcap.a(pcap-dbus.o): In function `dbus_write': pcap-dbus.c:(.text+0x48): undefined reference to `dbus_message_demarshal' pcap-dbus.c:(.text+0x8c): undefined reference to `dbus_message_demarshal' I started googling & looking at dbus related packages but haven't made any progress yet Guillaume William Bres-Saix Software engineer - NIST 325 Broadway, Boulder, CO 80305 <guillaume.bressaix@gmail.com> 2018-04-18 23:55 GMT+02:00 Arnout Vandecappelle <arnout@mind.be>: > > > On 18-04-18 18:43, Guillaume W. Bres wrote: > > Fixes > > > > http://autobuild.buildroot.net/results/ > 519b4347f496c043ddecdf15f57efb0b3addee42 > > http://autobuild.buildroot.net/results/ > c3daad76473a704e379634e3b87d51468a353f41 > > > > lpcap is not found when BR2_STATIC_LIBS=y > > Instead of just blindly disabling static, it's worthwhile to try to fix it > instead. You can use the pattern that is used in e.g. arp-scan: > > ifeq ($(BR2_STATIC_LIBS),y) > REAVER_CONF_OPTS += \ > LDFLAGS="$(TARGET_LDFLAGS) `$(STAGING_DIR)/usr/bin/pcap-config > --static > --additional-libs`" > endif > > (untested). > > Regards, > Arnout > > > > > Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com> > > --- > > package/reaver/Config.in | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/package/reaver/Config.in b/package/reaver/Config.in > > index 0fd8ab7..3e73d0e 100644 > > --- a/package/reaver/Config.in > > +++ b/package/reaver/Config.in > > @@ -1,5 +1,6 @@ > > config BR2_PACKAGE_REAVER > > bool "reaver" > > + depends on !BR2_STATIC_LIBS > > select BR2_PACKAGE_LIBPCAP > > help > > Reaver is a tool to audit networks against brute WPS pins > > @@ -7,3 +8,6 @@ config BR2_PACKAGE_REAVER > > > > https://code.google.com/archive/p/reaver-wps/wikis/README.wiki > > https://github.com/t6x/reaver-wps-fork-t6x > > + > > +comment "reaver needs a toolchain w/ dynamic library" > > + depends on BR2_STATIC_LIBS > > > > -- > Arnout Vandecappelle arnout at mind be > Senior Embedded Software Architect +32-16-286500 > Essensium/Mind http://www.mind.be > G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven > LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle > GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF > <div dir="ltr">Thank you, yes you are right.<div><br></div><div>I improved my methods, I reproduced the build error here by copying the config file. I improved things a little bit with</div><div><br></div><div><div>ifeq ($(BR2_STATIC_LIBS),y) # --static seems to cause the pb</div><div>REAVER_CONF_ENV += ac_cv_lib_pcap_pcap_open_live=yes</div><div>endif</div><div><br></div><div>it's less dramatic but still a dirty work around: </div><div>libpcap is properly selected by the package, so has been previously downloaded & installed by buildroot. -lpcap is properly passed to the linker from my first submission. Yet pcap_open_live test by configure still fails. My understanding is the line I just added avoids testing "pcap_open_live" which causes a failure. Dunno if you're okay with that.</div><div><br></div><div>Make now actually proceeds further & produces some new errors, yet still somehow related to pcap, I could use your input on them:</div><div><br></div></div><div>step that fails now:</div><div><div>$buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/lib64/../lib64/libpcap.a(pcap-dbus.o): In function `dbus_write':</div><div>pcap-dbus.c:(.text+0x48): undefined reference to `dbus_message_demarshal'</div><div>pcap-dbus.c:(.text+0x8c): undefined reference to `dbus_message_demarshal'</div></div><div><br></div><div>I started googling & looking at dbus related packages but haven't made any progress yet</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><div><font face="arial,helvetica,sans-serif">Guillaume William Bres-Saix<br></font></div><font face="arial,helvetica,sans-serif">Software engineer</font> - NIST<br>325 Broadway, Boulder, CO 80305</div><font face="arial,helvetica,sans-serif"></font></div><font face="arial,helvetica,sans-serif"><<a href="mailto:guillaume.bressaix@gmail.com" target="_blank">guillaume.bressaix@gmail.com</a>><br></font></div></div></div></div></div></div></div> <br><div class="gmail_quote">2018-04-18 23:55 GMT+02:00 Arnout Vandecappelle <span dir="ltr"><<a href="mailto:arnout@mind.be" target="_blank">arnout@mind.be</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br> <br> On 18-04-18 18:43, Guillaume W. Bres wrote:<br> > Fixes<br> > <br> > <a href="http://autobuild.buildroot.net/results/519b4347f496c043ddecdf15f57efb0b3addee42" rel="noreferrer" target="_blank">http://autobuild.buildroot.<wbr>net/results/<wbr>519b4347f496c043ddecdf15f57efb<wbr>0b3addee42</a><br> > <a href="http://autobuild.buildroot.net/results/c3daad76473a704e379634e3b87d51468a353f41" rel="noreferrer" target="_blank">http://autobuild.buildroot.<wbr>net/results/<wbr>c3daad76473a704e379634e3b87d51<wbr>468a353f41</a><br> > <br> > lpcap is not found when BR2_STATIC_LIBS=y<br> <br> </span> Instead of just blindly disabling static, it's worthwhile to try to fix it<br> instead. You can use the pattern that is used in e.g. arp-scan:<br> <br> ifeq ($(BR2_STATIC_LIBS),y)<br> REAVER_CONF_OPTS += \<br> LDFLAGS="$(TARGET_LDFLAGS) `$(STAGING_DIR)/usr/bin/pcap-<wbr>config --static<br> --additional-libs`"<br> endif<br> <br> (untested).<br> <br> Regards,<br> Arnout<br> <span class=""><br> > <br> > Signed-off-by: Guillaume W. Bres <<a href="mailto:guillaume.bressaix@gmail.com">guillaume.bressaix@gmail.com</a>><br> > ---<br> > package/reaver/Config.in | 4 ++++<br> > 1 file changed, 4 insertions(+)<br> > <br> > diff --git a/package/reaver/Config.in b/package/reaver/Config.in<br> > index 0fd8ab7..3e73d0e 100644<br> > --- a/package/reaver/Config.in<br> > +++ b/package/reaver/Config.in<br> > @@ -1,5 +1,6 @@<br> > config BR2_PACKAGE_REAVER<br> > bool "reaver"<br> > + depends on !BR2_STATIC_LIBS<br> > select BR2_PACKAGE_LIBPCAP<br> > help<br> > Reaver is a tool to audit networks against brute WPS pins<br> > @@ -7,3 +8,6 @@ config BR2_PACKAGE_REAVER<br> > <br> > <a href="https://code.google.com/archive/p/reaver-wps/wikis/README.wiki" rel="noreferrer" target="_blank">https://code.google.com/<wbr>archive/p/reaver-wps/wikis/<wbr>README.wiki</a><br> > <a href="https://github.com/t6x/reaver-wps-fork-t6x" rel="noreferrer" target="_blank">https://github.com/t6x/reaver-<wbr>wps-fork-t6x</a><br> > +<br> > +comment "reaver needs a toolchain w/ dynamic library"<br> > + depends on BR2_STATIC_LIBS<br> > <br> <br> -- <br> </span>Arnout Vandecappelle arnout at mind be<br> Senior Embedded Software Architect +32-16-286500<br> Essensium/Mind <a href="http://www.mind.be" rel="noreferrer" target="_blank">http://www.mind.be</a><br> G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven<br> LinkedIn profile: <a href="http://www.linkedin.com/in/arnoutvandecappelle" rel="noreferrer" target="_blank">http://www.linkedin.com/in/<wbr>arnoutvandecappelle</a><br> GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF<br> </blockquote></div><br></div>
[Please don't top-post, but reply in-line like I do below.] On 19-04-18 23:35, Guillaume William Bres wrote: > Thank you, yes you are right. > > I improved my methods, I reproduced the build error here by copying the config > file. I improved things a little bit with > > ifeq ($(BR2_STATIC_LIBS),y) # --static seems to cause the pb > REAVER_CONF_ENV += ac_cv_lib_pcap_pcap_open_live=yes > endif > > it's less dramatic but still a dirty work around: > libpcap is properly selected by the package, so has been previously downloaded & > installed by buildroot. -lpcap is properly passed to the linker from my first > submission. Yet pcap_open_live test by configure still fails. My understanding > is the line I just added avoids testing "pcap_open_live" which causes a failure. > Dunno if you're okay with that. > > Make now actually proceeds further & produces some new errors, yet still somehow > related to pcap, I could use your input on them: > > step that fails now: > $buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/lib64/../lib64/libpcap.a(pcap-dbus.o): > In function `dbus_write': > pcap-dbus.c:(.text+0x48): undefined reference to `dbus_message_demarshal' > pcap-dbus.c:(.text+0x8c): undefined reference to `dbus_message_demarshal' It's the same issue, but now with a different symptom. The issue is that libpcap itself is linked against other libraries. In the dynamic library case, there are NEEDED entries in the .so file that point to these other libraries. In this case, the linker will implicitly search for those other libraries as if they had been given with -l on the command line. However, in a static .a library, these NEEDED entries don't exist. Therefore, the linker can't know that when you link with -lpcap, that it also needs to do -ldbus etc. Therefore you get undefined reference errors. The solution, as I wrote, is to use pcap-config, which will enumerate all the libraries that libpcap needs. Regards, Arnout > > I started googling & looking at dbus related packages but haven't made any > progress yet [snip]
diff --git a/package/reaver/Config.in b/package/reaver/Config.in index 0fd8ab7..3e73d0e 100644 --- a/package/reaver/Config.in +++ b/package/reaver/Config.in @@ -1,5 +1,6 @@ config BR2_PACKAGE_REAVER bool "reaver" + depends on !BR2_STATIC_LIBS select BR2_PACKAGE_LIBPCAP help Reaver is a tool to audit networks against brute WPS pins @@ -7,3 +8,6 @@ config BR2_PACKAGE_REAVER https://code.google.com/archive/p/reaver-wps/wikis/README.wiki https://github.com/t6x/reaver-wps-fork-t6x + +comment "reaver needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS
Fixes http://autobuild.buildroot.net/results/519b4347f496c043ddecdf15f57efb0b3addee42 http://autobuild.buildroot.net/results/c3daad76473a704e379634e3b87d51468a353f41 lpcap is not found when BR2_STATIC_LIBS=y Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com> --- package/reaver/Config.in | 4 ++++ 1 file changed, 4 insertions(+)