All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib.
@ 2018-04-18 16:43 Guillaume W. Bres
  2018-04-18 21:55 ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume W. Bres @ 2018-04-18 16:43 UTC (permalink / raw)
  To: buildroot

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(+)

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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib.
  2018-04-18 16:43 [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib Guillaume W. Bres
@ 2018-04-18 21:55 ` Arnout Vandecappelle
  2018-04-19 21:35   ` Guillaume William Bres
  0 siblings, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2018-04-18 21:55 UTC (permalink / raw)
  To: buildroot



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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib.
  2018-04-18 21:55 ` Arnout Vandecappelle
@ 2018-04-19 21:35   ` Guillaume William Bres
  2018-04-19 23:18     ` Arnout Vandecappelle
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume William Bres @ 2018-04-19 21:35 UTC (permalink / raw)
  To: buildroot

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180419/43d71132/attachment.html>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib.
  2018-04-19 21:35   ` Guillaume William Bres
@ 2018-04-19 23:18     ` Arnout Vandecappelle
  0 siblings, 0 replies; 4+ messages in thread
From: Arnout Vandecappelle @ 2018-04-19 23:18 UTC (permalink / raw)
  To: buildroot


[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]

-- 
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-19 23:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 16:43 [Buildroot] [PATCH 1/1] reaver: add missing dependency on non static lib Guillaume W. Bres
2018-04-18 21:55 ` Arnout Vandecappelle
2018-04-19 21:35   ` Guillaume William Bres
2018-04-19 23:18     ` Arnout Vandecappelle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.