Skip to contentSkip to conversation

optee-test: Use system openssl on musl

PATCH Applied Khem Raj 3 participants 4 messages Jul 30, 2022 – Jul 31, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 optee-test: Use system openssl on musl

bundled libcrypto.a in optee-test sources is built using glibc based toolchain and expects foritied _chk version of the libc functions e.g. __sprintf_chk which wont work for musl. Therefore rely on freshly built openssl by OE instead

Fixes errors like

arm-yoe-linux-musleabi/gcc/arm-yoe-linux-musleabi/12.1.0/ld: ../openssl/lib/arm/libcrypto.a(dso_dlfcn.o): in function `dlfcn_name_converter':
dso_dlfcn.c:(.text+0x19e): undefined reference to `__sprintf_chk'

---
 meta-arm/recipes-security/optee/optee-test_3.17.0.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-arm/recipes-security/optee/optee-test_3.17.0.bb +4 -1
index 6fa10e7..18870da 100644
@@ -3,5 +3,8 @@ require optee-test.inc
 SRC_URI:append = " \
     file://musl-workaround.patch \
    "
-
 SRCREV = "44a31d02379bd8e50762caa5e1592ad81e3339af"
+
+EXTRA_OEMAKE:append:libc-musl = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}"
+DEPENDS:append:libc-musl = " openssl"
+CFLAGS:append:libc-musl = " -Wno-error=deprecated-declarations"
Signature · 1 line
2.37.1
#1 lore raw
Quoted 8 lines · Khem Raj via lists.yoctoproject.org

bundled libcrypto.a in optee-test sources is built using glibc based toolchain and expects foritied _chk version of the libc functions e.g. __sprintf_chk which wont work for musl. Therefore rely on freshly built openssl by OE instead

This sounds like something that should be done always, and not just on musl builds.

Ross

author
#2 lore raw
Quoted 5 lines · Ross Burton
Quoted 3 lines

On 30 Jul 2022, at 17:27, Khem Raj via lists.yoctoproject.org <raj.khem=

Quoted 1 line · [email protected]> wrote:
Quoted 8 lines
Quoted 2 lines

bundled libcrypto.a in optee-test sources is built using glibc based toolchain and expects foritied _chk version of the libc functions e.g.

__sprintf_chk

Quoted 2 lines

which wont work for musl. Therefore rely on freshly built openssl by OE instead

This sounds like something that should be done always, and not just on musl builds.

One would think so but that seems to be not the case there is a vendored version on libcrypto.a and that’s the default I also opened an issue upstream to at least build the static archive such that’s it’s compatible with musl and glibc see

https://github.com/OP-TEE/optee_test/issues/607

Also see this one for related comments

https://github.com/OP-TEE/optee_test/issues/599

Quoted 2 lines

Ross

Applied
#3 lore raw
In reply to Khem Raj
Quoted 8 lines · Khem Raj

bundled libcrypto.a in optee-test sources is built using glibc based toolchain and expects foritied _chk version of the libc functions e.g. __sprintf_chk which wont work for musl. Therefore rely on freshly built openssl by OE instead

Fixes errors like

[...]

Applied, thanks!

[1/1] optee-test: Use system openssl on musl

      commit: 31452ae4cf0be3d2d78a4019e44f9370b9e93fbb

Best regards,

Signature · 1 line
Jon Mason <[email protected]>