Problems building C++ with Pixel's new gcc patch.
Posted: Tue Feb 17, 2004 8:34 am
So I'm trying to build ps2-gcc with C++ support. Here's what I do:
And here's the result:## gcc-3.2.2 (C++)
cd $TMPDIR; tar xfvz $SRCDIR/gcc-3.2.2.tar.gz; cd gcc-3.2.2
cat $SRCDIR/gcc-3.2.2-PS2.patch | patch -p1
mkdir build; cd build; ../configure --prefix=$PS2DEV/ps2 --target=ps2 --enable-languages="c,c++" --enable-cxx-flags="-G0"
make CFLAGS_FOR_TARGET="-G0"; make install
cd $TMPDIR; rm -Rf gcc-3.2.2
Inside the file, it seems the problem is in this blurb of code:In file included from ../../../../libstdc++-v3/libsupc++/eh_alloc.cc:33:
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:86: `div_t' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:87: `ldiv_t' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:97: `div' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:102: `ldiv' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:104: `mblen' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:105: `mbstowcs' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:106: `mbtowc' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:115: `wcstombs' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:116: `wctomb' not declared
/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/include/cstdlib:122: syntax error before `(' token
make[2]: *** [eh_alloc.lo] Error 1
make[2]: Leaving directory `/tmp/gcc-3.2.2/build/ps2/libstdc++-v3/libsupc++'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/tmp/gcc-3.2.2/build/ps2/libstdc++-v3'
Any suggestions? I'm not a C++ monkey.namespace std
{
using ::div_t;
using ::ldiv_t;
using ::abort;
using ::abs;
using ::atexit;
using ::atof;
using ::atoi;
using ::atol;
using ::bsearch;
using ::calloc;
using ::div;
using ::exit;
using ::free;
using ::getenv;
using ::labs;
using ::ldiv;
using ::malloc;
using ::mblen;
using ::mbstowcs;
using ::mbtowc;
using ::qsort;
using ::rand;
using ::realloc;
using ::srand;
using ::strtod;
using ::strtol;
using ::strtoul;
using ::system;
using ::wcstombs;
using ::wctomb;
inline long
abs(long __i) { return labs(__i); }
inline ldiv_t
div(long __i, long __j) { return ldiv(__i, __j); }
}