Dave ran into this problem recently.
If a system has a version of mbedtls installed, then that version would get picked up instead of the OE version.
The command:
cc -Wl,-L/opt/openenclave/lib/openenclave/enclave ...
causes the system version to be picked up.
The command
cc -L/opt/openenclave/lib/openenclave/enclave ...
causes the OE version to be picked up.
Visual Studio (in the remote VM workflow) uses the former syntax when generating the command line for linking an enclave.
Dave and I ended up working around this by encoding the linker directory as a compiler option; i.e the second syntax.
We need to consider if OE versions of libraries ought to have a distinguishing prefix so that they are distinct from system libraries.
CC: @dthaler @mikbras @CodeMonkeyLeet @jxyang @yakman2020
We've hit that problem before, and we work around it by specifying absolute paths of mbedtls .a files passed to -l rather than rely on -L lookup.
We propose renaming the mbedtls libraries that we distribute to something like "oembedtls".
@anakrish is this still an issue? If so, can you provide more information about how to reproduce? Thanks!
@ryanhsu19
Please take a look at this
Please re-assign. Thanks.
This does not seems to be a problem now. I'm closing this issue. Feel free to reopen if needed.
@mingweishih I'm reopening this since OE's mbedtls libraries don't have the oe prefix. Therefore users will still run into the issue.