[155/310] /usr/bin/x86_64-pc-linux-gnu-gcc -DCRYPTO -DHAVE_OBSCONFIG_H -DUSE_MBEDTLS -DUSE_XDG -Dobs_outputs_EXPORTS -Iplugins/obs-outputs/config -I/var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/libobs -Iconfig -DNDEBUG -Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declaration -Wno-missing-braces -Wno-missing-field-initializers -O2 -march=x86-64 -pipe -fomit-frame-pointer -g -ggdb -std=gnu99 -fno-strict-aliasing -fPIC -mmmx -msse -msse2 -pthread -fvisibility=hidden -MD -MT plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o -MF plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o.d -o plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o -c /var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/plugins/obs-outputs/librtmp/amf.c FAILED: plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o /usr/bin/x86_64-pc-linux-gnu-gcc -DCRYPTO -DHAVE_OBSCONFIG_H -DUSE_MBEDTLS -DUSE_XDG -Dobs_outputs_EXPORTS -Iplugins/obs-outputs/config -I/var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/libobs -Iconfig -DNDEBUG -Wall -Wextra -Wvla -Wno-unused-function -Werror-implicit-function-declaration -Wno-missing-braces -Wno-missing-field-initializers -O2 -march=x86-64 -pipe -fomit-frame-pointer -g -ggdb -std=gnu99 -fno-strict-aliasing -fPIC -mmmx -msse -msse2 -pthread -fvisibility=hidden -MD -MT plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o -MF plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o.d -o plugins/obs-outputs/CMakeFiles/obs-outputs.dir/librtmp/amf.c.o -c /var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/plugins/obs-outputs/librtmp/amf.c In file included from /var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/plugins/obs-outputs/librtmp/amf.c:26: /var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/plugins/obs-outputs/librtmp/rtmp_sys.h:110:5: error: unknown type name ‘mbedtls_x509_crt’ 110 | mbedtls_x509_crt *cacert; | ^~~~~~~~~~~~~~~~ /var/tmp/portage/media-video/obs-studio-24.0.3/work/obs-studio-24.0.3/plugins/obs-outputs/librtmp/rtmp_sys.h:119:3: error: unknown type name ‘mbedtls_x509_crt’ 119 | mbedtls_x509_crt cert; | ^~~~~~~~~~~~~~~~ Reproducible: Always
Created attachment 600014 [details] build.log.gz
Same error here. This happens after today net-libs/mbedtls update to 2.19.1 With =net-libs/mbedtls-2.17.0 it compiles very well.
Same error happens when compiling with mbedtls-2.18.1.
*** Bug 703426 has been marked as a duplicate of this bug. ***
Seems like an upstream Cmake problem in >=mbedtls-2.18.1 in installation step See also: https://github.com/ARMmbed/mbedtls/issues/2965
This seems to be an issue transcending media-video/obs-studio (which makes sense taking a look at how the CMake installation of mbedtls is handling things). I'm also having issues with games-emulation/dolphin-9999 (as of today at least). I tried editing out the lines in "crypto/include/CMakeLists.txt" which control what gets installed from crypto. Specifically, I commented out the lines: install(FILES ${headers} DESTINATION include/mbedtls PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) The top-most Makefile doesn't install these include files, as far as I can understand it. The problem with this approach is that because it doesn't seem to install everything under "crypto/include", games-emulation/dolphin-9999 was failing due to the header "mbedtls/aes.h" missing (as it only seems to be a part of the "crypto" submodule). I expect the regular Makefile compilation and installation yields the same problem, although I did not try it (I see no reference of the "crypto/include" directory being installed, other than the "crypto/include/psa" one). As a second experiment, I modified the order of some lines the top-most CMakeLists.txt, changing: add_subdirectory(library) add_subdirectory(include) add_subdirectory(crypto/library) add_subdirectory(crypto/include) to add_subdirectory(library) add_subdirectory(crypto/library) add_subdirectory(crypto/include) add_subdirectory(include) This order forces the real "config.h" to be written out and overwrite the example one included in the "crypto" submodule. With this second change, I can confirm I'm able to build games-emulation/dolphin-9999. As I don't use obs-studio I can't confirm the fix with it, although I expect it to work. Upstream needs to fix their build system.
I can confirm, obs-studio compiles after applying the changes mentioned by Gabriel Marcano Dirty workaround to install mbedtls and obs-studio: (1) cd /usr/portage/net-libs/mbedtls (2) ebuild mbedtls-2.19.1.ebuild compile --- changes in CMakeLists.txt --- (3) vi +198 $( emerge --info | grep PORTAGE_TMPDIR | cut -d\" -f2)/portage/net-libs/mbedtls-2.19.1/work/mbedtls-mbedtls-2.19.1/CMakeLists.txt --- change add_subdirectory(library) add_subdirectory(include) add_subdirectory(crypto/library) add_subdirectory(crypto/include) to add_subdirectory(library) add_subdirectory(crypto/library) add_subdirectory(crypto/include) add_subdirectory(include) ---- (4) ebuild mbedtls-2.19.1.ebuild install (5) ebuild mbedtls-2.19.1.ebuild qmerge (6) emerge obs-studio (optional !!!USE AT YOUR OWN RISK!!! cleanup of the temporary mbedtls folder) rm -Rf $( emerge --info | grep PORTAGE_TMPDIR | cut -d\" -f2)/portage/net-libs/mbedtls-2.19.1/ Afterwards obs-studio should be successfully installed. Thanks to Gabriel for his work!
Someone (Ionic) upstream posted a better patch upstream than my hack, which should do something similar to what my crappy one did. We need input from upstream before we really know what the real fix ought to be. At the very least I'm not sure which include files should be installed, as the upstream build systems contradict each other. To keep backwards compatibility it looks like both the Makefile and the CMake need to be tweaked (Makefile doesn't install crypto headers, CMake thrashes config.h at minimum).
Created attachment 600572 [details, diff] Temporal patch to make this work Hi, What mentioned works successful as workaround. Providing a patch just in case would be useful of anyone else. As also mentioned, shouldn't intended as final solution, as a project bug.
Attached patch worked for me, thanks!
how do you apply this patch? Saving it in /etc/portage/patches/media-video/obs-studio/ results in a failed patch.
(In reply to N. Andrew Walsh from comment #11) > how do you apply this patch? Saving it in > /etc/portage/patches/media-video/obs-studio/ results in a failed patch. The patch is for net-libs/mbedtls. You'll need to create it for that (eg /etc/portage/patches/net-libs/mbedtls/fix-mbedtls.patch), emerge net-libs/mbedtls , then emerge obs-studio. I just successfully applied this patch to fix building dolphin.
(In reply to Pablo Cholaky from comment #9) > Created attachment 600572 [details, diff] [details, diff] > Temporal patch to make this work > > Hi, > > What mentioned works successful as workaround. > > Providing a patch just in case would be useful of anyone else. > > As also mentioned, shouldn't intended as final solution, as a project bug. I'm waiting for a fix to land upstream. For now 2.18.1 and 2.18.2 are masked.
The mask was undone, breaking obs-studio again. commit 157af36452b697e9d483f578bde415a4d07c9a7e Author: Anthony G. Basile <blueness@gentoo.org> Date: Tue Jan 21 16:49:10 2020 -0500 package.mask: remove masks on net-libs/mbedtls, bug #705038 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Upstream committed a fix and Gentoo pulled it in as a patch, but the fix is *backwards*. It removes the *main* config.h header, not the *crypto* one, so it makes the problem worse. Now you need to undo the broken patch *and* use this upstream patch (from the bug, not the commit), which works: https://github.com/ARMmbed/mbedtls/issues/2965#issuecomment-568306592
Just realized what happened. Upstream *correctly* committed the fix to the mbed-crypto subproject, and Gentoo pulled it and applied it to *mbed* without adding /crypto/ to the path. The patch applies cleanly to the parent CMakeLists too... and thus silently makes things worse instead of helping. The header of the .patch file needs to be changed to add /crypto/ to the path, then it works: diff --git a/crypto/include/CMakeLists.txt b/crypto/include/CMakeLists.txt index 02f924df4..92229a221 100644 --- a/crypto/include/CMakeLists.txt +++ b/crypto/include/CMakeLists.txt
I may be a little blind, but I still don't see the upstream commit (I only see the proposed fix in Ionic's fork).
Hey, isn't there a patch that works so far?
(In reply to Juan Pedro from comment #18) > Hey, isn't there a patch that works so far? You may either use 'net-libs/mbedtls-2.17.0' or lower, or try to replace the patch for the newer version(s) as mentioned by the earlier comments here.
Yes, the ARM upstream doesn't have the fix yet, only Ionic's fork does. But either way, that patch is what made it into portage, except it's getting applied to the wrong file. Right now, net-libs/mbedtls/files/mbedtls-dont-overwrite-headers.patch just needs to have /crypto/ added to the file paths (and the ebuild revbumped to get people to rebuild it).
Ah, I see that happened already. This should be fixed then, except people need to manually rebuild mbedtls. https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bdff0e5ea288b745e38ef08914fe141a127902c
Seems to be working with '2.19.1-r2' now. Thanks!