Page 1 of 1

ee-gcc and __LONG_MAX__

Posted: Sun Apr 17, 2005 9:06 pm
by spambait
The current toolchain from CVS seems to create an ee-gcc which has a wrong __LONG_MAX__ definition, therby breaking <limits.h> and possibly other things.

Please fix by updating the (builtin?) specs. Thanks.

Posted: Sun Apr 17, 2005 9:22 pm
by pixel
printf("%X", __LONG_MAX__);

7FFFFFFFFFFFFFFF


which is perfectly correct.

Posted: Sun Apr 17, 2005 9:55 pm
by spambait
Which compiler flags are you using ? Actually it seems __LONG_MAX__ is not defined at all (see *long_max_spec in ee/lib/gcc-lib/ee/3.2.2/specs).

Code: Select all

> cat x.c
#ifndef __LONG_MAX__
#error "1"
#endif
#include <limits.h>
#ifndef __LONG_MAX__
#error "2"
#endif
#if __LONG_MAX__ != 9223372036854775807L
#error "3"
#endif

> /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/bin/ee-gcc -v
Reading specs from /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/lib/gcc-lib/ee/3.2.2/specs
Configured with&#58; ../configure --prefix=/opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee --target=ee --enable-languages=c,c++ --with-newlib --with-headers=/opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/ee/include --enable-cxx-flags=-G0
Thread model&#58; single
gcc version 3.2.2

> /opt/cc-i386-linux/cross/ps2/mips64el-ps2.ps2dev-20050412/ee/bin/ee-gcc -c x.c
x.c&#58;2&#58;2&#58; #error "1"
x.c&#58;9&#58;2&#58; #error "3"

Posted: Sun Apr 17, 2005 10:18 pm
by pixel
ee-gcc -D__LONG_MAX__=9223372036854775807L of course.

Seriously: update your toolchain (both gcc and ps2sdk) using cvs sources.

Posted: Sun Apr 17, 2005 10:30 pm
by spambait
My toolchain is from 20050412, which includes the latest CVS ps2toolchain/gcc-3.2.2.patch from Apr 09. Is there any newer version ?

Posted: Sun Apr 17, 2005 10:57 pm
by spambait
Ok, I've just seen your glimits.h update to gcc-3.2.2 CVS, and while I'm not sure what you mean with "command line setup" in your CVS comment I still think that the specs should be fixed. Anyway, many thanks.

Posted: Sun Apr 17, 2005 11:33 pm
by pixel
The right command line would be -isystem $PS2SDK/common/include

Posted: Sun Apr 17, 2005 11:44 pm
by cory1492
Ho well, let's have that into the toolchain as well, so that people who REALLY do not know how to set up command line options will be happy.
You werent talking about me were you? LOL thanks pixel!