summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2015-05-05 16:11:14 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2015-05-12 10:06:08 +0200
commitf8ad296f9fdac7e142faa75076aaa882e29dfbad (patch)
tree260e6ab3a8f7da274173893e3b52d9c3fcbef47e
parentf60bd5556d8eb9f8f49bf65020799319ab1c0cea (diff)
tegrarcm/cryptopp: build and use as a static library
We need libcryptopp only for a 32bit x86 target for tegrarcm. However linking libcryptopp dynamically and using the distro supplied 32bit compatibility libcryptopp raises an assertion: tegrarcm: secblock.h:145: CryptoPP::NullAllocator<T>::pointer CryptoPP::NullAllocator<T>::allocate(CryptoPP::NullAllocator<T>::size_type, const void*) [with T = unsigned int; CryptoPP::NullAllocator<T>::pointer = unsigned int*; CryptoPP::NullAllocator<T>::size_type = unsigned int]: Assertion `false' failed. Building only a static library with OE, (if native build forcing 32bit) fixes the issue.
-rw-r--r--recipes-bsp/tegrarcm/tegrarcm.bb7
-rw-r--r--recipes-bsp/tegrarcm/tegrarcm/0001-configure.ac-link-crypotpp-as-a-static-library.patch29
-rw-r--r--recipes-support/libcryptopp/libcryptopp_5.6.2.bb5
3 files changed, 38 insertions, 3 deletions
diff --git a/recipes-bsp/tegrarcm/tegrarcm.bb b/recipes-bsp/tegrarcm/tegrarcm.bb
index b4aedb6..c371d03 100644
--- a/recipes-bsp/tegrarcm/tegrarcm.bb
+++ b/recipes-bsp/tegrarcm/tegrarcm.bb
@@ -8,8 +8,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=395fe5affb633ad84474e42989a8e5be"
BBCLASSEXTEND = "native nativesdk"
-SRC_URI = "git://github.com/NVIDIA/tegrarcm.git \
- "
+SRC_URI = " \
+ git://github.com/NVIDIA/tegrarcm.git \
+ file://0001-configure.ac-link-crypotpp-as-a-static-library.patch \
+"
+
SRCREV = "12b9718fc6b5be374d252be691733837e756d816"
PV = "1.6"
diff --git a/recipes-bsp/tegrarcm/tegrarcm/0001-configure.ac-link-crypotpp-as-a-static-library.patch b/recipes-bsp/tegrarcm/tegrarcm/0001-configure.ac-link-crypotpp-as-a-static-library.patch
new file mode 100644
index 0000000..5e38ae8
--- /dev/null
+++ b/recipes-bsp/tegrarcm/tegrarcm/0001-configure.ac-link-crypotpp-as-a-static-library.patch
@@ -0,0 +1,29 @@
+From fb84c35772a1883c48646638e2b7618442f82ff6 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Tue, 5 May 2015 13:54:11 +0200
+Subject: [PATCH] configure.ac: link crypotpp as a static library
+
+We want to build -native for a 32 bit machine but have issues with certain
+distributions 32bit libcryptopp.so. So link against our own build
+of a 32bit libcryptopp.a
+---
+ configure.ac | 2 +-
+ src/Makefile.am | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c95a0ec..250f3c2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -20,7 +20,7 @@ AC_CHECK_LIB([pthread],
+ PKG_CHECK_MODULES([LIBUSB], [libusb-1.0])
+ AC_LANG(C++)
+ SAVED_LDFLAGS=$LDFLAGS
+-LDFLAGS="$LDFLAGS -lcryptopp -lpthread"
++LDFLAGS="$LDFLAGS -m32 -Wl,-Bstatic -lcryptopp -Wl,-Bdynamic -lpthread"
+ CRYPTOLIB=
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <cryptopp/cryptlib.h>],
+--
+1.9.3
+
diff --git a/recipes-support/libcryptopp/libcryptopp_5.6.2.bb b/recipes-support/libcryptopp/libcryptopp_5.6.2.bb
index 1932761..ad9e10b 100644
--- a/recipes-support/libcryptopp/libcryptopp_5.6.2.bb
+++ b/recipes-support/libcryptopp/libcryptopp_5.6.2.bb
@@ -21,11 +21,14 @@ inherit autotools-brokensep pkgconfig
EXTRA_OECONF = "--libdir=${base_libdir}"
+#we want tegrarcm binary to run on a 32-bit architecture, on x86_64 this requires the 32-bit compatibility libs
+EXTRA_OEMAKE_class-native = "CC='${CC} -m32' CXX='${CXX} -m32'"
+
do_compile() {
sed -i -e 's/^CXXFLAGS/#CXXFLAGS/' GNUmakefile
export CXXFLAGS="${CXXFLAGS} -DNDEBUG -fPIC"
oe_runmake -f GNUmakefile
- oe_runmake libcryptopp.so
+ oe_runmake libcryptopp.a
}
do_install_prepend() {