Build issues with various compilers - Clang and Distcc #5071
Labels
bug
component-crypto
Crypto primitives and low-level interfaces
component-tls
historical-reviewing
Currently reviewing (for legacy PR/issues)
size-s
Estimated task size: small (~2d)
Summary
With distcc, top-level CMakeLists.txt fails because of line 145:
https://github.com/ARMmbed/mbedtls/blob/e3e16d5d67df6d367163332ba12f22c49719799e/CMakeLists.txt#L145
${CMAKE_C_COMPILER} evaluates to 'distcc' instead of 'distcc ' resulting in GCC_VERSION getting distcc version instead of the gcc version. This adds unrecognized compiler flags which results in a build error. I found that using CMAKE_C_COMPILER_VERSION worked here instead.
With a clang build, there were numerous errors in library/:
bignum.c:
https://github.com/ARMmbed/mbedtls/blob/e3e16d5d67df6d367163332ba12f22c49719799e/library/bignum.c#L908
fails to compile with -Wunreachable-code
debug.c:
https://github.com/ARMmbed/mbedtls/blob/e3e16d5d67df6d367163332ba12f22c49719799e/library/debug.c#L400
Fails to compile with -Wunreachable-code
ssl_msg.c:
https://github.com/ARMmbed/mbedtls/blob/e3e16d5d67df6d367163332ba12f22c49719799e/library/ssl_msg.c#L1945
and
https://github.com/ARMmbed/mbedtls/blob/e3e16d5d67df6d367163332ba12f22c49719799e/library/ssl_msg.c#L2000
Fail to compile with -Wunreachable-code
System information
Mbed TLS version (number or commit id): 2.27.0
Operating system and version: Linux RHEL 7.7
Configuration (if not default, please attach
mbedtls_config.h
):Compiler and options (if you used a pre-built binary, please indicate how you obtained it): No special options used.
Additional environment information:
Clang version: 4.2.1
Distcc version: 7
Distcc uses GCC version 4.9.4
Expected behavior
Build successful.
Actual behavior
Build failed.
The text was updated successfully, but these errors were encountered: