All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jörg Krause" <joerg.krause@embedded.rocks>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] bctoolbox: fix typos and logic error
Date: Tue, 14 Feb 2017 17:29:43 +0100	[thread overview]
Message-ID: <1487089783.1684.5.camel@embedded.rocks> (raw)
In-Reply-To: <20170214153958.GE12810@waldemar-brodkorb.de>

On Tue, 2017-02-14 at 16:39 +0100, Waldemar Brodkorb wrote:
> Hi,
> J?rg Krause wrote,
> 
> > Hi Waldemar,
> > 
> > On Tue, 2017-02-14 at 10:01 +0100, Waldemar Brodkorb wrote:
> > > 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
> > > 
> > > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
> > > ---
> > > ?package/bctoolbox/0001-fix-typo.patch | 18 ++++++++++++++++++
> > > ?1 file changed, 18 insertions(+)
> > > ?create mode 100644 package/bctoolbox/0001-fix-typo.patch
> > > 
> > > diff --git a/package/bctoolbox/0001-fix-typo.patch
> > > b/package/bctoolbox/0001-fix-typo.patch
> > > new file mode 100644
> > > index 0000000..b94daee
> > > --- /dev/null
> > > +++ b/package/bctoolbox/0001-fix-typo.patch
> > > @@ -0,0 +1,18 @@
> > > +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)
> > 
> > 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?
> 
> 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?

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

  reply	other threads:[~2017-02-14 16:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-14  9:01 [Buildroot] [PATCH] bctoolbox: fix typos and logic error Waldemar Brodkorb
2017-02-14 10:17 ` Peter Korsgaard
2017-02-14 10:20 ` Thomas Petazzoni
2017-02-14 15:22 ` Jörg Krause
2017-02-14 15:39   ` Waldemar Brodkorb
2017-02-14 16:29     ` Jörg Krause [this message]
2017-02-14 19:25       ` Peter Korsgaard
2017-02-14 20:10         ` Jörg Krause

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1487089783.1684.5.camel@embedded.rocks \
    --to=joerg.krause@embedded.rocks \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.