Closed mman closed 2 years ago
Which compiler and options were you using to get this warning?
I am using clang shipping with Xcode and in fact compiling mbedtls as a static library as part of swift package wrapping it. The flags are pretty standard only specifying -I
to include mbedtls public headers. Nothing extra special there:
I have been using this approach since mbedtls-2.10 without any troubles as I can see that Cmakefile is pretty basic with no special requirements on the flags. Correct?
Apple clang version 14.0.0 (clang-1400.0.28.1)
Target: x86_64-apple-darwin21.5.0
And the build command used (simplified) is pasted here:
clang -fobjc-arc -target x86_64-apple-macosx10.13 -g -O0 -DSWIFT_PACKAGE=1 -DDEBUG=1 -fblocks -fmodules -fmodule-name=mbedtls -I mbedtls-swift/Sources/mbedtls/include -fPIC -MD -MT dependencies -MF mbedtls-swift/.build/x86_64-apple-macosx/debug/mbedtls.build/library/platform.c.d -c mbedtls-swift/Sources/mbedtls/library/platform.c -o mbedtls-swift/.build/x86_64-apple-macosx/debug/mbedtls.build/library/platform.c.o
mbedtls-swift/Sources/mbedtls/library/psa_crypto_cipher.c:25:10: error: 'psa_crypto_cipher.h' file not found with <angled> include; use "quotes" instead
#include <psa_crypto_cipher.h>
^~~~~~~~~~~~~~~~~~~~~
"psa_crypto_cipher.h"
1 error generated.
Okay, thanks, looks like there's not a compiler -W
flag we can enable to see this in our builds.
Are you able to create a PR with your patch? It will need to include a ChangeLog entry (a file in ChangeLog.d
) and a backport to mbedtls-2.28
(and a DCO Signed-off-by:
line in the commit(s)).
@tom-cosgrove-arm Not sure if I followed the procedure correctly, but here is the PR against development
branch: https://github.com/Mbed-TLS/mbedtls/pull/6114
Closing as this has been fixed by now-merged PRs #6114 for development
and #6168 for 2.28-LTS backport.
Thanks for the report and for creating the PRs - much appreciated
Summary
Compiling mbedtls-3.2.1 with default config and stricter compiler checks, the compilation fails with:
I think the compiler is right since
psa_crypto_cipher.h
is located along with sources inlibrary
folder.This patch fixed it:
System information
Mbed TLS version (number or commit id): 3.2.1 Operating system and version: macOS 12.4