PACKAGE NAME ------------ neko_libunistring SOURCE/VERSION -------------- libunistring-0.9.10 / 1 IRIX/MIPSPRO VERSION -------------------- 6.5.22m / 7.4.4m ENVIRONMENT VARIABLES --------------------- setenv CC c99 setenv CFLAGS '-O2 -mips4 -n32' setenv LDFLAGS -L/usr/nekoware/lib setenv MAKE /usr/nekoware/bin/gmake setenv PERL /usr/nekoware/bin/perl setenv PATH /usr/nekoware/bin:$PATH For systems with an R4x00 processor, use setenv CFLAGS '-O2 -mips3 -n32' PATCH ----- cd libunistring-0.9.10 patch -p0 < libunistring-0.9.10_irix.patch CONFIGURE FLAGS --------------- ./configure --disable-rpath --prefix=/usr/nekoware --with-libiconv-prefix=/usr/nekoware BUILD ----- gmake gmake check gmake install KNOWN DEPENDENCIES ------------------ neko_libiconv 5 perl and gmake to build the package ERRORS/MISCELLANEOUS -------------------- This package has dual support for both mips3 and mips4 architecture, controlled by the mach(CPUARCH=R4000) switch for libraries and executables. The patch resolves some trivial issues with _Bool types in function prototypes and a more problematic piece of code, possibly a bug, in lib/unistr/u8-strchr.c It uses a combined expression in three 'if' statements, where a char* array is tested for zeroes, but some tests are past it's allocated memory region. See f.i. line 175: if (*s == 0 || s[1] == 0 || s[2] == 0 || s[3] == 0) When s is allocated as a single NULL byte, the above expression would segfault since there is no s[1 .. 3] . This depends on the compiler optimizing the code, (and it is okay for -O1) but -O2 tries to be smart and possibly inserts code which out-of-order prefetches the other instructions. Rolling it out and nesting with 'if-else' didn't work because of that out-of-order optimization of MIPSPro so i made a new function which does the zero check. The test from 'gmake check' produces the following result: ============================================================================ Testsuite summary for ============================================================================ # TOTAL: 512 # PASS: 487 # SKIP: 25 # XFAIL: 0 # FAIL: 0 # XPASS: 0 # ERROR: 0 PACKAGED BY ----------- S/N VER PORTER Date --------------------------------------------------------- 1 0.9.10 Frank Everdij (dexter1) 10-06-2018