xen: PolarSSL recipe and patches for Xen stubdoms

PolarSSL (now mbedTLS) is a lightweight SSL library optimized for
embedded systems. In the case of Xen stubdomains, we are using MiniOS.
This PolarSSL recipe creates a static library that is cross-compiled
against MiniOS, Xen, LWIP, and Newlib headers and subsequently used
during the cross-compilation and linking of the stubdom specific GMP,
TPM Emulator, and the Xen vTPM and vTPM Manager stubdomains. The
current Xen source code is hardcoded to fetch a specific version of this
package. The patch files originate from the Xen/stubdom source tree.
This recipe provides the flexibility to change version or modify the
patches.

Signed-off-by: Kurt Bodiker <kurt.bodiker@braintrust-us.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Kurt Bodiker 2018-05-01 10:05:31 -04:00 committed by Bruce Ashfield
parent b9f265377c
commit e1279d6de6
3 changed files with 110 additions and 0 deletions

View File

@ -0,0 +1,64 @@
diff -Naur polarssl-1.1.4/include/polarssl/config.h polarssl-x86_64/include/polarssl/config.h
--- a/include/polarssl/config.h 2011-12-22 05:06:27.000000000 -0500
+++ b/include/polarssl/config.h 2012-10-30 17:18:07.567001000 -0400
@@ -164,8 +164,8 @@
* application.
*
* Uncomment this macro to prevent loading of default entropy functions.
-#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
*/
+#define POLARSSL_NO_DEFAULT_ENTROPY_SOURCES
/**
* \def POLARSSL_NO_PLATFORM_ENTROPY
@@ -175,8 +175,8 @@
* standards like the /dev/urandom or Windows CryptoAPI.
*
* Uncomment this macro to disable the built-in platform entropy functions.
-#define POLARSSL_NO_PLATFORM_ENTROPY
*/
+#define POLARSSL_NO_PLATFORM_ENTROPY
/**
* \def POLARSSL_PKCS1_V21
@@ -426,8 +426,8 @@
* Requires: POLARSSL_TIMING_C
*
* This module enables the HAVEGE random number generator.
- */
#define POLARSSL_HAVEGE_C
+ */
/**
* \def POLARSSL_MD_C
@@ -490,7 +490,7 @@
*
* This module provides TCP/IP networking routines.
*/
-#define POLARSSL_NET_C
+//#define POLARSSL_NET_C
/**
* \def POLARSSL_PADLOCK_C
@@ -644,8 +644,8 @@
* Caller: library/havege.c
*
* This module is used by the HAVEGE random number generator.
- */
#define POLARSSL_TIMING_C
+ */
/**
* \def POLARSSL_VERSION_C
diff -Naur polarssl-1.1.4/library/bignum.c polarssl-x86_64/library/bignum.c
--- a/library/bignum.c 2012-04-29 16:15:55.000000000 -0400
+++ b/library/bignum.c 2012-10-30 17:21:52.135000999 -0400
@@ -1101,7 +1101,7 @@
Z.p[i - t - 1] = ~0;
else
{
-#if defined(POLARSSL_HAVE_LONGLONG)
+#if 0 //defined(POLARSSL_HAVE_LONGLONG)
t_udbl r;
r = (t_udbl) X.p[i] << biL;

View File

@ -0,0 +1,27 @@
# Copyright (C) 2017 Kurt Bodiker <kurt.bodiker@braintrust-us.com>
# Released under the MIT license (see COPYING.MIT for the terms)
require stubdom.inc
DEPENDS += "\
newlib \
"
STUBDOM_CFLAGS += "\
-Wno-memset-elt-size \
-Wno-implicit-fallthrough \
"
# nothing to configure
do_configure[noexec] = "1"
do_compile() {
${MAKE} CC="${HOST_PREFIX}gcc --sysroot=${RECIPE_SYSROOT} ${STUBDOM_CPPFLAGS} ${STUBDOM_CFLAGS}"
}
do_install() {
install -d ${D}${includedir}
cp -r -t ${D}${includedir} ${S}/include/polarssl
install -d ${D}/${libdir}
install -m 644 -t ${D}/${libdir} ${S}/library/libpolarssl.a
}

View File

@ -0,0 +1,19 @@
# Copyright (C) 2017 Kurt Bodiker <kurt.bodiker@braintrust-us.com>
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "PolarSSL (now 'mbed TLS') is an open source, portable, easy to use, readable and flexible SSL library."
HOMEPAGE = "https://tls.mbed.org"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
# git hash for release tag polarssl-1.1.4
SRCREV_polarssl = "d36da11125a9c85c572a4fdf63e0a25e76d7bb18"
SRC_URI = "\
git://github.com/ARMmbed/mbedtls.git;protocol=https;nobranch=1;destsuffix=polarssl;name=polarssl \
file://polarssl.patch; \
"
S="${WORKDIR}/${PN}"
B="${S}/library"
require polarssl.inc