Kodi 19 & c++14/c++17
#1
Hi,

I am trying to build Kodi 19 master branch as of
https://github.com/xbmc/xbmc/commit/dd1e...8c359b55aa with gcc-4.9.1.

This fails
Quote:output/host/opt/ext-toolchain/aarch64-amd-linux-gnu/include/c++/4.9.1/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<std::basic_string<char>, ADDON::SExtValue>; _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >}; _Tp = std::pair<std::basic_string<char>, ADDON::SExtValue>]':
...
output/build/kodi-efa9ec691491ea3311f8de36b16b665f188afef4/xbmc/addons/AddonDatabase.cpp:172:90:   required from here
output/host/opt/ext-toolchain/aarch64-amd-linux-gnu/include/c++/4.9.1/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<std::basic_string<char>, ADDON::SExtValue>::pair(std::basic_string<char>, std::basic_string<char>)'
added with commit https://github.com/xbmc/xbmc/commit/fdc2...4f1f94R171

Afaics c++14/gcc 4.9 is still the supported version
https://github.com/xbmc/xbmc/commit/642d...5cdecda46b
but only until binary addons are fixed which got broken by switching to c++17
https://github.com/xbmc/xbmc/commit/0984...43b1b9044d

The std::pair build error seems to be rooted in the fact that gcc-4.9 does not
support this code: https://stackoverflow.com/a/47284746

Is there a way to simplify the code that older gcc versions can still be supported
or is the project determined to drop support for gcc < 7.x in Kodi core?
Kodi 19.5-Matrix/OpenGLES/gbm (+ PR19558 ) - Linux kernel 5.14.21 x86_64 - ffmpeg 4.4-git (+ patch )
Mesa 22.3.7 with iris driver - VA-API version 1.16.0 + Intel iHD driver version 22.6.3 - libdrm 2.4.116 - libcec 6.0.2
Intel i9-11900T - ASRock Z590 Extreme - BIOS version 2.20
Reply
#2
You need full C++14 support: gcc >= 5
Reply
#3
(2020-10-31, 23:29)wsnipex Wrote: You need full C++14 support: gcc >= 5
Later I tried with gcc 5.3, same error.
With gcc-6.3.0 kodi compiles while pvr.hts (PS: pvr.vdr.vnsi also affected) does not build with it
 
Code:
kodi-pvr-hts-8.0.0-Matrix/lib/kissnet/kissnet.hpp:416:28: error: ‘byte’ is not a member of ‘std’
  using buffer = std::array<std::byte, buff_size>;
due to c++17 code: https://stackoverflow.com/questions/5684...2_56843413

Please do not consider this thread a complaint, I just would like to understand the minimum
requirements for kodi19 so I can adjust the buildroot packages I am preparing right now.
But of course, the lower the gcc version needed the more embedded platforms can still
make use of Kodi Wink
Kodi 19.5-Matrix/OpenGLES/gbm (+ PR19558 ) - Linux kernel 5.14.21 x86_64 - ffmpeg 4.4-git (+ patch )
Mesa 22.3.7 with iris driver - VA-API version 1.16.0 + Intel iHD driver version 22.6.3 - libdrm 2.4.116 - libcec 6.0.2
Intel i9-11900T - ASRock Z590 Extreme - BIOS version 2.20
Reply
#4
Many PVR addons went to c++17 with the removal of the p8 platform.  I am not sure Kodi has the same requirement.

Martin
Reply
#5
We don't as of right now on master, but I believe the intention right now will be to go back to 17 as soon as we branch off matrix for release
Reply
#6
(2020-10-31, 19:30)bkuhls Wrote: Hi,

I am trying to build Kodi 19 master branch as of
https://github.com/xbmc/xbmc/commit/dd1e...8c359b55aa with gcc-4.9.1.

This fails
Quote:output/host/opt/ext-toolchain/aarch64-amd-linux-gnu/include/c++/4.9.1/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::pair<std::basic_string<char>, ADDON::SExtValue>; _Args = {std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >}; _Tp = std::pair<std::basic_string<char>, ADDON::SExtValue>]':
...
output/build/kodi-efa9ec691491ea3311f8de36b16b665f188afef4/xbmc/addons/AddonDatabase.cpp:172:90:   required from here
output/host/opt/ext-toolchain/aarch64-amd-linux-gnu/include/c++/4.9.1/ext/new_allocator.h:120:4: error: no matching function for call to 'std::pair<std::basic_string<char>, ADDON::SExtValue>::pair(std::basic_string<char>, std::basic_string<char>)'
added with commit https://github.com/xbmc/xbmc/commit/fdc2...4f1f94R171

Afaics c++14/gcc 4.9 is still the supported version
https://github.com/xbmc/xbmc/commit/642d...5cdecda46b
but only until binary addons are fixed which got broken by switching to c++17
https://github.com/xbmc/xbmc/commit/0984...43b1b9044d

The std::pair build error seems to be rooted in the fact that gcc-4.9 does not
support this code: https://stackoverflow.com/a/47284746

Is there a way to simplify the code that older gcc versions can still be supported
or is the project determined to drop support for gcc < 7.x in Kodi core?
This should work:
- extValues.emplace_back((*content)["key"].asString(), (*content)["value"].asString());
+ extValues.emplace_back((*content)["key"].asString(), SExtValue{(*content)["value"].asString()});
Reply
#7
(2020-12-09, 04:11)yasij Wrote: This should work:
- extValues.emplace_back((*content)["key"].asString(), (*content)["value"].asString());
+ extValues.emplace_back((*content)["key"].asString(), SExtValue{(*content)["value"].asString()});
This fixed the compile problem, thanks! But I need to do more steps before I can runtime-test your fix.
Kodi 19.5-Matrix/OpenGLES/gbm (+ PR19558 ) - Linux kernel 5.14.21 x86_64 - ffmpeg 4.4-git (+ patch )
Mesa 22.3.7 with iris driver - VA-API version 1.16.0 + Intel iHD driver version 22.6.3 - libdrm 2.4.116 - libcec 6.0.2
Intel i9-11900T - ASRock Z590 Extreme - BIOS version 2.20
Reply
#8
(2020-12-09, 04:11)yasij Wrote: This should work:
- extValues.emplace_back((*content)["key"].asString(), (*content)["value"].asString());
+ extValues.emplace_back((*content)["key"].asString(), SExtValue{(*content)["value"].asString()});
Hi,

thanks again, a runtime-test was positive, I just sent your patch upstream:
https://github.com/xbmc/xbmc/pull/18932

Also I was able to get pvr.hts working again with gcc-4.9 by reverting the
TCP socket patches: https://github.com/bkuhls/buildroot/comm...14fe418b42
I know this will never be committed upstream but as long as this works
I will keep these patches in my private repo, so this is just FYI Wink
Kodi 19.5-Matrix/OpenGLES/gbm (+ PR19558 ) - Linux kernel 5.14.21 x86_64 - ffmpeg 4.4-git (+ patch )
Mesa 22.3.7 with iris driver - VA-API version 1.16.0 + Intel iHD driver version 22.6.3 - libdrm 2.4.116 - libcec 6.0.2
Intel i9-11900T - ASRock Z590 Extreme - BIOS version 2.20
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi 19 & c++14/c++170