Add suffix to mbedtls_log
to avoid link name conflict error
#245
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 of Changes in this PR
This PR addresses the link name conflict error that occurs when using different versions of the
mbedtls
crate in a single project, by adopting the approach used in PR #234.Rationale Behind the Approach
During testing, it was discovered that simply renaming
mbedtls_log
resolves the linking error. Therefore, theexport_name
attribute is employed here, as done in PR #243.Upon further investigation, it was found that the linker error stems from multiple definitions of
mbedtls_log
in the Rust code. The C compiler attempts to locate and link thembedtls_log
function implemented in Rust to the C library, but it encounters duplicate instances of the function with the same name.It's important to note that the linking search direction is from C to Rust, so naming on the C side is not a concern. Functions named
mbedtls_printf
in multiplerust_printf.c
files are similar to other functions in the C mbedtls code and do not cause link name conflict errors.