IRIX and Software

GemRB - Page 2

Yeah, my apologies for using the unmaintained autotools. The errors obtained from it seemed easier (to me at least.. and I am not at all a developer) than the ones I got from cmake.
Ah well, if you go that route, you'll have to fix the Makefiles first. What errors did you get the cmake way?
Procedure for not using cmake:
I ran autogen.sh.

The following are my 'hacks' to get this to compile. Very poorly done, and I make no assumptions as to these approaches being valid.

# GCC 4.7 build env
export CC=gcc
export CXX=g++
export CXXFLAGS="-O3 -mabi=n32 -I/usr/nekoware/include -I/usr/include"
export CPPFLAGS="-O3 -mabi=n32 -I/usr/nekoware/include -I/usr/include"
export PATH="/usr/nekoware/bin:$PATH"
export MANPATH="/usr/nekoware/man:$MANPATH"
export CFLAGS="-O3 -mabi=n32 -I/usr/nekoware/include -I/usr/include"
export LDFLAGS="-L/usr/nekoware/lib -L/usr/lib32"
export LD_LIBRARY_PATH="/usr/nekoware/lib:/usr/lib32"
export PATH=/usr/nekoware/gcc-4.7/bin:$PATH
export RANLIB=:

Run ./autogen.sh

###
ERROR: autogen.sh will complain that it cannot find Python.

EDIT: configure
#include <sys/time.h>
#include "Python.h"
line 17072 in configure
and 17109

autogen.sh will pass now.

###
ERROR: Warnings are Errors!

EDIT: configure
Remove -Werror

###
ERROR:
No rule to make target `Callback.cpp', needed by `Callback.lo'. Stop.

EDIT: gemrb/core/Makefile
Remove the 3 Callback.* references
# This could be bad!

###
ERROR:
FP_NAN errors

EDIT:
gemrb/includes/globals.h
gemrb/core/Resource.h
/* C99: 7.12 6 defines for floating point classification */
#define FP_ZERO 1
#define FP_SUBNORMAL 2
#define FP_NORMAL 4
#define FP_INFINITE 8
#define FP_NAN 16

###
ERROR:
No rule to make target `Font.cpp', needed by `Font.lo'. Stop.

COPY: GUI/TextSystem/* to gemrb/core/ seems to get passed this but unknown as to what is wrong. Could be bad!

###
ERROR:
GetBitContext.cpp:52:56: error: 'ldexpf' was not declared in this scope
GetBitContext.cpp: In member function 'int VLC::build_table(int, int, const void*, int, int, const void*, int, int, unsigned int, int, int)':

EDIT:
gemrb/plugins/Makefile
Remove BIKPlayer
Not necessary to be able to play movies.. gameplay is more important for now

###
ERROR:
error: 'strcasecmp' was not declared in this scope
NOTE: strcasecmp is not in the C or C++ standard, but its defined by POSIX.1-2001 and 4.4BSD.

EDIT:
gemrb/plugins/GUIScript/GUIScript.cpp
gemrb/core/Resource.h
/* IRIX */
#include <string.h>

###
ERROR:
/usr/include/sys/time.h: In function 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)':
/usr/include/sys/time.h:191:26: error: 'int select(int, fd_set*, fd_set*, fd_set*, timeval*)' was declared 'extern' and later 'static' [-fpermissive]
GOOGLE SEARCH:
sys/time.h is misbehaving when _XOPEN_SOURCE
is defined and _XOPEN_SOURCE IS defined in
pyconfig.h, which is included by Python.h,
an easy fix would be to include sys/time.h
BEFORE Python.h

EDIT:
plugins/GUIScript/PythonHelpers.cpp
plugins/GUIScript/GUIScript.cpp
#include <sys/time.h>
BEFORE Python.h .. I just placed at the top.

###
ERROR:
In file included from OpenALAudio.h:45:0,
from OpenALAudio.cpp:21:
/usr/nekoware/include/AL/alc.h:186:60: error: '<anonymous>' has incomplete type
/usr/nekoware/include/AL/alc.h:186:68: error: invalid use of 'ALCvoid {aka void}'

EDIT:
gemrb/plugins/Makefile
Just remove OpenAL Plugin from being built for now to see how far it compiles

