Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile issue with clang 13 #85

Closed
akuster opened this issue Jul 5, 2021 · 7 comments
Closed

Compile issue with clang 13 #85

akuster opened this issue Jul 5, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@akuster
Copy link

akuster commented Jul 5, 2021

Openembedded is now using gcc 11 and I am seeing the following build error.

parsec-service/0.7.0-r0/cargo_home/bitbake/psa-crypto-sys-0.8.0/vendor/library/psa_crypto.c:4590:12: error: parameter 'output_size' set but not used [-Werror,-Wunused-but-set-parameter]
| size_t output_size,
| ^
| 1 error generated.

Looking @ Mbedlts, it appears the offending function has been removed via commit:

commit 6d05173359fb53eb2a893e6834a221a4262233da
Author: Ronald Cron ronald.cron@arm.com
Date: Thu Oct 1 14:10:20 2020 +0200

psa: Add mbedtls_psa_cipher_xyz() APIs

Signed-off-by: Ronald Cron <ronald.cron@arm.com>

I think there is a mismatch somewhere.

@hug-dev hug-dev added the bug Something isn't working label Jul 6, 2021
@hug-dev
Copy link
Member

hug-dev commented Jul 6, 2021

Hey 👋!!
Thanks for the bug report.

Looks like this commit is part of this PR which was not included in the latest 2.26.0 release 😢
We are currently using 2.25.0 in this repo and ideally we would only point to Mbed TLS release versions. We could cherry-pick a bug fix on top of our git submodule but 6d05173359fb53eb2a893e6834a221a4262233da seems to be way bigger than just this bug fix so Im wondering if other things will break if we try just to apply that.

This looks like a Mbed TLS bug, is there anything reported on their side?

I am also wondering if you could remove the -Wunused-but-set-parameter flag by setting your own CFLAGS before compiling psa-crypto with GCC 11

@hug-dev
Copy link
Member

hug-dev commented Jul 7, 2021

Mbed TLS 3.0.0 was just released. If the fix is included there, we can just use that in this crate and it should work ™️

@ionut-arm
Copy link
Member

ionut-arm commented Jul 9, 2021

It is, indeed, included! However we need to see just how different Mbed TLS 3.0.0 is, at least in terms of PSA Crypto implementation

@akuster
Copy link
Author

akuster commented Jul 11, 2021

Apologies for the slow response. I have tried -Wunused-but-set-parameter but it does not propagate down to psa-crypto in the context of how this package is included within the OE build env. Sorry I can not be much help.

@hug-dev
Copy link
Member

hug-dev commented Jul 12, 2021

The three linked PR above confirms that there were breaking changes in between the Mbed TLS version we use (2.25.0) and 3.0.0. If we update psa-crypto to match 3.0.0, it would mean that we won't be able to dynamically link with an older version than that.

If think that's fine, but this will need notice where it causes a stability problem (for example in Parsec where we have to bump our minimum Mbed TLS version to 3.0.0).

@anta5010
Copy link
Contributor

@akuster The parsec-service recipe uses clang toolchain and the error you see is caused by meta-clang move to not yet released clang-13. I will update the recipe to use gcc toolchain instead for the current version of parsec service. The future version of parsec most likely will use a new version of mbedtls.

@anta5010 anta5010 changed the title Compile issue with gcc 11 Compile issue with clang 13 Jul 15, 2021
@hug-dev
Copy link
Member

hug-dev commented Oct 12, 2021

I guess that is closed now but feel free to re-open if the problem persists!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants