meta-arm.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
From: "Ross Burton" <ross@burtonini.com>
To: meta-arm@lists.yoctoproject.org
Subject: [PATCH] arm/hafnium: use sysroot libcrypto
Date: Tue, 27 Jul 2021 17:00:46 +0100	[thread overview]
Message-ID: <20210727160046.2566234-1-ross.burton@arm.com> (raw)

Hafnium's build of the kernel needs libssl-dev to be installed on the host.

Instead, DEPEND on openssl-native and patch the lookup to use pkg-config-native.

Change-Id: Id184865183cde487cacd73740a916166c2900a66
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../hafnium/hafnium/pkg-config-native.patch   | 29 +++++++++++++++++++
 meta-arm/recipes-bsp/hafnium/hafnium_2.5.bb   |  5 ++--
 2 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 meta-arm/recipes-bsp/hafnium/hafnium/pkg-config-native.patch

diff --git a/meta-arm/recipes-bsp/hafnium/hafnium/pkg-config-native.patch b/meta-arm/recipes-bsp/hafnium/hafnium/pkg-config-native.patch
new file mode 100644
index 0000000..2dcf35a
--- /dev/null
+++ b/meta-arm/recipes-bsp/hafnium/hafnium/pkg-config-native.patch
@@ -0,0 +1,29 @@
+Use pkg-config-native to find the libssl headers. The bulk of this patch is
+actually a backport from mainline Linux, but pkg-config changed to
+pkg-config-native.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+
+diff --git a/scripts/Makefile b/scripts/Makefile
+index 9adb6d247818..5fe371c7d7f5 100644
+--- a/third_party/linux/scripts/Makefile
++++ b/third_party/linux/scripts/Makefile
+@@ -21,10 +21,15 @@ hostprogs-$(CONFIG_MODULE_SIG_FORMAT) += sign-file
+ hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert
+ hostprogs-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert
+ 
++CRYPTO_CFLAGS = $(shell pkg-config-native --cflags libcrypto)
++CRYPTO_LIBS = $(shell pkg-config-native --libs libcrypto)
++
+ HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include
+ HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include
+-HOSTLDLIBS_sign-file = -lcrypto
+-HOSTLDLIBS_extract-cert = -lcrypto
++HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS)
++HOSTLDLIBS_sign-file = $(CRYPTO_LIBS)
++HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS)
++HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS)
+ 
+ always		:= $(hostprogs-y) $(hostprogs-m)
+ 
diff --git a/meta-arm/recipes-bsp/hafnium/hafnium_2.5.bb b/meta-arm/recipes-bsp/hafnium/hafnium_2.5.bb
index 97e31e8..6d8bb3f 100644
--- a/meta-arm/recipes-bsp/hafnium/hafnium_2.5.bb
+++ b/meta-arm/recipes-bsp/hafnium/hafnium_2.5.bb
@@ -7,7 +7,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 inherit deploy python3native
 
-SRC_URI = "gitsm://git.trustedfirmware.org/hafnium/hafnium.git;protocol=https"
+SRC_URI = "gitsm://git.trustedfirmware.org/hafnium/hafnium.git;protocol=https \
+           file://pkg-config-native.patch"
 SRCREV = "3a149eb219467c0d9336467ea1fb9d3fb65da94b"
 S = "${WORKDIR}/git"
 
@@ -27,7 +28,7 @@ HAFNIUM_BUILD_DIR_PLAT = "out/${HAFNIUM_PROJECT}/${HAFNIUM_PLATFORM}_clang"
 # default to hafnium
 HAFNIUM_INSTALL_TARGET ?= "hafnium"
 
-DEPENDS = "bison-native bc-native"
+DEPENDS = "bison-native bc-native openssl-native"
 
 # set project to build
 EXTRA_OEMAKE += "PROJECT=${HAFNIUM_PROJECT}"
-- 
2.25.1


                 reply	other threads:[~2021-07-27 16:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210727160046.2566234-1-ross.burton@arm.com \
    --to=ross@burtonini.com \
    --cc=meta-arm@lists.yoctoproject.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).