Home Page
Posted By: fulivi Compilation failure - 06/05/22 04:48 PM
Hi,

I'm trying to compile 62c35fe3cec from GH but I get this error:
Quote
GCC 10 detected
Compiling src/frontend/mame/luaengine_debug.cpp...
In file included from ../../../../../src/frontend/mame/luaengine.h:29,
from ../../../../../src/frontend/mame/luaengine.ipp:13,
from ../../../../../src/frontend/mame/luaengine_debug.cpp:12:
../../../../../3rdparty/sol2/sol/sol.hpp: In static member function 'static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = long unsigned int; _Functor = lua_engine::symbol_table_wrapper::add(const char*, sol::protected_function, std::optional<sol::basic_protected_function<sol::basic_reference<false>, false, sol::basic_reference<false> > >, std::optional<const char*>)::<lambda()>; _ArgTypes = {}]':
../../../../../3rdparty/sol2/sol/sol.hpp:15823:17: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized]
15823 | return UT();
| ^
../../../../../3rdparty/sol2/sol/sol.hpp: In static member function 'static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = long unsigned int; _Functor = lua_engine::initialize_debug(sol::table&)::<lambda(lua_engine::symbol_table_wrapper&, sol::this_state, const char*, int, int, sol::protected_function)>::<lambda(int, const u64*)>; _ArgTypes = {int, const long unsigned int*}]':
../../../../../3rdparty/sol2/sol/sol.hpp:15823:17: error: '<anonymous>' may be used uninitialized in this function [-Werror=maybe-uninitialized]
15823 | return UT();
| ^
cc1plus: all warnings being treated as errors
make[2]: *** [frontend.make:754: ../../../../linux_gcc/obj/x64/Release/src/frontend/mame/luaengine_debug.o] Error 1
make[2]: Target 'all' not remade because of errors.
make[1]: *** [Makefile:100: frontend] Error 2
make[1]: Target 'all' not remade because of errors.
make: *** [makefile:1280: linux_x64] Error 2
make: Target 'all' not remade because of errors.

Any idea?
I've added a few changes of mine to 62c35fe3cec commit but they aren't even remotely near Lua machinery.
Thanks.
--F.Ulivi
Posted By: Vas Crabb Re: Compilation failure - 06/05/22 05:05 PM
What exact compiler and C++ standard library version are you using? I’ve seen that error with older versions of GCC, and we get around it by adding "-flifetime-dse=1" to the compile options for GCC 9 and earlier. Are you using GCC 10 with GNU libstdc++ 9 or earlier or something?
Posted By: Vas Crabb Re: Compilation failure - 06/05/22 05:06 PM
Also, see here: https://github.com/mamedev/mame/issues/9818
Posted By: fulivi Re: Compilation failure - 06/05/22 05:27 PM
Yes, my compiler version is exactly the one described in issue 9818 (i.e. 10.2.1 as distributed in stock Debian 11).
Anyway, the -Wno-error=maybe-uninitialized flag fixes compilation for now, I think I can settle with this.
Thanks.
--F.Ulivi
Posted By: Vas Crabb Re: Compilation failure - 06/05/22 05:32 PM
You haven’t answered the other half of the question – what version of GNU libstdc++ are you compiling against (assuming you’re using GNU libstdc++ and not some other C++ standard library)?
Posted By: fulivi Re: Compilation failure - 06/05/22 05:39 PM
Assuming I'm reading the right thing I see the package version as follows:
Quote
libstdc++6:amd64 10.2.1-6 amd64 GNU Standard C++ Library v3
Posted By: Vas Crabb Re: Compilation failure - 06/05/22 05:46 PM
OK, it seems that the error actually happens with GCC or GNU libstdc++ all the way up to 10.2 but not from 10.3 onwards. Probably best to just put “-flifetime-dse=1” in your compile options for now.
Posted By: fulivi Re: Compilation failure - 06/05/22 05:47 PM
Thank you! I'll go for it then.
--F.Ulivi
© Forums