Skip to contentSkip to conversation

arm/trusted-firmware-a: fix 2.4 build with OpenSSL

PATCH In review Ross Burton 2 participants 2 messages Nov 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm/trusted-firmware-a: fix 2.4 build with OpenSSL

2.4 has added support for a global OPENSSL_DIR make option, instead of hard-coded /usr into the individual Makefiles.

The TC0 build is now using a snapshot of TF-A after that change landed, so pass OPENSSL_DIR via EXTRA_OEMAKE to fix the build.

Change-Id I9e06991d15bb67f983a203ec3a1b1754cc6e2d7e
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++++
 1 file changed, 4 insertions(+)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +4 -0
index 393da40..f7439c1 100644
@@ -112,6 +112,9 @@ DEPENDS += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot', '', d)}"
 do_compile[depends] += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot:do_deploy', '', d)}"
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', 'BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '',d)}"
 
+# Tell the tools where the native OpenSSL is located
+EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
+
 EXTRA_OEMAKE_append_aarch64_qemuall = " \
     BL32=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-header_v2.bin \
     BL32_EXTRA1=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-pager_v2.bin \
@@ -132,6 +135,7 @@ do_compile() {
     # These changes are needed to have the native tools compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
+    # This can be removed when only TF-A 2.4 onwards is supported
     sed -i 's^OPENSSL_DIR.*=.*$^OPENSSL_DIR = ${STAGING_DIR_NATIVE}/${prefix_native}^' ${S}/tools/*/Makefile
 
     # Currently there are races if you build all the targets at once in parallel
Signature · 1 line
2.25.1
#1 lore raw
Quoted 8 lines · Ross Burton

2.4 has added support for a global OPENSSL_DIR make option, instead of hard-coded /usr into the individual Makefiles.

The TC0 build is now using a snapshot of TF-A after that change landed, so pass OPENSSL_DIR via EXTRA_OEMAKE to fix the build.

Change-Id I9e06991d15bb67f983a203ec3a1b1754cc6e2d7e

Patch pushed to master.

Thanks,
Jon

Quoted 33 lines
---
 .../recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc     | 4 ++++
 1 file changed, 4 insertions(+)
meta-arm/recipes-bsp/trusted-firmware-a/trusted-firmware-a.inc +4 -0
index 393da40..f7439c1 100644
@@ -112,6 +112,9 @@ DEPENDS += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot', '', d)}"
 do_compile[depends] += " ${@bb.utils.contains('TFA_UBOOT', '1', 'u-boot:do_deploy', '', d)}"
 EXTRA_OEMAKE += "${@bb.utils.contains('TFA_UBOOT', '1', 'BL33=${DEPLOY_DIR_IMAGE}/u-boot.bin', '',d)}"
 
+# Tell the tools where the native OpenSSL is located
+EXTRA_OEMAKE += "OPENSSL_DIR=${STAGING_DIR_NATIVE}/${prefix_native}"
+
 EXTRA_OEMAKE_append_aarch64_qemuall = " \
     BL32=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-header_v2.bin \
     BL32_EXTRA1=${STAGING_DIR_TARGET}${nonarch_base_libdir}/firmware/tee-pager_v2.bin \
@@ -132,6 +135,7 @@ do_compile() {
     # These changes are needed to have the native tools compiling and executing properly
     sed -i '/^LDLIBS/ s,$, \$\{BUILD_LDFLAGS},' ${S}/tools/fiptool/Makefile
     sed -i '/^INCLUDE_PATHS/ s,$, \$\{BUILD_CFLAGS},' ${S}/tools/fiptool/Makefile
+    # This can be removed when only TF-A 2.4 onwards is supported
     sed -i 's^OPENSSL_DIR.*=.*$^OPENSSL_DIR = ${STAGING_DIR_NATIVE}/${prefix_native}^' ${S}/tools/*/Makefile
 
     # Currently there are races if you build all the targets at once in parallel
Signature · 1 line
2.25.1