Browse Source

package/libiec61850: fix build w/ mbedtls v3.6

Since the mbedtls bump to v3.6 [1] the libiec61850 package is failling
on the autobuilder with the following error:

```
[  2%] Building C object hal/CMakeFiles/hal.dir/tls/mbedtls/tls_mbedtls.c.o
/workdir/instance-0/output-1/build/libiec61850-1.6.0/hal/tls/mbedtls/tls_mbedtls.c: In function 'compareCertificates':
/workdir/instance-0/output-1/build/libiec61850-1.6.0/hal/tls/mbedtls/tls_mbedtls.c:122:17: error: 'mbedtls_x509_crt' has no member named 'sig'
  122 |         if (crt1->sig.len == crt2->sig.len)
      |                 ^~
/workdir/instance-0/output-1/build/libiec61850-1.6.0/hal/tls/mbedtls/tls_mbedtls.c:122:34: error: 'mbedtls_x509_crt' has no member named 'sig'
  122 |         if (crt1->sig.len == crt2->sig.len)
      |                                  ^~
...
```

The logic to support mbedtls v3 is already present on the version
present in buildroot.
This patch ensures that the CMake build uses the mbedtls headers and
libraries provided by buildroot rather than the bundled copy.

By setting the following variable the mbedtls v3.6 is correctly found
during the configuration of the package.

```
Found mbedtls 3.6 -> can compile HAL with TLS 1.3 support
```

[1] 3481a9643f package/mbedtls: bump to version 3.6.3.1

Fixes: https://autobuild.buildroot.org/results/5fc/5fca384510d2fb9dd1d01736dee34b53339d62ff/build-end.log
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
Signed-off-by: Julien Olivain <ju.o@free.fr>
(cherry picked from commit 30fc97c2c52064fa29ddd811959e630c9c655a92)
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Thomas Perale 4 weeks ago
parent
commit
2ee70bd451
1 changed files with 3 additions and 0 deletions
  1. 3 0
      package/libiec61850/libiec61850.mk

+ 3 - 0
package/libiec61850/libiec61850.mk

@@ -15,6 +15,9 @@ LIBIEC61850_CONF_OPTS = -DBUILD_PYTHON_BINDINGS=OFF
 ifeq ($(BR2_PACKAGE_MBEDTLS),y)
 LIBIEC61850_DEPENDENCIES += mbedtls
 LIBIEC61850_CONF_OPTS += -DCONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB=ON
+LIBIEC61850_CONF_OPTS += \
+	-DCONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH=$(STAGING_DIR)/usr/lib \
+	-DCONFIG_EXTERNAL_MBEDTLS_INCLUDE_PATH=$(STAGING_DIR)/usr/include
 else
 LIBIEC61850_CONF_OPTS += -DCONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB=OFF
 endif