Skip to contentSkip to conversation

bctoolbox: fix typos and logic error

PATCH New Waldemar Brodkorb 4 participants 8 messages Feb 14, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

To get the directory path from the library name you need to use a single filename. Fix typo in variable name.

This fixes the ortp autobuild errors which uses the broken pkgconfig file from bctoolbox.

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

---
 package/bctoolbox/0001-fix-typo.patch | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 package/bctoolbox/0001-fix-typo.patch
package/bctoolbox/0001-fix-typo.patch new file +18 -0
new file mode 100644
index 0000000..b94daee
@@ -0,0 +1,18 @@
+Fix a typo in the variable name. Only check path for a single library name.
+
+Signed-off-by: Waldemar Brodkorb <[email protected]> 
+
+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)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Waldemar" == Waldemar Brodkorb <[email protected]> writes:

To get the directory path from the library name you need to use a single filename. Fix typo in variable name.

Quoted 8 lines

This fixes the ortp autobuild errors which uses the broken pkgconfig file from bctoolbox.

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

Committed, thanks. Don't forget to send the patch upstream.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

In reply to Waldemar Brodkorb

Hello,

Thanks a lot for looking into this build issue and fixing it. Just one comment below.

package/bctoolbox/0001-fix-typo.patch line 3

Quoted 9 lines · Waldemar Brodkorb
package/bctoolbox/0001-fix-typo.patch new file +3 -0
new file mode 100644
index 0000000..b94daee
@@ -0,0 +1,18 @@
+Fix a typo in the variable name. Only check path for a single library name.
+
+Signed-off-by: Waldemar Brodkorb <[email protected]> 

When the upstream project uses Git, I really, really prefer when the patches are Git formatted. This way, they can easily be git am'ed by other people who need to create/rework patches for the same package.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#3 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

In reply to Waldemar Brodkorb

Hi Waldemar,

Quoted 45 lines · Waldemar Brodkorb

To get the directory path from the library name you need to use a single filename. Fix typo in variable name.

This fixes the ortp autobuild errors which uses the broken pkgconfig file
from bctoolbox.

Fixes:
? http://autobuild.buildroot.net/results/37d5625df4be11ccdc063871e9f6
e13d5f59fb52
? http://autobuild.buildroot.net/results/1999c841fae41f860f00747a3623
27cb2857e687

---
?package/bctoolbox/0001-fix-typo.patch | 18 ++++++++++++++++++ ?1 file changed, 18 insertions(+)
?create mode 100644 package/bctoolbox/0001-fix-typo.patch

package/bctoolbox/0001-fix-typo.patch new file +1 -0
new file mode 100644
index 0000000..b94daee
@@ -0,0 +1,18 @@
+Fix a typo in the variable name. Only check path for a single

library name.

package/bctoolbox/0001-fix-typo.patch new file +4 -0
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>?
+
+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}")

Quoted 8 lines

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

With this fix applied the bctoolbox pkg-config 'Libs.private:' value is set to:

""" Libs.private:??-L/mnt/data/git/buildroot/output/host/usr/arm-buildroot- linux-uclibcgnueabi/sysroot/usr/lib32
"""

No mbedtls libraries are included here.

And the flag 'BCTOOLBOX_LIBS' in ortp is set to:

""" -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- uclibcgnueabi/sysroot/usr/lib -lbctoolbox -L/mnt/data/git/buildroot/output/host/usr/ar"\
"m-buildroot-linux-uclibcgnueabi/sysroot/usr/lib32 """

From my understanding, all the three mbedtls libraries libmbedcrypto, libmbedx509, and libmbedtls should be added to the linker flags and therefore to 'Libs.private' in the pkg-config file, right?

J?rg

#4 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

Hi,
J?rg Krause wrote,

Quoted 76 lines

Hi Waldemar,

Quoted 45 lines · Waldemar Brodkorb

To get the directory path from the library name you need to use a single filename. Fix typo in variable name.

This fixes the ortp autobuild errors which uses the broken pkgconfig file
from bctoolbox.

Fixes:
? http://autobuild.buildroot.net/results/37d5625df4be11ccdc063871e9f6
e13d5f59fb52
? http://autobuild.buildroot.net/results/1999c841fae41f860f00747a3623
27cb2857e687

---
?package/bctoolbox/0001-fix-typo.patch | 18 ++++++++++++++++++ ?1 file changed, 18 insertions(+)
?create mode 100644 package/bctoolbox/0001-fix-typo.patch

package/bctoolbox/0001-fix-typo.patch new file +1 -0
new file mode 100644
index 0000000..b94daee
@@ -0,0 +1,18 @@
+Fix a typo in the variable name. Only check path for a single

library name.

package/bctoolbox/0001-fix-typo.patch new file +4 -0
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>?
+
+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}")

Quoted 8 lines

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

With this fix applied the bctoolbox pkg-config 'Libs.private:' value is set to:

""" Libs.private:??-L/mnt/data/git/buildroot/output/host/usr/arm-buildroot- linux-uclibcgnueabi/sysroot/usr/lib32
"""

No mbedtls libraries are included here.

And the flag 'BCTOOLBOX_LIBS' in ortp is set to:

""" -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- uclibcgnueabi/sysroot/usr/lib -lbctoolbox -L/mnt/data/git/buildroot/output/host/usr/ar"\
"m-buildroot-linux-uclibcgnueabi/sysroot/usr/lib32 """

Quoted 3 lines

