Skip to content

CMake install picks up the build_info.h from TF-PSA-Crypto #10022

@gstrauss

Description

@gstrauss

Summary

mbedtls development branch mbedtls/build_info.h no longer defines MBEDTLS_VERSION_NUMBER

The entire contents of mbedtls/build_info.h is effectively only #include "tf-psa-crypto/build_info.h"

System information

Mbed TLS version (number or commit id): 243e13f
Operating system and version: Fedora Linux 41, x86_64 architecture
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):

$ gcc --version
gcc (GCC) 14.2.1 20250110 (Red Hat 14.2.1-7)

Additional environment information:

Expected behavior

MBEDTLS_VERSION_NUMBER should be defined.

Actual behavior

MBEDTLS_VERSION_NUMBER is not defined.

Steps to reproduce

$ git clone https://github.com/Mbed-TLS/mbedtls
$ cd mbedtls
$ git submodule update --init
$ cd tf-psa-crypto
$ git submodule update --init
$ cd ..
$ cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On -DCMAKE_INSTALL_PREFIX=/dev/shm/opt .
$ cmake --build .
$ cmake --install . 

$ gcc -I/dev/shm/opt/include -dM -E - < /dev/shm/opt/include/mbedtls/version.h | grep MBEDTLS_VERSION_NUMBER

Additional information

mbedtls/build_info.h should also #include <mbedtls/mbedtls_config.h>
mbedtls/mbedtls_config.h is not present in mbedtls 2.x. IIRC, that used config.h.
For portability, consumers should get the appropriate info from a single #include <mbedtls/version.h>

Metadata

Metadata

Labels

bugcomponent-platformPortability layer and build scriptssize-sEstimated task size: small (~2d)

Type

No type

Projects

Status

1.0 pre-release cleanup

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions