-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Migrate configuration-crypto components to cmake #10507
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
base: development
Are you sure you want to change the base?
Migrate configuration-crypto components to cmake #10507
Conversation
78aec57 to
a39dc79
Compare
9a7e3aa to
006d758
Compare
35af1d8 to
dab67bd
Compare
51266d8 to
61f5ab1
Compare
ronald-cron-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks quit good to me. I have a few questions and suggestions. Regarding completeness, although we discuss to discard it at some point, we should be able to migrate test_psa_crypto_drivers as well I'd say.
@ronald-cron-arm This is possible but not as straighforward right now. As you have discovered in your own pr https://github.com/Mbed-TLS/mbedtls-framework/pull/243/files#diff-778df0488579c2de20bb280c3c142e099f065b8a3887e31ce3ed4462a06ff0af those utiility functions demonstrated in my now void pr need to be static, because the To migrate the component_test_psa_crypto_drivers to cmake should be as simple as this
The gains of migrating one component do not outweight the cost of trying to target a moving chain of commits. ps. Currently tested with the latest mbedtls pointing to the latest tf-psa-crypto with the framework pointer and it does not work. Alternatively I can write the cmake component now, and explicitly disable all the compilation flags that scream e.g |
If you need to update the tf-psa-crypto and framework pointers and to rebase, please do it. |
ronald-cron-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks almost good to me. A few final comments.
| msg "all loops unrolled" | ||
| $MAKE_COMMAND clean | ||
| make -C tests ../tf-psa-crypto/tests/test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" | ||
| CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" cmake -D CMAKE_BUILD_TYPE:String=None . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" cmake -D CMAKE_BUILD_TYPE:String=None . | |
| CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" cmake . |
We have started to remove some "-D CMAKE_BUILD_TYPE:String=None", what about to remove them consistently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am happy to do it but again I need to reiterate that the decision tree choice to use CMAKE_BUILD_TYPE:String=None is when we want to test fine grained flag combinations. This component will work either way but felt like it was doing that.
So the answer to that is a yes & no. Yes we have an issue, but no our CI will not catch it, but my computer will. Also need to update the framework pointer in tf-psa-crypto to bring the changes that I discussed above. Raised a PR that does both here Mbed-TLS/TF-PSA-Crypto#614 |
Migrate all straightfoward components from using $ASAN_CFLAGS to CMAKE_BUILD_TYPE:String=Asan Signed-off-by: Minos Galanakis <[email protected]>
…o cmake Optimization for size (-Os) is required. Signed-off-by: Minos Galanakis <[email protected]>
…r_accel_ec to cmake Compilation flags, and spe include directories have been adjusted Signed-off-by: Minos Galanakis <[email protected]>
…onents to cmake - By default all unspecified build-type components should be release - CMAKE_BUILD_TYPE:String=Release enables the following CFLAGS: "-O2 -Werror -Wall -Wextra" Signed-off-by: Minos Galanakis <[email protected]>
…se components to cmake Moved the following components to CMAKE_BUILD_TYPE:String=Release and adjusted the include paths for cmake: * component_build_psa_crypto_spm * component_test_tfm_config_no_p256m Signed-off-by: Minos Galanakis <[email protected]>
…d_light_only to cmake Use compilation directory for object discovery in out-of-source CMake builds. Signed-off-by: Minos Galanakis <[email protected]>
…_BUILD_TYPE:String=None Improve compilation flag granularity by disabling CMAKE_BUILD_TYPE defaults and asserting test-specific flags manually. Signed-off-by: Minos Galanakis <[email protected]>
Signed-off-by: Minos Galanakis <[email protected]>
The original make -C tests, contains a perl inliner to generate the alt-headers. Replicated that logic in sed regex. Signed-off-by: Minos Galanakis <[email protected]>
Update the previously modified component to use consistent syntax: * make -> cmake --build . * make test -> ctest * Removed redudant CC=$ASAN_CC for BUILD_TYPE:String=Asan Signed-off-by: Minos Galanakis <[email protected]>
Signed-off-by: Minos Galanakis <[email protected]>
…needed. Signed-off-by: Minos Galanakis <[email protected]>
build_psa_alt_headers will now generate the headers at ./tests/include/alt-dummy instead of ./framework/tests/include/alt-extra. Signed-off-by: Minos Galanakis <[email protected]>
…f_source_directory for test_crypto_full_md_light_only Signed-off-by: Minos Galanakis <[email protected]>
Signed-off-by: Minos Galanakis <[email protected]>
1025f2b to
c0fbb16
Compare
|
Addressed @ronald-cron-arm's comments at 1025f2b and then rebased on top of head of public/development. The only outstandading comment which I did not push an update for is the discussion about |
My last #10507 (comment) was not about |
ronald-cron-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing my comments. My last comment #10507 (comment) is not a blocker thus I am approving as it is. Regarding test_psa_crypto_drivers that was discussed at some point I can see that it would need some changes in the framework and TF-PSA-Crypto. Thus better to address that one separately.
|
Thanks @ronald-cron-arm for the approval and the clarification for the 1025f2b comment. I will prepare a fix and upload it later today if it has no been reviewed yet, or I will move it to one of the follow up prs, if this one gets approved today. |
Description
Migrates a series of components from the configuration-crypto on mbedtls to cmake. One of many pr's required for #10472
PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.