From my understanding, all the three mbedtls libraries libmbedcrypto, libmbedx509, and libmbedtls should be added to the linker flags and therefore to 'Libs.private' in the pkg-config file, right?

I was only looking into the ortp build errors with complete empty -L . But you are right actually we might need to add -lmbedx509 -lmbedtls -lmbedcrypto
to fix any static linking issues.

I think upstream does add some -l for the polarssl case. I am not really using this packages, just want to minimize my architecture related build errors :)

Do you have a chance to suggest a better fix and test with static linking?

best regards
Waldemar

#5 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

Quoted 94 lines · Waldemar Brodkorb

Hi,
J?rg Krause wrote,

Quoted 81 lines

Hi Waldemar,

Quoted 48 lines · Waldemar Brodkorb

To get the directory path from the library name you need to use a single filename. Fix typo in variable name.

This fixes the ortp autobuild errors which uses the broken pkgconfig
file
from bctoolbox.

Fixes:
? http://autobuild.buildroot.net/results/37d5625df4be11ccdc063871
e9f6
e13d5f59fb52
? http://autobuild.buildroot.net/results/1999c841fae41f860f00747a
3623
27cb2857e687

---
?package/bctoolbox/0001-fix-typo.patch | 18 ++++++++++++++++++ ?1 file changed, 18 insertions(+)
?create mode 100644 package/bctoolbox/0001-fix-typo.patch

package/bctoolbox/0001-fix-typo.patch new file +1 -0
new file mode 100644
index 0000000..b94daee
@@ -0,0 +1,18 @@
+Fix a typo in the variable name. Only check path for a single

library name.

package/bctoolbox/0001-fix-typo.patch new file +4 -0
+
+Signed-off-by: Waldemar Brodkorb <[email protected]>?
+
+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}")

Quoted 8 lines

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

With this fix applied the bctoolbox pkg-config 'Libs.private:' value is
set to:

""" Libs.private:??-L/mnt/data/git/buildroot/output/host/usr/arm- buildroot-
linux-uclibcgnueabi/sysroot/usr/lib32
"""

No mbedtls libraries are included here.

And the flag 'BCTOOLBOX_LIBS' in ortp is set to:

""" -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- uclibcgnueabi/sysroot/usr/lib -lbctoolbox -L/mnt/data/git/buildroot/output/host/usr/ar"\
"m-buildroot-linux-uclibcgnueabi/sysroot/usr/lib32 """

Quoted 4 lines

From my understanding, all the three mbedtls libraries libmbedcrypto,
libmbedx509, and libmbedtls should be added to the linker flags and therefore to 'Libs.private' in the pkg-config file, right?

I was only looking into the ortp build errors with complete empty -L . But you are right
actually we might need to add -lmbedx509 -lmbedtls -lmbedcrypto to fix any static linking issues.

Quoted 6 lines

I think upstream does add some -l for the polarssl case. I am not really using this packages, just want to minimize my architecture related build errors :)

Do you have a chance to suggest a better fix and test with static linking?

From my understanding of pkg-config, 'Libs.private' should be:

"""
Libs.private:??-lmbedtls -lmbedcrypto -lmbedx509
"""

And how to set it in CMakeLists.txt:

"""
if(MBEDTLS_FOUND)

	set(LIBS_PRIVATE "${LIBS_PRIVATE} -lmbedtls -lmbedcrypto
-lmbedx509")
endif()
if(POLARSSL_FOUND)
	set(LIBS_PRIVATE "${LIBS_PRIVATE} -lpolarssl")

endif()
"""

This way?pkg-config (used in ortp) sets 'BCTOOLBOX_LIBS' to:

""" -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- uclibcgnueabi/sysroot/usr/lib -lbctoolbox -lmbedtls -lmbedcrypto -lmbedx509
"""

.. which should be correct.

J?rg

#6 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"J?rg" == J?rg Krause <[email protected]> writes:

Hi,

Quoted 7 lines
Quoted 2 lines

Do you have a chance to suggest a better fix and test with static linking?

From my understanding of pkg-config, 'Libs.private' should be:

"""
Libs.private:??-lmbedtls -lmbedcrypto -lmbedx509

And possibly a -L to where these libraries are located (which is the original issue).

Quoted 7 lines

""" -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- uclibcgnueabi/sysroot/usr/lib -lbctoolbox -lmbedtls -lmbedcrypto -lmbedx509
"""

.. which should be correct.

WIll you send a patch to do this?

Signature · 1 line
Bye, Peter Korsgaard
#7 lore raw

PATCH 1/1 bctoolbox: fix typos and logic error

Quoted 7 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"J?rg" == J?rg Krause <[email protected]> writes:

Hi,

?>> Do you have a chance to suggest a better fix and test with static ?>> linking?

Quoted 7 lines

?> From my understanding of pkg-config, 'Libs.private' should be:

?> """
?> Libs.private:??-lmbedtls -lmbedcrypto -lmbedx509

And possibly a -L to where these libraries are located (which is the original issue).

Is this necassary? I had a look at some pkg-config files and none of them used '-L' in 'Libs.private', only in 'Libs:'

Quoted 9 lines

?> """
?> -L/mnt/data/git/buildroot/output/host/usr/arm-buildroot-linux- ?> uclibcgnueabi/sysroot/usr/lib -lbctoolbox -lmbedtls -lmbedcrypto ?> -lmbedx509
?> """

?> .. which should be correct.

WIll you send a patch to do this?

Sure.

J?rg