ee-gcc and __LONG_MAX__

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
spambait
Posts: 6
Joined: Sun Apr 17, 2005 8:59 pm

ee-gcc and __LONG_MAX__

Post 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.
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

printf("%X", __LONG_MAX__);

7FFFFFFFFFFFFFFF


which is perfectly correct.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
spambait
Posts: 6
Joined: Sun Apr 17, 2005 8:59 pm

Post 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"
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

ee-gcc -D__LONG_MAX__=9223372036854775807L of course.

Seriously: update your toolchain (both gcc and ps2sdk) using cvs sources.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
spambait
Posts: 6
Joined: Sun Apr 17, 2005 8:59 pm

Post 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 ?
spambait
Posts: 6
Joined: Sun Apr 17, 2005 8:59 pm

Post 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.
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

The right command line would be -isystem $PS2SDK/common/include
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post 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!
Post Reply