Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 560726 - games-strategy/s25rttr-0.8.1 fails to build with musl amd64 - /var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/Debug.h:31:23: fatal error: execinfo.h: No such file or directory
Summary: games-strategy/s25rttr-0.8.1 fails to build with musl amd64 - /var/tmp/portag...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on: 553746
Blocks:
  Show dependency tree
 
Reported: 2015-09-17 19:56 UTC by tt_1
Modified: 2015-09-20 06:27 UTC (History)
1 user (show)

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


Attachments
build log of s25rttr (s25rttr-build.log,569.28 KB, text/plain)
2015-09-17 19:56 UTC, tt_1
Details
emerge.info (emerge.info.log,4.81 KB, text/plain)
2015-09-17 19:57 UTC, tt_1
Details
patch to make it compile (s25rttr-0.8.1-musl-execinfo.patch,764 bytes, patch)
2015-09-19 09:38 UTC, tt_1
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tt_1 2015-09-17 19:56:54 UTC
Created attachment 412122 [details]
build log of s25rttr

[0mcd /var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1_build/src && /usr/bin/x86_64-gentoo-linux-musl-g++    -march=core2 -O2 -pipe -fomit-frame-pointer -fPIC  -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1_build -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/.. -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/../liblobby/src -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/../libutil/src -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/../mygettext/src -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/../libsiedler2/src -I/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/../libendian/src    -Wall -pedantic -fno-strict-aliasing -o CMakeFiles/s25client.dir/GameServer.cpp.o -c /var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/GameServer.cpp
In file included from /var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/GameServer.cpp:46:0:
/var/tmp/portage/games-strategy/s25rttr-0.8.1-r99/work/s25rttr-0.8.1/src/Debug.h:31:23: fatal error: execinfo.h: No such file or directory
 # include <execinfo.h>
                       ^
compilation terminated.
src/CMakeFiles/s25client.dir/build.make:3022: recipe for target 'src/CMakeFiles/s25client.dir/GameServer.cpp.o' failed

##############

It seems as if the GameServer.cpp needs Debug.h which needs <execinfo.h>  
Unfortunatly it is not working to simply delete that line. 

the complete build.log is attached.
Comment 1 tt_1 2015-09-17 19:57:42 UTC
Created attachment 412124 [details]
emerge.info
Comment 2 Felix Janda 2015-09-17 22:17:16 UTC
musl does not have the backtrace functionality from <execinfo.h>. So we
will need to stub out that functionality to make it compile.

After removing the include, is it enough to replace
"backtrace(stacktrace, maxTrace)" by "0" in order to make it compile (or
at least to get to a different compile failure)?
Comment 3 tt_1 2015-09-19 09:38:42 UTC
Created attachment 412258 [details, diff]
patch to make it compile

Thank you for the information. I found the odd part in Debug.h, changed it as suggested, and it compiles fine. 

The only problem now is the localisation, which is falling back to english for no obvious reason. I guess I should ask upstream for help in this case?
Comment 4 Felix Janda 2015-09-20 05:22:29 UTC
I have some suspicion about what the problem might be. rttr uses its
own gettext library[1], whose implementation for some strange reason
tries by default to convert all strings to ISO-8859-1 using iconv().
This does not work with musl because musl's iconv() can only convert
to UTF-8.

[1]: https://github.com/Return-To-The-Roots/mygettext
Comment 5 tt_1 2015-09-20 06:27:21 UTC
there seems to be a references to ISO-8859-1 in mygettext/src/gettext.cpp 

so, what can be done to fix this? obviously the solution must be a bit more complicated than simply to edit these few lines?