Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StackTraceUnix: Add support for arm arch #1247

Open
akien-mga opened this issue Jul 30, 2016 · 3 comments
Open

StackTraceUnix: Add support for arm arch #1247

akien-mga opened this issue Jul 30, 2016 · 3 comments
Assignees
Milestone

Comments

@akien-mga
Copy link
Member

I was positively surprised to see that OD builds almost properly on armv5tl on Mageia; however it fails right at the end when building StackTraceUnix:

[ 99%] Building CXX object CMakeFiles/opendungeons.dir/source/utils/StackTraceUnix.cpp.o
/usr/bin/c++   -DOD_DATA_PATH=\"/usr/share/games/opendungeons\" -DOD_PLUGINS_CFG_PATH=\"/etc/opendungeons\" -DOD_VERSION=\"0.7.0\" -I/home/iurt/rpmbuild/BUILD/opendungeons-0.7.0/source -isystem /usr/include/cegui-0 -isystem /usr/include/OGRE -isystem /usr/include/OIS  -std=c++11  -Wall -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wswitch-default -Wstrict-null-sentinel -Winvalid-pch -Wswitch-default -Wstack-protector -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -march=armv5t  -DNDEBUG   -Werror -o CMakeFiles/opendungeons.dir/source/utils/StackTraceUnix.cpp.o -c /home/iurt/rpmbuild/BUILD/opendungeons-0.7.0/source/utils/StackTraceUnix.cpp
/home/iurt/rpmbuild/BUILD/opendungeons-0.7.0/source/utils/StackTraceUnix.cpp:112:2: error: #error Unsupported architecture.
 #error Unsupported architecture. // TODO: Add support for other arch.
  ^
/home/iurt/rpmbuild/BUILD/opendungeons-0.7.0/source/utils/StackTraceUnix.cpp: In static member function 'static void StackTracePrintPrivateData::critErrHandler(int, siginfo_t*, void*)':
/home/iurt/rpmbuild/BUILD/opendungeons-0.7.0/source/utils/StackTraceUnix.cpp:105:21: error: unused variable 'uc' [-Werror=unused-variable]
     sig_ucontext_t* uc = static_cast<sig_ucontext_t*>(ucontext);
                     ^

So, opening an issue for this TODO. It would be nice to have support for those arches if it only implies to finding the proper function call in https://github.com/OpenDungeons/OpenDungeons/blob/0.7.0/source/utils/StackTraceUnix.cpp#L107-L113

@akien-mga akien-mga added this to the 0.8.0 milestone Jul 30, 2016
@akien-mga
Copy link
Member Author

A few lines above we have:

// Prevent running a function that isn't supported on certain platforms.
#if not defined (__i386__) & not defined (__x86_64__)
    std::cout << "No error handler supported for this platform" << std::endl;
    return;
#endif

So I guess it's wrong to make the lack of support for non-x86 platforms a blocking #error.

@akien-mga
Copy link
Member Author

I fixed the arm builds on Mageia with this patch: http://svnweb.mageia.org/packages/cauldron/opendungeons/current/SOURCES/0001-Fix-compilation-of-StackTraceUnix-on-non-x86-platfor.patch?view=markup
It's a bit hackish though, but if it's fine with you as a quick solution I can make a PR :)

@hwoarangmy
Copy link
Contributor

Well, I wouldn't be against removing all the flags for platforms that can be removed (beware of the pointer size). After all, if it is an Unix system, it should work. And it might work for untested platforms (like in this case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants