Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/nmap: fix libssh2 test
@ 2017-11-01 12:19 Max Filippov
  2017-11-01 12:33 ` Baruch Siach
  2017-11-01 19:56 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Max Filippov @ 2017-11-01 12:19 UTC (permalink / raw)
  To: buildroot

nmap configure script adds '-lm' to the list of included headers when it
runs the test that checks the presence of libssh2.h. The test fails and
nmap tries to build and use bundled libssh2.
Fix the test.

Fixes:
  http://autobuild.buildroot.net/results/9e636919c98cd31b5067c8306d0e481a672434cf
  http://autobuild.buildroot.net/results/912561f505ad10d1eaa96dbe247d5838e9968e14

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
---
 package/nmap/0002-fix-libssh2-test.patch | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 package/nmap/0002-fix-libssh2-test.patch

diff --git a/package/nmap/0002-fix-libssh2-test.patch b/package/nmap/0002-fix-libssh2-test.patch
new file mode 100644
index 000000000000..2fe508cde9b0
--- /dev/null
+++ b/package/nmap/0002-fix-libssh2-test.patch
@@ -0,0 +1,28 @@
+configure: don't put '-lm' as a header into libssh2.h test
+
+Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
+
+--- nmap-7.60/configure.ac	2017-11-01 14:56:21.288413822 +0300
++++ nmap-7.60/configure.ac.mod	2017-11-01 14:53:33.816028328 +0300
+@@ -674,7 +674,7 @@
+       AC_CHECK_LIB(ssh2, libssh2_version,
+         [have_libssh2=yes
+         LIBSSH2_INC=$with_libssh2/include
+-        LIBSSH2_LIB=$with_libssh2/lib])],,[-lm])
++        LIBSSH2_LIB=$with_libssh2/lib])],,)
+ 
+     LDFLAGS=$_ldflags
+     CPPFLAGS=$_cppflags
+--- nmap-7.60/configure	2017-07-31 22:09:47.000000000 +0300
++++ nmap-7.60/configure.mod	2017-11-01 15:01:12.266068760 +0300
+@@ -6801,8 +6801,8 @@
+     CPPFLAGS="-I$with_libssh2/include $CPPFLAGS"
+     LDFLAGS="-L$with_libssh2/lib $LDFLAGS"
+ 
+-    ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "-lm
+-"
++    ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" ""
++
+ if test "x$ac_cv_header_libssh2_h" = xyes; then :
+ 
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_version in -lssh2" >&5
-- 
2.11.0

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

* [Buildroot] [PATCH] package/nmap: fix libssh2 test
  2017-11-01 12:19 [Buildroot] [PATCH] package/nmap: fix libssh2 test Max Filippov
@ 2017-11-01 12:33 ` Baruch Siach
  2017-11-01 12:43   ` Max Filippov
  2017-11-01 19:56 ` Thomas Petazzoni
  1 sibling, 1 reply; 4+ messages in thread
From: Baruch Siach @ 2017-11-01 12:33 UTC (permalink / raw)
  To: buildroot

Hi Max,

On Wed, Nov 01, 2017 at 03:19:55PM +0300, Max Filippov wrote:
> nmap configure script adds '-lm' to the list of included headers when it
> runs the test that checks the presence of libssh2.h. The test fails and
> nmap tries to build and use bundled libssh2.
> Fix the test.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/9e636919c98cd31b5067c8306d0e481a672434cf
>   http://autobuild.buildroot.net/results/912561f505ad10d1eaa96dbe247d5838e9968e14

http://lists.busybox.net/pipermail/buildroot/2017-September/203407.html

I guess you hit the same problem, so your patch also touches the generated 
configure script.

Have you contacted upstream?

baruch

> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  package/nmap/0002-fix-libssh2-test.patch | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 package/nmap/0002-fix-libssh2-test.patch
> 
> diff --git a/package/nmap/0002-fix-libssh2-test.patch b/package/nmap/0002-fix-libssh2-test.patch
> new file mode 100644
> index 000000000000..2fe508cde9b0
> --- /dev/null
> +++ b/package/nmap/0002-fix-libssh2-test.patch
> @@ -0,0 +1,28 @@
> +configure: don't put '-lm' as a header into libssh2.h test
> +
> +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> +
> +--- nmap-7.60/configure.ac	2017-11-01 14:56:21.288413822 +0300
> ++++ nmap-7.60/configure.ac.mod	2017-11-01 14:53:33.816028328 +0300
> +@@ -674,7 +674,7 @@
> +       AC_CHECK_LIB(ssh2, libssh2_version,
> +         [have_libssh2=yes
> +         LIBSSH2_INC=$with_libssh2/include
> +-        LIBSSH2_LIB=$with_libssh2/lib])],,[-lm])
> ++        LIBSSH2_LIB=$with_libssh2/lib])],,)
> + 
> +     LDFLAGS=$_ldflags
> +     CPPFLAGS=$_cppflags
> +--- nmap-7.60/configure	2017-07-31 22:09:47.000000000 +0300
> ++++ nmap-7.60/configure.mod	2017-11-01 15:01:12.266068760 +0300
> +@@ -6801,8 +6801,8 @@
> +     CPPFLAGS="-I$with_libssh2/include $CPPFLAGS"
> +     LDFLAGS="-L$with_libssh2/lib $LDFLAGS"
> + 
> +-    ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" "-lm
> +-"
> ++    ac_fn_c_check_header_compile "$LINENO" "libssh2.h" "ac_cv_header_libssh2_h" ""
> ++
> + if test "x$ac_cv_header_libssh2_h" = xyes; then :
> + 
> +       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libssh2_version in -lssh2" >&5

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

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

* [Buildroot] [PATCH] package/nmap: fix libssh2 test
  2017-11-01 12:33 ` Baruch Siach
@ 2017-11-01 12:43   ` Max Filippov
  0 siblings, 0 replies; 4+ messages in thread
From: Max Filippov @ 2017-11-01 12:43 UTC (permalink / raw)
  To: buildroot

On Wed, Nov 1, 2017 at 5:33 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> http://lists.busybox.net/pipermail/buildroot/2017-September/203407.html
>
> I guess you hit the same problem, so your patch also touches the generated
> configure script.

That's correct.

> Have you contacted upstream?

No.

-- 
Thanks.
-- Max

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

* [Buildroot] [PATCH] package/nmap: fix libssh2 test
  2017-11-01 12:19 [Buildroot] [PATCH] package/nmap: fix libssh2 test Max Filippov
  2017-11-01 12:33 ` Baruch Siach
@ 2017-11-01 19:56 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-11-01 19:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  1 Nov 2017 15:19:55 +0300, Max Filippov wrote:
> nmap configure script adds '-lm' to the list of included headers when it
> runs the test that checks the presence of libssh2.h. The test fails and
> nmap tries to build and use bundled libssh2.
> Fix the test.
> 
> Fixes:
>   http://autobuild.buildroot.net/results/9e636919c98cd31b5067c8306d0e481a672434cf
>   http://autobuild.buildroot.net/results/912561f505ad10d1eaa96dbe247d5838e9968e14
> 
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>

I committed a different version of your patch, but based on the same
idea. The main changes are:

 - Instead of dropping -lm entirely, I keep it, but at the right place,
   i.e as the fifth argument of the AC_CHECK_LIB() call rather than as
   an argument of the AC_CHECK_HEADER() call.

 - Instead of patching the configure script, I'm doing an autoconf (but
   not a full autoreconf, as that doesn't work, as you and Baruch have
   noticed). It is worth mentioning that Debian has a nmap patch that
   fixes the AC_DEFINE() issues, but then I fell into another problem:
   there is no Makefile.am in the top-level source directory, and
   therefore automake complains. This is why I resorted to using just
   autoconf.

See
https://git.buildroot.org/buildroot/commit/?id=302ab5ed258c366dfc3853954ef9ec20b22661ce
for what I ended up committing.

Thanks for all the research. Could you submit the patch to upstream
nmap?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

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

end of thread, other threads:[~2017-11-01 19:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-01 12:19 [Buildroot] [PATCH] package/nmap: fix libssh2 test Max Filippov
2017-11-01 12:33 ` Baruch Siach
2017-11-01 12:43   ` Max Filippov
2017-11-01 19:56 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox