Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949701 - dev-games/godot-4.3-r1 error during compilation with mbedtls
Summary: dev-games/godot-4.3-r1 error during compilation with mbedtls
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-13 12:32 UTC by rick
Modified: 2025-02-13 13:48 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Godot Patch (godot.patch,220 bytes, patch)
2025-02-13 12:34 UTC, rick
Details | Diff
build log (build.log.tar.gz2,61.98 KB, application/gzip)
2025-02-13 12:35 UTC, rick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rick 2025-02-13 12:32:39 UTC
When I try to install Godot 4.3, I got an error with mbedtls. It comes from functions which don't exist in the library. After some investigations, I see that the functions have been added en mbedtls 3.4 where Godot needs 2.28. However, when I use the last version of the library, it's not compatible.
The solution I've found is to used the embed mbedtls of Godot. You can find in the attachment a patch and the logs of my errors.
Comment 1 rick 2025-02-13 12:34:09 UTC
Created attachment 918889 [details, diff]
Godot Patch
Comment 2 rick 2025-02-13 12:35:02 UTC
Created attachment 918890 [details]
build log
Comment 3 Ionen Wolkens gentoo-dev 2025-02-13 13:02:39 UTC
Can't reproduce and it builds fine with mbedtls:0 for me.

You wouldn't happen to have mbedtls installed somewhere else like /usr/local? Gives me the impression that it used headers from mbedtls:3 then linked with mbedtls:0 (which lacks the functions from the headers), this shouldn't happen with our slotted mbedtls:3 due to the namespacing but it could it was installed by some other mean.
Comment 4 Ionen Wolkens gentoo-dev 2025-02-13 13:08:32 UTC
The code that use this function looks like that, and the condition would only be true if it used mbedtls-3 headers:

#if MBEDTLS_VERSION_MAJOR >= 3
        mbedtls_x509write_crt_set_serial_raw(&crt, rand_serial, sizeof(rand_serial));
#else
        mbedtls_mpi serial;
        mbedtls_mpi_init(&serial);
        ERR_FAIL_COND_V(mbedtls_mpi_read_binary(&serial, rand_serial, sizeof(rand_serial)), nullptr);
        mbedtls_x509write_crt_set_serial(&crt, &serial);
#endif
Comment 5 rick 2025-02-13 13:48:16 UTC
Very strange, my mbedtls is installed in /usr/lib64. I don't have mbedtls:3 installed when I tried to compile Godot, only mbedtls:0. I'll try to dig deeper on this topic, but as it's triggered after 30 minutes, it's hard to test it.