-
Notifications
You must be signed in to change notification settings - Fork 67
Fix bug that caused build to break with -DUSE_SHARED_TF_PSA_CRYPTO_LIBRARY=ON #277
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
Closed
felixc-arm
wants to merge
7
commits into
Mbed-TLS:development
from
felixc-arm:fix-which-aes-ld-error
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
aafe9c6
Fix bug that cause build to break with -DUSE_SHARED_TF_PSA_CRYPTO_LIB…
felixc-arm 63f4915
Fix linker error
felixc-arm 8d619e6
Remove changes to test new CI
felixc-arm d28522a
Add CI job to catch issue in future
felixc-arm ac140e5
Make CI job use GCC
felixc-arm 77f4e51
Improve comments
felixc-arm b920a5b
Re-add bug fix to validate CI job
felixc-arm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,40 @@ component_test_tf_psa_crypto_shared () { | |
| $FRAMEWORK/tests/programs/dlopen_demo.sh | ||
| } | ||
|
|
||
| support_build_tf_psa_crypto_shared_newer_ld_gcc () { | ||
| ld_version="" | ||
| ld_version_major="" | ||
| ld_version_minor="" | ||
| distrib_id="" | ||
|
|
||
| # Attempt to parse ld -v to find out ld’s version. If not found this should fail safe. | ||
| if command ld -v >/dev/null 2>&1; then | ||
| ld_version=$(ld -v | awk '{print $NF}') | ||
| # split into major and minor | ||
| ld_version_major=${ld_version%%.*} | ||
| tmp=${ld_version#*.} | ||
| ld_version_minor=${tmp%%.*} | ||
| fi | ||
|
|
||
| if [[ -f /etc/lsb-release ]]; then | ||
| while read -r lsb_line; do | ||
| case "$lsb_line" in | ||
| "DISTRIB_ID"*) distrib_id=${lsb_line/#DISTRIB_ID=};; | ||
| esac | ||
| done < /etc/lsb-release | ||
| fi | ||
|
|
||
| # Newer lds with gcc cause extra errors that wouldn't be caught with older versions | ||
| [ "$distrib_id" != "Ubuntu" ] || [ "$ld_version_minor" -gt 37 ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the exact Linux distribution matter? As far as I understand, there are three possibilities:
If we just want a recent enough GNU binutils, given that we can assume Ubuntu, we can just check the version of binutils. |
||
| } | ||
|
|
||
| component_build_tf_psa_crypto_shared_newer_ld_gcc () { | ||
| msg "build/test: shared libraries" | ||
| # Test building with this option with newer lds and gcc for a more thorough check | ||
| CC=gcc cmake -DUSE_SHARED_TF_PSA_CRYPTO_LIBRARY=ON "$TF_PSA_CRYPTO_ROOT_DIR" | ||
| make | ||
| } | ||
|
|
||
| component_test_tf_psa_crypto_out_of_source () { | ||
| msg "build: cmake tf-psa-crypto 'out-of-source' build" | ||
| cd $OUT_OF_SOURCE_DIR | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think it would be better to not do that as this rather hides than fixes the issue. The core issue seems that we have two separate libraries, in the C compiler/linker sense, for the PSA core and the driver builtin that reference each other and it is linker dependent how this is handled. We should probably have only one library and in the CMake scripts to define the builtin library as an object library. I will create an issue for that.
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.
Here is the issue: #300