All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls"
@ 2018-11-04 12:52 Fabrice Fontaine
  2018-11-04 12:52 ` [Buildroot] [PATCH 2/2] libssh2: fix static linking scenarios involving mbedtls Fabrice Fontaine
  2018-11-04 20:30 ` [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2018-11-04 12:52 UTC (permalink / raw)
  To: buildroot

This reverts commit 48218732a3a7b983825ff3a8cf0767f847ac8d04 because
LTLIBMBEDCRYPTO will return "-lmbedcrypto
-R/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib"

On some compilers, -R option won't be recognized and this will prevent
the detection of libz:

configure:17809: /accts/mlweber1/scripts/instance-3/output/host/bin/i586-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/include  conftest.c /accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib/libz.so -Wl,-rpath -Wl,/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib  -L/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib -lmbedcrypto -R/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib >&5
i586-linux-gcc.br_real: error: unrecognized command line option '-R'; did you mean '-R'?

Fixes:
 - http://autobuild.buildroot.org/results/68623f22b49473177c889fe7b12625d779cbd1ed

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch b/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
index 01ae0813dd..76e08c51a9 100644
--- a/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
+++ b/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
@@ -8,10 +8,6 @@ libssh2.pc contains correct info for the benefit of pkg-config users.
 Static link with libssh2 requires this information.
 
 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
-[Fabrice: Replace $LIBMBEDCRYTO by $LTLIBMBEDCRYPTO to avoid adding a
-full library path to libssh2.pc as it raises build failures on some
-packages such as xerces]
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 ---
 Upstream status: https://github.com/libssh2/libssh2/pull/242
 
@@ -26,7 +22,7 @@ index c0e89a1a0c98..02c70845d27c 100644
  [mbedtls], [
    LIBSSH2_LIB_HAVE_LINKFLAGS([mbedcrypto], [], [#include <mbedtls/version.h>], [
      AC_DEFINE(LIBSSH2_MBEDTLS, 1, [Use $1])
-+    LIBS="$LIBS $LTLIBMBEDCRYPTO"
++    LIBS="$LIBS $LIBMBEDCRYPTO"
      found_crypto="$1"
      support_clear_memory=yes
    ])
-- 
2.17.1

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

* [Buildroot] [PATCH 2/2] libssh2: fix static linking scenarios involving mbedtls
  2018-11-04 12:52 [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Fabrice Fontaine
@ 2018-11-04 12:52 ` Fabrice Fontaine
  2018-11-04 20:30 ` [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2018-11-04 12:52 UTC (permalink / raw)
  To: buildroot

curl can be statically linked with mbedtls, in this case build will fail
on:
kex.c:(.text+0x1be0): undefined reference to `mbedtls_mpi_read_binary'

This is due to the fact that CURL_LIBRARIES does not contain mbedtls
library:
CURL_LIBRARIES:INTERNAL=curl;cares;ssh2;ssh2;z;ssl;crypto;z;z;crypto;z;z;ssl;z;z;crypto;z

even if libcurl.pc is correct:
Libs.private: -lcares -lssh2 -L/home/fabrice/buildroot/output/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lssh2 /home/fabrice/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libmbedcrypto.a /home/fabrice/buildroot/output/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libmbedcrypto.a -L/home/fabrice/buildroot/output/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -L/home/fabrice/buildroot/output/host/bin/../arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib -lz -lssl -lcrypto -lssl -lz -lz -lcrypto -lz -lz

This full library path is added by patch
0002-acinclude.m4-add-mbedtls-to-LIBS.patch on libssh2 so update it to
replace $LIBMBDEDCRYPTO by -lmbedcrypto

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch b/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
index 76e08c51a9..a70b1fe84f 100644
--- a/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
+++ b/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch
@@ -8,6 +8,10 @@ libssh2.pc contains correct info for the benefit of pkg-config users.
 Static link with libssh2 requires this information.
 
 Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+[Fabrice: Replace $LIBMBEDCRYTO by -lmdedcrypto to avoid adding a full
+library path to libssh2.pc as it raises build failures on some packages
+such as xerces]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 ---
 Upstream status: https://github.com/libssh2/libssh2/pull/242
 
@@ -22,7 +26,7 @@ index c0e89a1a0c98..02c70845d27c 100644
  [mbedtls], [
    LIBSSH2_LIB_HAVE_LINKFLAGS([mbedcrypto], [], [#include <mbedtls/version.h>], [
      AC_DEFINE(LIBSSH2_MBEDTLS, 1, [Use $1])
-+    LIBS="$LIBS $LIBMBEDCRYPTO"
++    LIBS="$LIBS -lmbedcrypto"
      found_crypto="$1"
      support_clear_memory=yes
    ])
-- 
2.17.1

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

* [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls"
  2018-11-04 12:52 [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Fabrice Fontaine
  2018-11-04 12:52 ` [Buildroot] [PATCH 2/2] libssh2: fix static linking scenarios involving mbedtls Fabrice Fontaine
@ 2018-11-04 20:30 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-11-04 20:30 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  4 Nov 2018 13:52:10 +0100, Fabrice Fontaine wrote:
> This reverts commit 48218732a3a7b983825ff3a8cf0767f847ac8d04 because
> LTLIBMBEDCRYPTO will return "-lmbedcrypto
> -R/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib"
> 
> On some compilers, -R option won't be recognized and this will prevent
> the detection of libz:
> 
> configure:17809: /accts/mlweber1/scripts/instance-3/output/host/bin/i586-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/include  conftest.c /accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib/libz.so -Wl,-rpath -Wl,/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib  -L/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib -lmbedcrypto -R/accts/mlweber1/scripts/instance-3/output/host/i586-buildroot-linux-musl/sysroot/usr/lib >&5
> i586-linux-gcc.br_real: error: unrecognized command line option '-R'; did you mean '-R'?
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/68623f22b49473177c889fe7b12625d779cbd1ed
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)

I am not a big fan of the proposed solution, but we need a fix for
this, and what you propose is simple enough. So I've applied both
patches to master. Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-11-04 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-04 12:52 [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Fabrice Fontaine
2018-11-04 12:52 ` [Buildroot] [PATCH 2/2] libssh2: fix static linking scenarios involving mbedtls Fabrice Fontaine
2018-11-04 20:30 ` [Buildroot] [PATCH 1/2] Revert "package/libssh2: fix static linking scenarios involving mbedtls" Thomas Petazzoni

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.