diff mbox

[autobuild.buildroot.net] Build results for 2014-12-10

Message ID 548AC92B.8060705@imgtec.com
State Not Applicable
Headers show

Commit Message

Vicente Olivert Riera Dec. 12, 2014, 10:53 a.m. UTC
Dear Baruch, all,

On 12/11/2014 05:58 PM, Vicente Olivert Riera wrote:
> Dear Baruch Siac,
> 
> On 12/11/2014 05:55 PM, Baruch Siach wrote:
>> Hi Vicente,
>>
>> On Thu, Dec 11, 2014 at 05:39:46PM +0000, Vicente Olivert Riera wrote:
>>> On 12/11/2014 07:30 AM, Thomas Petazzoni wrote:
>>>>       mipsel |             kismet-2013-03-R1b | NOK | http://autobuild.buildroot.net/results/965a3e345dc0a432043b72581bff7d33561fbe0c/
>>>
>>> This failure is caused because in the configure script Kismet tries to
>>> do a compile test to check for pcap_open_live(). This works for shared
>>> builds because is very common the host machine has installed the shared
>>> library of libpcap. But when building for static, is very unlikely
>>> having the static library of libpcap installed on the host, so that
>>> compilation test (which runs in the host machine) fails.
>>>
>>> Given that kismet depends on libpcap, we can ensure that the pcap
>>> library installed on the target will be fine, so we can workaround this
>>> error by removing the compile tests (there are three of them) from the
>>> configure script. And that would be a patch to fix Kismet when
>>> cross-compiling.
>>>
>>> However, after doing that, we will face more problems. The first one
>>> will be one related of a missing "-pthread" option:
>>>
>>> /br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libnl-3.a(socket.o):
>>> In function `release_local_port':
>>> socket.c:(.text+0x120): undefined reference to `pthread_rwlock_wrlock'
>>> [...]
>>>
>>> We could fix that just by adding this to the kismet.mk file:
>>>
>>> KISMET_CONF_ENV = LIBS="-pthread"
>>>
>>> But that's not enough. We will face more problems like this one:
>>>
>>> /br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libpcap.a(pcap-canusb-linux.o):
>>> In function `canusb_close':
>>> pcap-canusb-linux.c:(.text+0xec): undefined reference to `libusb_close'
>>>
>>> So, at this point I don't know if it would be better to just disable
>>> kismet for static builds. What do you think?
>>
>> Use the pcap-config utility. See for example the packages bustle and wireshark 
>> among the others.
> 
> oh, that's interesting. Thanks! I have to go now, but I will have a look
> at it tomorrow, unless someone fix it first :P

thanks to your hint I'm almost done fixing this issue. After applying
the patch for removing the compile tests in the configure script (patch
attached), and after adding the following snippet to the kismet.mk, I
have fixed the issues with libpcap:

ifeq ($(BR2_PREFER_STATIC_LIB),y)
KISMET_CONF_ENV = LIBS="-lpcap $(shell
$(STAGING_DIR)/usr/bin/pcap-config --static --additional-libs)"
endif

Now I'm stuck with a problem regarding ncurses (panel) and I don't know
how to solve it:

/br/output/host/usr/bin/mipsel-linux-g++ -rdynamic -o kismet_client
util.o ringbuf.o globalregistry.o messagebus.o configfile.o getopt.o
soundcontrol.o timetracker.o ipc_remote.o clinetframework.o tcpclient.o
popenclient.o kis_clinetframe.o text_cliframe.o kis_panel_widgets.o
kis_panel_network.o kis_panel_windows.o kis_panel_details.o
kis_panel_preferences.o kis_panel_frontend.o kismet_client.o -lstdc++
-ldl -lncurses -lpanel
/br/output/host/usr/mipsel-buildroot-linux-uclibc/sysroot/usr/lib/libpanel.a(p_delete.o):
In function `del_panel':
p_delete.c:(.text+0x68): undefined reference to `_nc_panelhook'
[...]

As you can see, -ncurses and -lpanel are passed in the compile line,
so..., I don't know what to do now :/

Ideas welcome. CCing Gustavo as I think he could have some knowledge
regarding ncurses and static builds. Sorry if I'm wrong :P

Cheers,

Comments

Thomas Petazzoni Dec. 12, 2014, 11:06 a.m. UTC | #1
Dear Vicente Olivert Riera,

On Fri, 12 Dec 2014 10:53:31 +0000, Vicente Olivert Riera wrote:

> As you can see, -ncurses and -lpanel are passed in the compile line,
> so..., I don't know what to do now :/

Trying changing the order of -lncurses and -lpanel, for static linking,
the order is important.

Thomas
Vicente Olivert Riera Dec. 12, 2014, 12:27 p.m. UTC | #2
Dear Thomas Petazzoni,

On 12/12/2014 11:06 AM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Fri, 12 Dec 2014 10:53:31 +0000, Vicente Olivert Riera wrote:
> 
>> As you can see, -ncurses and -lpanel are passed in the compile line,
>> so..., I don't know what to do now :/
> 
> Trying changing the order of -lncurses and -lpanel, for static linking,
> the order is important.

Yes, that did the trick. I will send a patch soon. Thanks!

Cheers,
diff mbox

Patch

diff -rup a/configure b/configure
--- a/configure	2014-12-11 16:35:36.979059147 +0000
+++ b/configure	2014-12-11 16:43:54.175647454 +0000
@@ -6265,29 +6265,7 @@  if eval \${$as_ac_Lib+:} false; then :
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l${pcaplib}  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_open_live ();
-int
-main ()
-{
-return pcap_open_live ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
   eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
@@ -6337,29 +6315,7 @@  if ${ac_cv_lib_pcap_pcap_setnonblock+:} 
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-lpcap  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_setnonblock ();
-int
-main ()
-{
-return pcap_setnonblock ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
   ac_cv_lib_pcap_pcap_setnonblock=yes
-else
-  ac_cv_lib_pcap_pcap_setnonblock=no
-fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS
@@ -6385,29 +6341,7 @@  if eval \${$as_ac_Lib+:} false; then :
 else
   ac_check_lib_save_LIBS=$LIBS
 LIBS="-l${pcaplib}  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pcap_get_selectable_fd ();
-int
-main ()
-{
-return pcap_get_selectable_fd ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
   eval "$as_ac_Lib=yes"
-else
-  eval "$as_ac_Lib=no"
-fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
 LIBS=$ac_check_lib_save_LIBS