Skip to content
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

Build issues with various compilers - Clang and Distcc #5071

Open
epsteina16 opened this issue Oct 13, 2021 · 1 comment
Open

Build issues with various compilers - Clang and Distcc #5071

epsteina16 opened this issue Oct 13, 2021 · 1 comment
Assignees
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)

Comments

@epsteina16
Copy link

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.

@ronald-cron-arm
Copy link
Contributor

Thanks for your report! Would you mind creating a PR for CMAKE_C_COMPILER_VERSION ?

@ronald-cron-arm ronald-cron-arm added bug component-crypto Crypto primitives and low-level interfaces component-tls Product Backlog size-s Estimated task size: small (~2d) labels Oct 21, 2021
@daverodgman daverodgman added the historical-reviewing Currently reviewing (for legacy PR/issues) label Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

No branches or pull requests

5 participants