compile error with master HEAD

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
Fleance
Posts: 2
Joined: September 24th, 2020, 5:35 pm

compile error with master HEAD

Post by Fleance »

Hello everone, I just wanted to build a debug version from master:
git clone "https://github.com/wesnoth/wesnoth.git" wesnoth
cd wesnoth
mkdir build && cd build
cmake .. -DCMAKE_BUILD=Debug -DCMAKE_INSTALL_PREFIX=/home/chris/project/usr
make
And got this error:
In file included from <command-line>:
/usr/include/stdc-predef.h: In substitution of 'template<class _Functor, class, class> std::function<std::__cxx11::basic_string<char>(gui2::slider&)>::function(_Functor) [with _Functor = <missing>; <template-parameter-1-2> = <missing>; <template-parameter-1-3> = <missing>]':
/home/chris/project/wesnoth/src/gui/dialogs/editor/generator_settings.cpp:60:52: required from here
/usr/include/stdc-predef.h:32:72: internal compiler error: Segmentation fault
32 | whether the overall intent is to support these features; otherwise,
| ^
0x7f97a9c06d5f ???
./signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0
0x7f97a9bf1d09 __libc_start_main
../csu/libc-start.c:308
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
make[2]: *** [src/CMakeFiles/wesnoth-client.dir/build.make:2487: src/CMakeFiles/wesnoth-client.dir/gui/dialogs/editor/generator_settings.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:496: src/CMakeFiles/wesnoth-client.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
I build it on Debian testing/sid with the following libraries:
libboost-*-dev 1.74.0.3
libsdl2-dev 2.0.14+dfsg2-3
libsdl2-image-dev 2.0.5+dfsg1-2
libsdl2-mixer-dev 2.0.4+dfsg1-3
libsdl2-ttf-dev 2.0.15+dfsg1-1
libfontconfig-dev 2.13.1-4.2
libcairomm-1.0-dev 1.12.2-4
libpango1.0-dev 1.46.2-3
libvorbis-dev 1.3.7-1
libz3-dev 4.8.10-1
libssl-dev 1.1.1i-3

tools:
g++ 10.2.1-1
cmake 3.18.4
GNU Make 4.3

Did I missed something? Probably not a usual compiler error, but the compiler crashed for some segmentation fault reason?

Thank you in advance

/Fleance
User avatar
octalot
Developer
Posts: 541
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: compile error with master HEAD

Post by octalot »

It's a bug in GCC, for which the fix has been added to Debian's Experimental distro but not yet to their Testing or Unstable distros. Personally, I've downgraded to the 10.2.1-3 versions of the compiler packages.

https://bugs.debian.org/cgi-bin/bugrepo ... bug=980429
gnombat
Posts: 330
Joined: June 10th, 2010, 8:49 pm

Re: compile error with master HEAD

Post by gnombat »

You could try compiling with -DCMAKE_CXX_COMPILER=clang and see if that works.

On an unrelated note, shouldn't -DCMAKE_BUILD=Debug be -DCMAKE_BUILD_TYPE=Debug?
User avatar
egallager
Posts: 78
Joined: November 19th, 2020, 7:27 pm
Location: Concord, New Hampshire
Contact:

Re: compile error with master HEAD

Post by egallager »

octalot wrote: February 20th, 2021, 11:47 pm It's a bug in GCC, for which the fix has been added to Debian's Experimental distro but not yet to their Testing or Unstable distros. Personally, I've downgraded to the 10.2.1-3 versions of the compiler packages.

https://bugs.debian.org/cgi-bin/bugrepo ... bug=980429
Has the bug been reported to upstream GCC's bugzilla as well?
Wesnoth-related GitHub repos:
General mods collection, SotBEEE, AToTBWaTD, The Earth's Gut, A Little Adventure
Social media: Twitter: @cooljeanius, Steam: egallager, LinkedIn: Eric Gallager
gnombat
Posts: 330
Joined: June 10th, 2010, 8:49 pm

Re: compile error with master HEAD

Post by gnombat »

egallager wrote: February 22nd, 2021, 12:17 am Has the bug been reported to upstream GCC's bugzilla as well?
It appears to be fixed already upstream.
Fleance
Posts: 2
Joined: September 24th, 2020, 5:35 pm

Re: compile error with master HEAD

Post by Fleance »

gnombat wrote: February 21st, 2021, 5:27 am You could try compiling with -DCMAKE_CXX_COMPILER=clang and see if that works.

Indeed, this works for me now, using llvm instead gcc.

On an unrelated note, shouldn't -DCMAKE_BUILD=Debug be -DCMAKE_BUILD_TYPE=Debug?
Opps, didn't saw that. But it was accepted anyway. And g++ build the whole project without crashing one time with this option. I guess this is just coincidental.
User avatar
Iris
Site Administrator
Posts: 6744
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: compile error with master HEAD

Post by Iris »

Fleance wrote: February 22nd, 2021, 11:54 am Opps, didn't saw that. But it was accepted anyway. And g++ build the whole project without crashing one time with this option. I guess this is just coincidental.
It is, very much so. I normally need to run scons about 4 times before the problematic files will be compiled successfully, but sometimes it's more, less, or far more rarely gcc decides not to crash on the first attempt. It's really confusing to see the fix in an upload to experimental instead of sid but I guess the Debian devs know what they are doing.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm (now available for Wesnoth 1.14.x and 1.15.4+).
Post Reply