Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error"
@ 2017-02-14 22:43 Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 2/4] bctoolbox: add patch to fix static linking Jörg Krause
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Jörg Krause @ 2017-02-14 22:43 UTC (permalink / raw)
  To: buildroot

This reverts commit 5c4d3560b94c9cb8f1594c9200a632b89ddf7aa0.

Although the patch fixes the build error it does not set the flags for
Libs.private properly. A fellow-up patch will provide a better solution
for this issue.

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/bctoolbox/0001-fix-typo.patch | 18 ------------------
 1 file changed, 18 deletions(-)
 delete mode 100644 package/bctoolbox/0001-fix-typo.patch

diff --git a/package/bctoolbox/0001-fix-typo.patch b/package/bctoolbox/0001-fix-typo.patch
deleted file mode 100644
index b94daee8d..000000000
--- a/package/bctoolbox/0001-fix-typo.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Fix a typo in the variable name. Only check path for a single library name.
-
-Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> 
-
-diff -Nur bctoolbox-0.4.0.orig/CMakeLists.txt bctoolbox-0.4.0/CMakeLists.txt
---- bctoolbox-0.4.0.orig/CMakeLists.txt	2016-10-06 17:30:41.000000000 +0200
-+++ bctoolbox-0.4.0/CMakeLists.txt	2017-02-13 23:30:38.641288032 +0100
-@@ -103,8 +103,8 @@
- endif()
- 
- if(MBEDTLS_FOUND)
--	get_filename_component(mbedtls_library_path "${MBEDTLS_LIBRARIES}" PATH)
--	set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${mbedlts_library_path}")
-+	get_filename_component(mbedtls_library_path "${MBEDTLS_LIBRARY}" PATH)
-+	set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${mbedtls_library_path}")
- endif()
- if(POLARSSL_FOUND)
- 	get_filename_component(polarssl_library_path "${POLARSSL_LIBRARIES}" PATH)
-- 
2.11.1

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