###
ERROR:
Making all in pst
gmake[4]: Entering directory `/tmp/gemrb/gemrb/gemrb/override/pst'
gmake[4]: *** No rule to make target `*.bcs', needed by `all-am'. Stop.

EDIT:
/gemrb/override/pst/Makefile
Remove *.bcs from Makefile. 2 locations. Assumption is this could be negative on PlaneScape Torment (PST) but shouldnt affect other games.

###
Possible Error:
The configure generates HAVE_STRING_H and HAVE_STRINGS_H. That doesn't cause any problem except on SGI platforms.

EDIT:
config.h
- #define HAVE_STRINGS_H 1
+ /*#define HAVE_STRINGS_H 1*/

###
gmake
gmake install
With a custom cmake 2.8.6.. where cmake 2.8.6 itself compiled clean for me... it is not part of our official nekoware distribution which uses an older version.

Cmake looks good.. then ends up:
-- Configuring incomplete, errors occurred!

[octane]:/tmp/gemrb/gemrb/build $ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/nekoware/gcc-4.7/bin/gcc
-- Check for working C compiler: /usr/nekoware/gcc-4.7/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/nekoware/gcc-4.7/bin/g++
-- Check for working CXX compiler: /usr/nekoware/gcc-4.7/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected version: 0.8.4-git
-- Git version bool: 1
-- Performing Test VISIBILITY_HIDDEN
-- Performing Test VISIBILITY_HIDDEN - Failed
-- Performing Test STACK_PROTECTOR
-- Performing Test STACK_PROTECTOR - Success
-- Found PythonLibs: /usr/nekoware/lib/libpython2.7.so (Required is at least version "2.3")
-- Looking for Python libraries and headers: found
-- Autodetecting SDL backend...
-- Looking for include files CMAKE_HAVE_PTHREAD_H
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
-- Found SDL 1.2, switching to SDL backend.
CMake Error at CMakeLists.txt:241 (FIND_PACKAGE):
find_package called with invalid argument "MODULE"


-- Looking for SDL: found
-- Looking for libSDL: found
CMake Warning at CMakeLists.txt:282 (MESSAGE):
Looking for SDL_mixer: not found!


CMake Warning at CMakeLists.txt:283 (MESSAGE):
If you want to build the SDL_mixer plugin, install SDL_mixer first.


CMake Warning at CMakeLists.txt:284 (MESSAGE):
Make sure you use a version compatible with the chosen SDL version.


-- Found ZLIB: /usr/lib32/libz.so (found version "1.2.5")
-- Looking for Zlib: found
-- Found OpenAL: /usr/nekoware/lib/libopenal.so
-- Looking for OpenAL: found
CMake Error at CMakeLists.txt:352 (FIND_PACKAGE):
find_package called with invalid argument "MODULE"


CMake Warning at CMakeLists.txt:356 (MESSAGE):
Looking for VLC: not found!


CMake Warning at CMakeLists.txt:357 (MESSAGE):
If you want to build the VLC plugin, install VLC first.


-- Found Freetype: /usr/nekoware/lib/libfreetype.so
-- Looking for Freetype: found
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Performing Test ICONV_COMPILES
-- Performing Test ICONV_COMPILES - Success
-- Found ICONV: In glibc
-- One (and only one) of the ICONV_ACCEPTS_... tests must pass
-- Performing Test ICONV_ACCEPTS_NONCONST_INPUT
-- Performing Test ICONV_ACCEPTS_NONCONST_INPUT - Success
-- Performing Test ICONV_ACCEPTS_CONST_INPUT
-- Performing Test ICONV_ACCEPTS_CONST_INPUT - Failed
-- Found PNG: /usr/lib32/libpng.so
-- Looking for libPNG: found
-- Looking for Ogg Vorbis support: found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of int
-- Check size of int - done
-- Check size of long int
-- Check size of long int - done
-- Looking for strndup
-- Looking for strndup - not found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for setenv
-- Looking for setenv - not found
-- Looking for include files HAVE_UNISTD_H
-- Looking for include files HAVE_UNISTD_H - found
-- Looking for include files HAVE_MALLOC_H
-- Looking for include files HAVE_MALLOC_H - found
-- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST
-- Performing Test PERMITS_OBJECT_TO_FUNCTION_CAST - Failed
--
-- These are the configured paths:
-- PREFIX: /usr/local
-- LIB_DIR: /usr/local/lib/gemrb
-- PLUGIN_DIR: /usr/local/lib/gemrb/plugins
-- BIN_DIR: /usr/local/bin
-- DATA_DIR: /usr/local/share/gemrb
-- MAN_DIR: /usr/local/share/man/man6
-- SYSCONF_DIR: /usr/local/etc/gemrb
-- DOC_DIR: /usr/local/share/doc/gemrb
-- ICON_DIR: /usr/local/share/pixmaps
-- SVG_DIR: /usr/local/share/icons/hicolor/scalable/apps
-- MENU_DIR: /usr/local/share/applications
--
-- Options:
-- LAYOUT: fhs
-- NOCOLOR: disabled
-- STATIC_LINK: disabled
-- INSOURCEBUILD: disabled
-- DISABLE_WERROR: disabled
-- WIN32_USE_STDIO: disabled
-- SDL_BACKEND: SDL
-- OPENGL_BACKEND: None
--
-- Build type: RelWithDebInfo
--
-- Configuring incomplete, errors occurred!
[octane]:/tmp/gemrb/gemrb/build $ cmake --version
cmake version 2.8.6

