-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix build failure if MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO are set #2079
Merged
Conversation
This file contains 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 commit adds a test to tests/scripts/all.sh exercising an ASan build of the default configuration with MBEDTLS_PLATFORM_MEMORY enabled, MBEDTLS_PLATFORM_CALLOC_MACRO set to std calloc MBEDTLS_PLATFORM_FREE_MACRO set to std free (This should functionally be indistinguishable from a default build)
This commit removes the definition of the API function `mbedtls_platform_set_calloc_free()` from `library/platform.c` in case the macros `MBEDTLS_PLATFORM_CALLOC_MACRO` `MBEDTLS_PLATFORM_FREE_MACRO` for compile time configuration of calloc/free are set. This is in line with the corresponding header `mbedtls/platform.h` which declares `mbedtls_platform_set_calloc_free()` only if `MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO` are not defined. Fixes Mbed-TLS#1642.
This was referenced Oct 11, 2018
mpg
previously approved these changes
Oct 16, 2018
k-stachowiak
previously approved these changes
Oct 19, 2018
RonEld
suggested changes
Oct 23, 2018
6f04c7e
to
e4f965d
Compare
@k-stachowiak @mpg @RonEld Please re-review the amendment of the ChangeLog. |
RonEld
reviewed
Oct 25, 2018
k-stachowiak
approved these changes
Oct 25, 2018
RonEld
approved these changes
Oct 25, 2018
Please fix the backports as well, as they are currently already marked as ready for merge |
@RonEld Done. |
Note: I edited the PR description to add that it #882 is fixed too (according to the ChangeLog) and correct the markup so that github understands it: it's "fixes xxx fixes yyy fixes zzz", not "fixes xxx, yyy and zzz". |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Summary: This PR fixes #1642, the issue being a build failure in configurations that use the compile time configuration macros
MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO
to set customcalloc()
andfree()
functions. If these macros are defined, the API for runtime configurationsmbedtls_platform_set_calloc_free()
should be omitted fromplatform.c
(as inplatform.h
) but it's not. For the development branch, this leads to compilation warning (hence failure in some build modes) about function definition without prior declaration, while in the LTS branches Mbed TLS 2.1 and Mbed TLS 2.7, the compilation fails due to multiple function definitions (the reason for the different symptoms is commit 7decfe8 was applied in between 2.7 and the development branch).Internal Reference: IOTSSL-2312, IOTSSL-2358.
Fixes #882 fixes #1642 fixes #1706.