* [Buildroot] [PATCH 2/4] bctoolbox: add patch to fix static linking
  2017-02-14 22:43 [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Jörg Krause
@ 2017-02-14 22:44 ` Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 3/4] bctoolbox: fix mbedtls/polarssl dependency Jörg Krause
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Jörg Krause @ 2017-02-14 22:44 UTC (permalink / raw)
  To: buildroot

Static linking with bctoolbox fails when using pkg-config as the
generated bctoolbox.pc file only consists of an '-L' string without any
search path or libraries flags:

```
libtool: link: need path for `-L' option
```

That's because of an typo in mbedtls_library_path. However,
mbedtls_library_path contains a string of the mbedtls libraries
concatenated by an ';' which cannot be parsed by pkg-config.

Therefore, use MBEDTLS_LIBRARY instead of MBEDTLS_LIBRARIES to get
the library path.

Furthermore, add the three mbedtls libraries mbedtls, mbedcrypto, and
mbedx509 to LIBS_PRIVATE so these libraries are added to the
Libs.private field of bctoolbox.pc.

Fixes:
http://autobuild.buildroot.net/results/37d5625df4be11ccdc063871e9f6e13d5f59fb52
http://autobuild.buildroot.net/results/1999c841fae41f860f00747a362327cb2857e687
.. and many more.

Upstream status: Pending
https://github.com/BelledonneCommunications/bctoolbox/pull/4

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 .../0001-Fix-Libs.private-flags-for-mbedtls.patch  | 49 ++++++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 package/bctoolbox/0001-Fix-Libs.private-flags-for-mbedtls.patch

diff --git a/package/bctoolbox/0001-Fix-Libs.private-flags-for-mbedtls.patch b/package/bctoolbox/0001-Fix-Libs.private-flags-for-mbedtls.patch
new file mode 100644
index 000000000..a70c7c633
--- /dev/null
+++ b/package/bctoolbox/0001-Fix-Libs.private-flags-for-mbedtls.patch
@@ -0,0 +1,49 @@
+From c0b3dbb43aa3a38c47311556c85eadc6072e2d68 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
+Date: Tue, 14 Feb 2017 22:02:26 +0100
+Subject: [PATCH] Fix Libs.private flags for mbedtls
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Static linking with bctoolbox fails when using pkg-config as the
+generated bctoolbox.pc file only consists of an '-L' string without any
+search path or libraries flags.
+
+That's because of an typo in `mbedtls_library_path`. However,
+`mbedtls_library_path` contains a string of the mbedtls libraries
+concatenated by an ';' which cannot be parsed by pkg-config.
+
+Therefore, use `MBEDTLS_LIBRARY` instead of `MBEDTLS_LIBRARIES` to get
+the library path.
+
+Furthermore, add the three mbedtls libraries *mbedtls*, *mbedcrypto*, and
+*mbedx509* to `LIBS_PRIVATE` so these libraries are added to the
+`Libs.private` field of bctoolbox.pc.
+
+Upstream status: Pending
+https://github.com/BelledonneCommunications/bctoolbox/pull/4
+
+Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ed7aa00..4127f0e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -103,8 +103,8 @@ else()
+ endif()
+ 
+ if(MBEDTLS_FOUND)
+-	get_filename_component(mbedtls_library_path "${MBEDTLS_LIBRARIES}" PATH)
+-	set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${mbedlts_library_path}")
++	get_filename_component(mbedtls_library_path "${MBEDTLS_LIBRARY}" PATH)
++	set(LIBS_PRIVATE "${LIBS_PRIVATE} -L${mbedtls_library_path} -lmbedtls -lmbedcrypto -lmbedx509")
+ endif()
+ if(POLARSSL_FOUND)
+ 	get_filename_component(polarssl_library_path "${POLARSSL_LIBRARIES}" PATH)
+-- 
+2.11.1
+
-- 
2.11.1

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

* [Buildroot] [PATCH 3/4] bctoolbox: fix mbedtls/polarssl dependency
  2017-02-14 22:43 [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 2/4] bctoolbox: add patch to fix static linking Jörg Krause
@ 2017-02-14 22:44 ` Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 4/4] bctoolbox: disable rpath Jörg Krause
  2017-02-20 21:25 ` [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Thomas Petazzoni
  3 siblings, 0 replies; 11+ messages in thread
From: Jörg Krause @ 2017-02-14 22:44 UTC (permalink / raw)
  To: buildroot

Currently we force selection on mbedtls for bctoolbox. If, for whatever
reason, mbedTLS is not found, bctoolbox searches for PolarSSL and, if
not present, fails with:

```
  Could NOT find PolarSSL (missing: POLARSSL_INCLUDE_DIRS
  HAVE_POLARSSL_SSL_H)
```

This happens because bctoolbox enables support for mbedTLS and PolarSSL
by default, whereas, if both are enabled, mbedTLS is preferred over
PolarSSL.

However, crypto support is not mandatory and support for both libraries
can be turned off. Therefore, optionally depend on mbedTLS or PolarSSL
and enable/disable the library support explicitly.

This fixes the issue of searching for PolarSSL altough the dependency is
not declared in the bctoolbox package.

Note, that this does not fix the issue why mbedtls is not found although
it is enabled. This issue is address in this thread [1].

Fixes:
http://autobuild.buildroot.net/results/cfe/cfeb2f542598e5d450b332fb51a6d79bae24158c/
.. and more.

[1] http://lists.busybox.net/pipermail/buildroot/2017-February/183055.html

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/bctoolbox/Config.in    |  4 +++-
 package/bctoolbox/bctoolbox.mk | 16 ++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/package/bctoolbox/Config.in b/package/bctoolbox/Config.in
index 834f6e2a6..e9e69205f 100644
--- a/package/bctoolbox/Config.in
+++ b/package/bctoolbox/Config.in
@@ -2,11 +2,13 @@ config BR2_PACKAGE_BCTOOLBOX
 	bool "bctoolbox"
 	depends on BR2_INSTALL_LIBSTDCPP
 	depends on BR2_TOOLCHAIN_HAS_THREADS
-	select BR2_PACKAGE_MBEDTLS # mbedtls is preferred over polarssl
 	help
 	  Utilities library used by Belledonne Communications
 	  softwares like belle-sip, mediastreamer2 and linphone.
 
+	  Select BR2_PACKAGE_MBEDTLS (preferred) or
+	  BR2_PACKAGE_POLARSSL for crypto support.
+
 	  https://github.com/BelledonneCommunications/bctoolbox
 
 comment "bctoolbox needs a toolchain w/ C++, threads"
diff --git a/package/bctoolbox/bctoolbox.mk b/package/bctoolbox/bctoolbox.mk
index 64c67792a..5eea0575f 100644
--- a/package/bctoolbox/bctoolbox.mk
+++ b/package/bctoolbox/bctoolbox.mk
@@ -17,6 +17,22 @@ BCTOOLBOX_CONF_OPTS = \
 	-DENABLE_TESTS=OFF \
 	-DGIT_EXECUTABLE=OFF
 
+# bctoolbox can be build with mbedTLS or PolarSSL support. If both
+# libraries are present, mbedTLS is preferred over PolarSSL.
+ifeq ($(BR2_PACKAGE_MBEDTLS),y)
+BCTOOLBOX_DEPENDENCIES += mbedtls
+BCTOOLBOX_CONF_OPTS += -DENABLE_MBEDTLS=ON
+else
+BCTOOLBOX_CONF_OPTS += -DENABLE_MBEDTLS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_POLARSSL),y)
+BCTOOLBOX_DEPENDENCIES += polarssl
+BCTOOLBOX_CONF_OPTS += -DENABLE_POLARSSL=ON
+else
+BCTOOLBOX_CONF_OPTS += -DENABLE_POLARSSL=OFF
+endif
+
 ifeq ($(BR2_STATIC_LIBS),y)
 BCTOOLBOX_CONF_OPTS += -DENABLE_SHARED=OFF -DENABLE_STATIC=ON
 else ifeq ($(BR2_SHARED_STATIC_LIBS),y)
-- 
2.11.1

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-14 22:43 [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 2/4] bctoolbox: add patch to fix static linking Jörg Krause
  2017-02-14 22:44 ` [Buildroot] [PATCH 3/4] bctoolbox: fix mbedtls/polarssl dependency Jörg Krause
@ 2017-02-14 22:44 ` Jörg Krause
  2017-02-15  5:28   ` Baruch Siach
  2017-02-20 21:25 ` [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Thomas Petazzoni
  3 siblings, 1 reply; 11+ messages in thread
From: Jörg Krause @ 2017-02-14 22:44 UTC (permalink / raw)
  To: buildroot

By default, bctoolbox adds the rpath to the shared library. Prevent this
by setting `CMAKE_SKIP_RPATH` [1] to a true value.

[1] https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_RPATH.html

Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
---
 package/bctoolbox/bctoolbox.mk | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/bctoolbox/bctoolbox.mk b/package/bctoolbox/bctoolbox.mk
index 5eea0575f..76737aa3c 100644
--- a/package/bctoolbox/bctoolbox.mk
+++ b/package/bctoolbox/bctoolbox.mk
@@ -11,11 +11,14 @@ BCTOOLBOX_LICENSE_FILES = COPYING
 BCTOOLBOX_DEPENDENCIES = mbedtls
 BCTOOLBOX_INSTALL_STAGING = YES
 
+# Set CMAKE_SKIP_RPATH to prevent bctoolbox from adding the rpath to
+# shared library.
 BCTOOLBOX_CONF_OPTS = \
 	-DENABLE_STRICT=OFF \
 	-DENABLE_TESTS_COMPONENT=OFF \
 	-DENABLE_TESTS=OFF \
-	-DGIT_EXECUTABLE=OFF
+	-DGIT_EXECUTABLE=OFF \
+	-DCMAKE_SKIP_RPATH=ON
 
 # bctoolbox can be build with mbedTLS or PolarSSL support. If both
 # libraries are present, mbedTLS is preferred over PolarSSL.
-- 
2.11.1

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-14 22:44 ` [Buildroot] [PATCH 4/4] bctoolbox: disable rpath Jörg Krause
@ 2017-02-15  5:28   ` Baruch Siach
  2017-02-15  6:12     ` Samuel Martin
  2017-02-15  8:56     ` Thomas Petazzoni
  0 siblings, 2 replies; 11+ messages in thread
From: Baruch Siach @ 2017-02-15  5:28 UTC (permalink / raw)
  To: buildroot

Hi J?rg,

On Tue, Feb 14, 2017 at 11:44:02PM +0100, J?rg Krause wrote:
> By default, bctoolbox adds the rpath to the shared library. Prevent this
> by setting `CMAKE_SKIP_RPATH` [1] to a true value.
> 
> [1] https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_RPATH.html
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
>  package/bctoolbox/bctoolbox.mk | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/package/bctoolbox/bctoolbox.mk b/package/bctoolbox/bctoolbox.mk
> index 5eea0575f..76737aa3c 100644
> --- a/package/bctoolbox/bctoolbox.mk
> +++ b/package/bctoolbox/bctoolbox.mk
> @@ -11,11 +11,14 @@ BCTOOLBOX_LICENSE_FILES = COPYING
>  BCTOOLBOX_DEPENDENCIES = mbedtls
>  BCTOOLBOX_INSTALL_STAGING = YES
>  
> +# Set CMAKE_SKIP_RPATH to prevent bctoolbox from adding the rpath to
> +# shared library.
>  BCTOOLBOX_CONF_OPTS = \
>  	-DENABLE_STRICT=OFF \
>  	-DENABLE_TESTS_COMPONENT=OFF \
>  	-DENABLE_TESTS=OFF \
> -	-DGIT_EXECUTABLE=OFF
> +	-DGIT_EXECUTABLE=OFF \
> +	-DCMAKE_SKIP_RPATH=ON

Shouldn't we have this in package/pkg-cmake.mk? Samuel?

baruch

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

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-15  5:28   ` Baruch Siach
@ 2017-02-15  6:12     ` Samuel Martin
  2017-02-15  8:58       ` Thomas Petazzoni
  2017-02-15  8:56     ` Thomas Petazzoni
  1 sibling, 1 reply; 11+ messages in thread
From: Samuel Martin @ 2017-02-15  6:12 UTC (permalink / raw)
  To: buildroot

On Wed, Feb 15, 2017 at 6:28 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi J?rg,
>
> On Tue, Feb 14, 2017 at 11:44:02PM +0100, J?rg Krause wrote:
>> By default, bctoolbox adds the rpath to the shared library. Prevent this
>> by setting `CMAKE_SKIP_RPATH` [1] to a true value.
>>
>> [1] https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_RPATH.html
>>
>> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
>> ---
>>  package/bctoolbox/bctoolbox.mk | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/package/bctoolbox/bctoolbox.mk b/package/bctoolbox/bctoolbox.mk
>> index 5eea0575f..76737aa3c 100644
>> --- a/package/bctoolbox/bctoolbox.mk
>> +++ b/package/bctoolbox/bctoolbox.mk
>> @@ -11,11 +11,14 @@ BCTOOLBOX_LICENSE_FILES = COPYING
>>  BCTOOLBOX_DEPENDENCIES = mbedtls
>>  BCTOOLBOX_INSTALL_STAGING = YES
>>
>> +# Set CMAKE_SKIP_RPATH to prevent bctoolbox from adding the rpath to
>> +# shared library.
>>  BCTOOLBOX_CONF_OPTS = \
>>       -DENABLE_STRICT=OFF \
>>       -DENABLE_TESTS_COMPONENT=OFF \
>>       -DENABLE_TESTS=OFF \
>> -     -DGIT_EXECUTABLE=OFF
>> +     -DGIT_EXECUTABLE=OFF \
>> +     -DCMAKE_SKIP_RPATH=ON
>
> Shouldn't we have this in package/pkg-cmake.mk? Samuel?

For host package, we may want to enable rpath.
For target package, I think we should not set/force this option by the
infra because some packages may install some kind-of private libraries
elsewhere than in /usr/lib and set RPATH to in their binaries to find
them (e.g.: sudo or iptables, though they are cmake-based packages.).

Regards,

-- 
Samuel

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-15  5:28   ` Baruch Siach
  2017-02-15  6:12     ` Samuel Martin
@ 2017-02-15  8:56     ` Thomas Petazzoni
  2017-02-19 15:07       ` Jörg Krause
  1 sibling, 1 reply; 11+ messages in thread
From: Thomas Petazzoni @ 2017-02-15  8:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 15 Feb 2017 07:28:46 +0200, Baruch Siach wrote:
> Hi J?rg,
> 
> On Tue, Feb 14, 2017 at 11:44:02PM +0100, J?rg Krause wrote:
> > By default, bctoolbox adds the rpath to the shared library. Prevent this
> > by setting `CMAKE_SKIP_RPATH` [1] to a true value.
> > 
> > [1] https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_RPATH.html
> > 
> > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> > ---
> >  package/bctoolbox/bctoolbox.mk | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/package/bctoolbox/bctoolbox.mk b/package/bctoolbox/bctoolbox.mk
> > index 5eea0575f..76737aa3c 100644
> > --- a/package/bctoolbox/bctoolbox.mk
> > +++ b/package/bctoolbox/bctoolbox.mk
> > @@ -11,11 +11,14 @@ BCTOOLBOX_LICENSE_FILES = COPYING
> >  BCTOOLBOX_DEPENDENCIES = mbedtls
> >  BCTOOLBOX_INSTALL_STAGING = YES
> >  
> > +# Set CMAKE_SKIP_RPATH to prevent bctoolbox from adding the rpath to
> > +# shared library.
> >  BCTOOLBOX_CONF_OPTS = \
> >  	-DENABLE_STRICT=OFF \
> >  	-DENABLE_TESTS_COMPONENT=OFF \
> >  	-DENABLE_TESTS=OFF \
> > -	-DGIT_EXECUTABLE=OFF
> > +	-DGIT_EXECUTABLE=OFF \
> > +	-DCMAKE_SKIP_RPATH=ON  
> 
> Shouldn't we have this in package/pkg-cmake.mk? Samuel?

Indeed, it's a generic CMake option, so it should be in
package/pkg-cmake.mk IMO.

Worth mentioning that there is both CMAKE_SKIP_RPATH and
CMAKE_SKIP_INSTALL_RPATH. The former skips adding the rpath during both
the build and install steps, which prevents from running the binary
from the build directory. The latter only skips the rpath during the
install step. But since we're cross-compiling, running on the host
machine from the build directory anyway doesn't make sense. So
CMAKE_SKIP_RPATH is OK.

See https://cmake.org/cmake/help/v3.0/variable/CMAKE_SKIP_RPATH.html.

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

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-15  6:12     ` Samuel Martin
@ 2017-02-15  8:58       ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-02-15  8:58 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed, 15 Feb 2017 07:12:28 +0100, Samuel Martin wrote:

> For target package, I think we should not set/force this option by the
> infra because some packages may install some kind-of private libraries
> elsewhere than in /usr/lib and set RPATH to in their binaries to find
> them (e.g.: sudo or iptables, though they are cmake-based packages.).

Hum, I didn't think about this, and you're probably right. If
CMAKE_SKIP_RPATH skips *all* rpath information, including some custom
one like pointing to /usr/lib/<foo>/, then we have to keep it indeed.

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

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-15  8:56     ` Thomas Petazzoni
@ 2017-02-19 15:07       ` Jörg Krause
  2017-02-19 17:44         ` Thomas Petazzoni
  0 siblings, 1 reply; 11+ messages in thread
From: Jörg Krause @ 2017-02-19 15:07 UTC (permalink / raw)
  To: buildroot

Hi,

On Wed, 2017-02-15 at 09:56 +0100, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 15 Feb 2017 07:28:46 +0200, Baruch Siach wrote:
> > Hi J?rg,
> > 
> > On Tue, Feb 14, 2017 at 11:44:02PM +0100, J?rg Krause wrote:
> > > By default, bctoolbox adds the rpath to the shared library.
> > > Prevent this
> > > by setting `CMAKE_SKIP_RPATH` [1] to a true value.
> > > 
> > > [1] https://cmake.org/cmake/help/latest/variable/CMAKE_SKIP_RPATH
> > > .html
> > > 
> > > Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> > > ---
> > > ?package/bctoolbox/bctoolbox.mk | 5 ++++-
> > > ?1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/package/bctoolbox/bctoolbox.mk
> > > b/package/bctoolbox/bctoolbox.mk
> > > index 5eea0575f..76737aa3c 100644
> > > --- a/package/bctoolbox/bctoolbox.mk
> > > +++ b/package/bctoolbox/bctoolbox.mk
> > > @@ -11,11 +11,14 @@ BCTOOLBOX_LICENSE_FILES = COPYING
> > > ?BCTOOLBOX_DEPENDENCIES = mbedtls
> > > ?BCTOOLBOX_INSTALL_STAGING = YES
> > > ?
> > > +# Set CMAKE_SKIP_RPATH to prevent bctoolbox from adding the
> > > rpath to
> > > +# shared library.
> > > ?BCTOOLBOX_CONF_OPTS = \
> > > ?	-DENABLE_STRICT=OFF \
> > > ?	-DENABLE_TESTS_COMPONENT=OFF \
> > > ?	-DENABLE_TESTS=OFF \
> > > -	-DGIT_EXECUTABLE=OFF
> > > +	-DGIT_EXECUTABLE=OFF \
> > > +	-DCMAKE_SKIP_RPATH=ON??
> > 
> > Shouldn't we have this in package/pkg-cmake.mk? Samuel?
> 
> Indeed, it's a generic CMake option, so it should be in
> package/pkg-cmake.mk IMO.

opencv and opencv3 both set this option on a package level.

> Worth mentioning that there is both CMAKE_SKIP_RPATH and
> CMAKE_SKIP_INSTALL_RPATH. The former skips adding the rpath during
> both
> the build and install steps, which prevents from running the binary
> from the build directory. The latter only skips the rpath during the
> install step. But since we're cross-compiling, running on the host
> machine from the build directory anyway doesn't make sense. So
> CMAKE_SKIP_RPATH is OK.
> 
> See https://cmake.org/cmake/help/v3.0/variable/CMAKE_SKIP_RPATH.html.

Samuel argues not to force this option by the infrastructure. I am 	
not sure how do we handle this properly. So, what shall we do?

Best regards,
J?rg Krause

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

* [Buildroot] [PATCH 4/4] bctoolbox: disable rpath
  2017-02-19 15:07       ` Jörg Krause
@ 2017-02-19 17:44         ` Thomas Petazzoni
  0 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-02-19 17:44 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 19 Feb 2017 16:07:35 +0100, J?rg Krause wrote:

> > Worth mentioning that there is both CMAKE_SKIP_RPATH and
> > CMAKE_SKIP_INSTALL_RPATH. The former skips adding the rpath during
> > both
> > the build and install steps, which prevents from running the binary
> > from the build directory. The latter only skips the rpath during the
> > install step. But since we're cross-compiling, running on the host
> > machine from the build directory anyway doesn't make sense. So
> > CMAKE_SKIP_RPATH is OK.
> > 
> > See https://cmake.org/cmake/help/v3.0/variable/CMAKE_SKIP_RPATH.html.  
> 
> Samuel argues not to force this option by the infrastructure. I am 	
> not sure how do we handle this properly. So, what shall we do?

As I said in my second e-mail (sent after reading Samuel's answer),
Samuel is probably correct. Skipping the rpath in *all* cases may not
be correct, so we have to do it at the per-package level, like your
patch does.

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

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

* [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error"
  2017-02-14 22:43 [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Jörg Krause
                   ` (2 preceding siblings ...)
  2017-02-14 22:44 ` [Buildroot] [PATCH 4/4] bctoolbox: disable rpath Jörg Krause
@ 2017-02-20 21:25 ` Thomas Petazzoni
  3 siblings, 0 replies; 11+ messages in thread
From: Thomas Petazzoni @ 2017-02-20 21:25 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue, 14 Feb 2017 23:43:59 +0100, J?rg Krause wrote:
> This reverts commit 5c4d3560b94c9cb8f1594c9200a632b89ddf7aa0.
> 
> Although the patch fixes the build error it does not set the flags for
> Libs.private properly. A fellow-up patch will provide a better solution
> for this issue.
> 
> Signed-off-by: J?rg Krause <joerg.krause@embedded.rocks>
> ---
>  package/bctoolbox/0001-fix-typo.patch | 18 ------------------
>  1 file changed, 18 deletions(-)
>  delete mode 100644 package/bctoolbox/0001-fix-typo.patch

Series applied to master. Thanks!

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

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

end of thread, other threads:[~2017-02-20 21:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-14 22:43 [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Jörg Krause
2017-02-14 22:44 ` [Buildroot] [PATCH 2/4] bctoolbox: add patch to fix static linking Jörg Krause
2017-02-14 22:44 ` [Buildroot] [PATCH 3/4] bctoolbox: fix mbedtls/polarssl dependency Jörg Krause
2017-02-14 22:44 ` [Buildroot] [PATCH 4/4] bctoolbox: disable rpath Jörg Krause
2017-02-15  5:28   ` Baruch Siach
2017-02-15  6:12     ` Samuel Martin
2017-02-15  8:58       ` Thomas Petazzoni
2017-02-15  8:56     ` Thomas Petazzoni
2017-02-19 15:07       ` Jörg Krause
2017-02-19 17:44         ` Thomas Petazzoni
2017-02-20 21:25 ` [Buildroot] [PATCH 1/4] Revert "bctoolbox: fix typos and logic error" Thomas Petazzoni

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