However, I get no Makefile in the build dir.
I believe Dexter1 may have gotten farther down this path with cmake.
I took the one that looked easier with autogen ;)
I think I know the cmake problem — Travis CI or Appveyor hit something similar or identical. Checking ... yeah, odd cmake version, this was the fix:
sed -i 's,\(FIND_PACKAGE.*\) MODULE,\1,' CMakeLists.txt # just removing the MODULE parameter

since I guess your sed doesn't have -i, use redirection or edit the file manually (just three hits).

I'll go play with moved time.h and some of the rest.

oh, you can pass -DDISABLE_WERROR=1 to ...
does IRIX have stricmp instead of strcasecmp?

... yeah, cmake 2.8.8 introduced MODULE. If you refetch git HEAD (git pull), you should be able to run cmake without errors without mods.
Your sed command did it nicely!
<...>
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/gemrb/gemrb/build

Ill see how far this build goes now. (using cmake and gcc)
FYI, IRIX may be an old OS, but with our nekoware package distribution we still have relatively modern apps.. such as sed with -i. ;)
Thanks again for all your help, and being involved all this time trying to help!
man 3 strcasecmp
string(3C) string(3C)

NAME
string: strcat, strdup, strncat, strcmp, strncmp, strcpy, strncpy,
strlen, strchr, strrchr, strpbrk, strspn, strcspn, strtok, strstr
strcasecmp, strncasecmp, index, rindex, strtok_r - string operations

SYNOPSIS
#include <string.h>

I do not believe IRIX has stricmp.. however I will leave that answer to ones more knowledgeable. Googling seems to say IRIX does not and I couldn't find a manpage for it. Running a find/grep within /usr/include didn't find any stricmp either.
ok, so it's just a case of missing includes then.
So taking the same source package that I had the mods indicated earlier (mostly includes).. but of course all the 'Makefile' mods I made are irrelevant when using cmake now.

Your cmake fix:
sed -i 's,\(FIND_PACKAGE.*\) MODULE,\1,' CMakeLists.txt

Build:
cd build
cmake -DDISABLE_WERROR=1 ..

It goes to 72% to where it wants to compile BIKPlayer.
GetBitContext.cpp:52:56: error: 'ldexpf' was not declared in this scope
Rather than debug that.. I assume it could be skipped?
I created a stump BIKPlayer.cpp file that does nothing but had the main function BIKPlayer::BIKPlayer(void)
{ }; and the last few lines in the file (GEMRB_PLUGIN(), END_PLUGIN(),etc..
I edited BIKPlayer's CMakeLists.txt so it only uses BIKPlayer.cpp and no the other cpp files in that dir

The butchered code above does let it continue building.
Then it complained of OpenAL. That one was far more simple just commenting out everything in the related plugin directory CMakeLists.txt (there is an IF Clause in there). I could have simply removed OpenAL libs and headers before running cmake.. maybe ill try that next. Is there another way to force it to not compile OpenAL?

I took BaldursGate1 content from a working Solaris10/SPARC environment and placed on IRIX: so the cfg file and content exist.
#Note, I did try with the -c test.cfg too.. same result

[octane]:~ $ gemrb -c /usr/local/etc/gemrb/GemRB.cfg.bg1
[Core]: GemRB Core Version v0.8.4-git Loading...
[Config]: attempting to initialize config with GemRB.cfg.bg1
[Core]: Initializing the Event Manager...
[Core]: Starting Plugin Manager...
[PluginMgr]: Loading Plugins from /usr/local/lib/gemrb/plugins
[PluginLoader]: Loaded plugin "2DA File Importer" (2DAImporter.so).
[PluginLoader]: Loaded plugin "ACM File Importer" (ACMReader.so).
[PluginLoader]: Loaded plugin "BAM File Importer" (BAMImporter.so).
[PluginLoader/ERROR]: Cannot Load "/usr/local/lib/gemrb/plugins/BIKPlayer.so", skipping...
[PluginLoader/DEBUG]: Error: 459017:gemrb: rld: Fatal Error: unresolvable symbol in /usr/local/lib/gemrb/plugins/BIKPlayer.so: _ZTVN5GemRB9BIKPlayerE
[PluginLoader]: Loaded plugin "BMP File Writer" (BMPWriter.so).
[PluginLoader]: Loaded plugin "CHU File Importer" (CHUImporter.so).
[PluginLoader]: Loaded plugin "DLG File Importer" (DLGImporter.so).
[PluginLoader]: Loaded plugin "EFF File Importer" (EFFImporter.so).
[PluginLoader]: Loaded plugin "GAM File Importer" (GAMImporter.so).
[PluginLoader]: Loaded plugin "INI File Importer" (INIImporter.so).
[PluginLoader]: Loaded plugin "Effect opcodes for the icewind branch of the games" (IWDOpcodes.so).
[PluginLoader]: Loaded plugin "MOS File Importer" (MOSImporter.so).
[PluginLoader]: Loaded plugin "MVE Video Player" (MVEPlayer.so).
[PluginLoader]: Loaded plugin "Null Sound Driver" (NullSound.so).
[PluginLoader]: Loaded plugin "OGG File Importer" (OGGReader.so).
[PluginLoader]: Loaded plugin "PNG File Importer" (PNGImporter.so).
[PluginLoader]: Loaded plugin "Effect opcodes for the torment branch of the games" (PSTOpcodes.so).
[PluginLoader]: Loaded plugin "SDL1 Video Driver" (SDLVideo.so).
[PluginLoader]: Loaded plugin "SPL File Importer" (SPLImporter.so).
[PluginLoader]: Loaded plugin "TIS File Importer" (TISImporter.so).
[PluginLoader]: Loaded plugin "TTF Font Importer" (TTFImporter.so).
[PluginLoader]: Loaded plugin "WED File Importer" (WEDImporter.so).
[PluginLoader]: Loaded plugin "ZLib Compression Manager" (ZLibManager.so).
[PluginLoader]: Loaded plugin "ARE File Importer" (AREImporter.so).
[PluginLoader]: Loaded plugin "BIF File Importer" (BIFImporter.so).
[PluginLoader]: Loaded plugin "BMP File Reader" (BMPImporter.so).
[PluginLoader]: Loaded plugin "CRE File Importer" (CREImporter.so).
[PluginLoader]: Loaded plugin "Directory Importer" (DirectoryImporter.so).
[PluginLoader]: Loaded plugin "Effect opcodes for core games" (FXOpcodes.so).
Bus error (core dumped)

I played with GDB a bit..
backtrace shows 2 frames..
(gdb) bt
#0 0x00000000 in ?? ()
#1 0x00000000 in ?? ()
Previous frame identical to this frame (corrupt stack?)
(gdb) frame 0
#0 0x00000000 in ?? ()
(gdb) list
82 InitializeLogging();
83
84 core = new Interface();
85 CFGConfig* config = new CFGConfig(argc, argv);
86 if (core->Init( config ) == GEM_ERROR) {
87 delete config;
88 delete( core );
89 Log(MESSAGE, "Main", "Press enter to continue...");
90 getc(stdin);
91 ShutdownLogging();
(gdb) frame 1
#1 0x00000000 in ?? ()
(gdb) list
72 // about shrinking the heap.
73 #ifdef HAVE_UNISTD_H
74 int pagesize = sysconf(_SC_PAGESIZE);
75 #else
76 int pagesize = 4*1024;
77 #endif
78 mallopt(M_TRIM_THRESHOLD, 5*pagesize);
79 #endif
80
81 Interface::SanityCheck(VERSION_GEMRB);

Anything I should look at?
strace output: (near the end of it)
write(1, "\33[1m\33[37;40m", 12) = 12
write(1, "[", 1[) = 1
write(1, "PluginLoader", 12PluginLoader) = 12
write(1, "\33[1m\33[37;40m", 12) = 12
write(1, "]: ", 3]: ) = 3
write(1, "\33[0m\33[37;40m", 12) = 12
write(1, "Loaded plugin \"Effect opcodes f"..., 61Loaded plugin "Effect opcodes for core games" (FXOpcodes.so).) = 61
write(1, "\n", 1
) = 1
access("/usr/local/lib/gemrb/plugins/GUIScript.so", R_OK) = 0
open("/usr/local/lib/gemrb/plugins/GUIScript.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffeec80, 0x2, 0x3a208, 0x3a208) = 71417856
close(3) = 0
open("/usr/local/lib/gemrb/libpython2.7.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libpython2.7.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffed5e0, 0x2, 0x183248, 0x183248) = 71909376
close(3) = 0
open("/usr/local/lib/gemrb/libCsup.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libCsup.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libCsup.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecff0, 0x2, 0x5c8, 0x5c8) = 180355072
close(3) = 0
open("/usr/local/lib/gemrb/libC.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libC.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libC.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecfe0, 0x2, 0x50a18, 0x50a18) = 181207040
close(3) = 0
open("/usr/local/lib/gemrb/libCio.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libCio.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libCio.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecfd0, 0x2, 0xd3bc8, 0xd3bc8) = 182255616
close(3) = 0
fcntl(0, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(1, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(2, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(2, F_GETFL) = 0x2 (flags O_RDWR)
--- SIGBUS (Bus error) ---
Through process of elimination .. GUIScript.so plugin is what is causing the core dump.
There are 41 plugins.. if I have 40 there.. and remove GUIScript.so.. gemrb loads all and then says it needs GUIscript but no core dump. If I only have 1 plugin available.. and the other 40 removed, gemrb core dumps (and tried different combos).

I noted that Dexter1 has a few more mods left on stricmp change to strcasecmp within GUIScript.cpp .. I'm trying those now. Strange that GCC didnt complain on compiling with stricmp.
ldexpf is C99 and maybe a glibc extension. BIKPlayer is only needed for iwd2 movies though. I'll just disable the whole plugin build if the function isn't available — too lazy to find a reliable standalone implementation (could be tricky, since floats are involved).

What was the problem with openal? You can disable it through ccmake or passing a flag.

We use strcasecmp everywhere but on windows (stricmp is its alias).

The GUIScript plugin is essential. Can you post your current "git diff" the next time?
git diff is attached.
my apologies for it being messy. Its size is mainly due to deleting a large chuck of BIKPlayer.cpp to get it to compile but have it do nothing/dummy. Also GemRB.cpp shows up as modified.. but it really was not.. i was testing things around where gdb was saying it was crashing at.
I also started adding in Dexter's changes you had listed at http://sprunge.us/TPJi?diff but so far I see no difference regarding the GUIScript plugin core dump.
I've pushed some changes, so you don't have to hack BIKPlayer away anymore. Or CMakeLists.txt for the module stuff.

Are the FP constants really needed in both headers?

stricmp is just a macro, so WTF do you need to change the uses?
#ifndef WIN32
# define stricmp strcasecmp
# define strnicmp strncasecmp
#endif

you can run git checkout dir/asd/asd/file to reset your copy of a file to what is upstream. Do that for CMakeLists or you'll get conflicts when updating. So something like
git checkout CMakeLists.txt
git checkout gemrb/plugins/BIKPlayer/*
git stash
git pull
git stash pop
So I did a fresh clone from GIT.. still a few things to adjust/mod but nothing serious (same things mentioned before). My git clone didnt seem to have BIKPlayer removed yet, but it could just be my doing.

Compile works. I was using -O3 before.. but I just tried with the default -O2 optimziation for Gemrb and same thing.

Gemrb loading GUIscript Plugin has the IRIX OS itself terminate gemrb as identified in the IRIX console:

ALERT: Process [gemrb] 487180 generated trap, but has signal 10 held or ignored
epc 0x617f98 ra 0xace67b4 badvaddr 0xfffffffffffffffd
process has been terminated to prevent infinite loop

If I remove GUIScript plugin from the plugins dir.. things load up promisingly .. even an SDL window, and loading BG data files... just needs GUIScript in the end.

What I can do is try with SGI's native MIPSPro Compiler as Dexter did earlier. Just that compiler can be pretty picky. Other than that, im running out of options.
if you run "git log", what is the last commit? You definitely shouldn't need all the hacks from before.
lynx.. dont use any diff files and info from this message to formally add to GemRB. I need more help on this one from Dexter or other more seasoned IRIX developers.

Ok. I am able to compile with MIPSPro Compiler. However the result is unresolvable symbols:

Code: Select all

[octane]:~ $ gemrb
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std139_Deque_base__pt__119_Q3_5GemRB15GemMarkupParser14TextAttributesQ2_3std60allocator__pt__43_Q3_5GemRB15GemMarkupParser14TextAttributesXCUiL10Gv
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std123_Deque_base__pt__103_Q3_5GemRB16ContentContainer6LayoutQ2_3std52allocator__pt__35_Q3_5GemRB16ContentContainer6LayoutXCUiL10Gv
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std230_Deque_base__pt__210_Q2_3std78basic_string__pt__58_wQ2_3std20char_traits__pt__2_wQ2_3std18allocator__pt__2_wQ2_3std105allocator__pt__88_Q2_3std78basic_string__pt__58_wQ2_3std20char_traits__pt__2_wQ2_3std18allocator__pt__2_wXCUiL10Gv
559531:gemrb: rld: Fatal Error: this executable has unresolvable symbols
[octane]:~ $

I can find those symbols using 'nm' on libgemrb_core.so.0.8.4-git itself but they seem to be 000000 's? Maybe not built or linked right.

Below is more for Dexter.. when his holiday parties are over:
git clone git://github.com/gemrb/gemrb.git
apply patches from git-diff-mipspro.txt #see attached
Use cmake 2.8.6 or newer (the link to neko_cmake-2.8.6.tardist is earlier in this thread)
I created a custom inittypes.h for va_list:
diff -urp /usr/include/inttypes.h-ORIG /usr/include/intty
pes.h

Code: Select all

--- /usr/include/inttypes.h-ORIG        2016-01-07 18:44:31.626329680 -0500
+++ /usr/include/inttypes.h     2016-10-09 17:32:29.042193080 -0400
@@ -184,6 +184,12 @@ typedef unsigned long int  uintptr_t;
#include <stdarg.h>
#include <stdio.h>

+/* http://forums.nekochan.net/viewtopic.php?t=17626
+ * FIX FOR va_list not being defined when compiling
+ * this was done for doxbox .7x
+ */
+typedef char *va_list;
+
extern int i_fprintf  ( FILE *stream, const char *format, ... );
extern int i_vfprintf ( FILE *stream, const char *format, va_list va );
extern int i_printf   ( const char *format, ... );



MIPSPRO ENVIRONMENT

Code: Select all

export CC=c99
export CXX=cc
export CFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export CXXFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export CPPFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export LDFLAGS="-L/usr/nekoware/lib"
export PERL=/usr/nekoware/bin/perl
export GNUMAKE=/usr/nekoware/bin/gmake
export SED=/usr/nekoware/bin/sed


cd gemrb
mkdir build
cmake -DHAVE_LDEXPF=0 -DDISABLE_WERROR=1 ..
# Note that OpenAL bits are commented out as detailed in the DIFF file
gmake VERBOSE=1 install

It will fail later on linking CXX executable gemrb

I worked around this (probably part of the problem):
RUN (its part of the failed command.. this creates the relink.txt):
cd /tmp/gemrb2/gemrb/build/gemrb && /usr/nekoware/bin/cmake -E cmake_link_script CMakeFiles/gemrb.dir/relink.txt --verbose=1

edit CMakeFiles/gemrb.dir/link.txt to add in /usr/lib32/c++init.o -lc -lC -lCio -lSgm after "-o gemrb"
/usr/bin/cc -O3 -mips4 -n32 -I/usr/nekoware/include -O2 -L/usr/nekoware/lib CMakeFiles/gemrb.dir/GemRB.cpp.o -o gemrb /usr/lib32/c++init.o -lc -lC -lCio -lSgm core/libgemrb_core.so.0.8.4-git -lpthread -Wl,-rpath,/tmp/gemrb2/gemrb/build/gemrb/core
##I found all the missing symbols from c++init.o and -lc -lC -lCio -lSgm .. maybe these are incorrect?

gmake VERBOSE=1 install

builds to 100% but then link error

RUN (its part of the failed command.. this creates the relink.txt): cd /tmp/gemrb2/gemrb/build/gemrb && /usr/nekoware/bin/cmake -E cmake_link_script CMakeFiles/gemrb.dir/relink.txt --verbose=1

edit CMakeFiles/gemrb.dir/relink.txt to add in /usr/lib32/c++init.o -lc -lC -lCio -lSgm after "-o gemrb"

gmake VERBOSE=1 install # as root, or use DESTDIR=/tmp/blah
DONE

Thats the best I can get with MIPSPro..
Now, the changes listed in this message/DIFF file.. seem to make GCC not compile now. I did feel a bit closer to the end with GCC ;)

git-diff-mipspro.txt
(4.93 KiB) Downloaded 20 times
Holy cow, That is some material to sift through!

I have my O2 installed with neko_python-2.7.3 neko_sdl-1.2.13 and a fresh cmake 2.8.12.2 prepped for compiling gemRB this evening, so i'll start producing some stuff this week.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:
I've started gemrb-0.8.4 compile on my O2 and found a solution for the Holder.h problem

lynx wrote: hey guys, gemrb dev here.
- what tripped you up in Holder.h?

Well, basically this:

Code: Select all

[  1%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/Animation.cpp.o
cc-3624 CC: WARNING File = /local/frank/gemrb-0.8.4/gemrb/core/Callback.h, Line = 37
function "GemRB::VoidCallback::operator()()" is hidden by
"GemRB::Callback<T>::operator()" -- virtual function override
intended?

virtual bool operator()(T target)=0;
^

cc-1209 CC: WARNING File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 35
The controlling expression is constant.

void release() { assert(RefCount && "Broken Held usage.");
^
A template was detected during header processing.
instantiation of "void GemRB::Held<GemRB::VoidCallback>::release()"
at line 66
instantiation of "GemRB::Holder<GemRB::VoidCallback>::~Holder()"
at line 62 of
"/local/frank/gemrb-0.8.4/gemrb/core/Callback.h"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 72
A pointer to an incomplete class type is not allowed.

ptr->acquire();
^
A template was detected during header processing.
instantiation of "GemRB::Holder<GemRB::SymbolMgr>::Holder(const
GemRB::Holder<GemRB::SymbolMgr> &)" at line 53 of
"/usr/include/CC/stl_construct.h"
implicit generation of
"GemRB::Symbol::Symbol(const GemRB::Symbol &)" at line
53 of "/usr/include/CC/stl_construct.h"
instantiation of "void std::construct(GemRB::Symbol *, const
GemRB::Symbol &)" at line 637 of
"/usr/include/CC/stl_vector.h"
instantiation of "void std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::iterator, const
GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 66
A pointer to an incomplete class type is not allowed.

ptr->release();
^
A template was detected during header processing.
instantiation of "GemRB::Holder<GemRB::SymbolMgr>::~Holder()" at
line 53 of "/usr/include/CC/stl_construct.h"
implicit generation of
"GemRB::Symbol::Symbol(const GemRB::Symbol &)" at line
53 of "/usr/include/CC/stl_construct.h"
instantiation of "void std::construct(GemRB::Symbol *, const
GemRB::Symbol &)" at line 637 of
"/usr/include/CC/stl_vector.h"
instantiation of "void std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::iterator, const
GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 77
A pointer to an incomplete class type is not allowed.

rhs.ptr->acquire();
^
A template was detected during header processing.
instantiation of "GemRB::Holder<GemRB::SymbolMgr>
&GemRB::Holder<GemRB::SymbolMgr>::operator=(const
GemRB::Holder<GemRB::SymbolMgr> &)" at line 249 of
"/usr/include/CC/stl_algobase.h"
implicit generation of "GemRB::Symbol
&GemRB::Symbol::operator=(const GemRB::Symbol &)" at
line 249 of "/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::__copy_backward(std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *, std::random_access_iterator_tag,
std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *,
__type_traits<std::iterator_traits<GemRB::Symbol
*>::value_type>::has_trivial_assignment_operator>::_Dista
nce *)" at line 272 of "/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *,
__type_traits<std::iterator_traits<GemRB::Symbol
*>::value_type>::has_trivial_assignment_operator>::copy(s
td::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *)" at line 300 of
"/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::copy_backward(std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *)" at line 640 of
"/usr/include/CC/stl_vector.h"
instantiation of "void std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::iterator, const
GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 79
A pointer to an incomplete class type is not allowed.

ptr->release();
^
A template was detected during header processing.
instantiation of "GemRB::Holder<GemRB::SymbolMgr>
&GemRB::Holder<GemRB::SymbolMgr>::operator=(const
GemRB::Holder<GemRB::SymbolMgr> &)" at line 249 of
"/usr/include/CC/stl_algobase.h"
implicit generation of "GemRB::Symbol
&GemRB::Symbol::operator=(const GemRB::Symbol &)" at
line 249 of "/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::__copy_backward(std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *, std::random_access_iterator_tag,
std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *,
__type_traits<std::iterator_traits<GemRB::Symbol
*>::value_type>::has_trivial_assignment_operator>::_Dista
nce *)" at line 272 of "/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *,
__type_traits<std::iterator_traits<GemRB::Symbol
*>::value_type>::has_trivial_assignment_operator>::copy(s
td::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *)" at line 300 of
"/usr/include/CC/stl_algobase.h"
instantiation of "GemRB::Symbol
*std::copy_backward(std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::value_type *,
GemRB::Symbol *)" at line 640 of
"/usr/include/CC/stl_vector.h"
instantiation of "void std::vector<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
<GemRB::Symbol,
std::allocator<GemRB::Symbol>>::iterator, const
GemRB::Symbol &)"

4 errors detected in the compilation of "/local/frank/gemrb-0.8.4/gemrb/core/Animation.cpp".
gmake[2]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/Animation.cpp.o] Error 2
gmake[1]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/all] Error 2
gmake: *** [all] Error 2

TLDR:
cc-1367 CC ERROR "A pointer to an incomplete class type is not allowed."
Initially i didn't know how to proceed, so i commented the problematic functions out. But working on this error message proved fruitful after a couple of hours. The problem lies with the definition of Symbol in gemrb/core/Interface.h :

Code: Select all

#ifdef _MSC_VER // No SFINAE
...
#include "SymbolMgr.h"
...
#endif

namespace GemRB {
...
class SymbolMgr;
...
struct Symbol {
Holder<SymbolMgr> sm;
char ResRef[8];
};
...

MIPSPro has its own way of instantiating templates. On occasions where people use forward declaration for classes and then trying to use them with templates produces compiler errors. This is because for template instantiation the class SymbolMgr is different from the class in the header file i.e. it won't see the class definition in the header file.

There are compiler options for remedying this, but why use forward declaration in the first place?
IIRC these are only needed for circular dependencies in class definitions. If it is not needed then don't use it.

I've re-enabled the headers by this diff:

Code: Select all

--- Interface.h.save    Mon Dec 19 11:50:15 2016
+++ Interface.h Mon Dec 19 12:00:10 2016
@@ -40,7 +40,7 @@
#include <string>
#include <vector>

-#ifdef _MSC_VER // No SFINAE
+#if defined(_MSC_VER) || defined(__sgi)
#include "DataFileMgr.h"
#include "MusicMgr.h"
#include "SaveGame.h"
@@ -89,8 +89,8 @@
class Sprite2D;
class Store;
class StringMgr;
-class SymbolMgr;
-class TableMgr;
+//class SymbolMgr;
+//class TableMgr;
class TextArea;

and solved the compile problem.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP: