diff mbox series

optee-test: Use system openssl on musl

Message ID 20220730162741.3624780-1-raj.khem@gmail.com
State New
Headers show
Series optee-test: Use system openssl on musl | expand

Commit Message

Khem Raj July 30, 2022, 4:27 p.m. UTC
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'

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-arm/recipes-security/optee/optee-test_3.17.0.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Ross Burton July 30, 2022, 7:29 p.m. UTC | #1
> On 30 Jul 2022, at 17:27, Khem Raj via lists.yoctoproject.org <raj.khem=gmail.com@lists.yoctoproject.org> wrote:
> 
> 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
Khem Raj July 30, 2022, 9:17 p.m. UTC | #2
On Sat, Jul 30, 2022 at 3:30 PM Ross Burton <Ross.Burton@arm.com> wrote:

>
>
> > On 30 Jul 2022, at 17:27, Khem Raj via lists.yoctoproject.org <raj.khem=
> gmail.com@lists.yoctoproject.org> wrote:
> >
> > 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.


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


>
> Ross
Jon Mason July 31, 2022, 3:07 a.m. UTC | #3
On Sat, 30 Jul 2022 09:27:41 -0700, Khem Raj wrote:
> 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,
diff mbox series

Patch

diff --git a/meta-arm/recipes-security/optee/optee-test_3.17.0.bb b/meta-arm/recipes-security/optee/optee-test_3.17.0.bb
index 6fa10e7..18870da 100644
--- a/meta-arm/recipes-security/optee/optee-test_3.17.0.bb
+++ b/meta-arm/recipes-security/optee/optee-test_3.17.0.bb
@@ -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"