Page 1 of 1

libjpeg src prob parse errors

Posted: Fri Mar 11, 2005 1:19 am
by cory1492
Lots of em too, any ideas on why this would be doing something like this? (this is straight from CVS so I am not sure if it was ever completed or not)

Code: Select all

Cory@home /usr/local/ps2dev/ps2sdk-ports/libjpeg
$ make
make -C src
make[1]: Entering directory `/usr/local/ps2dev/ps2sdk-ports/libjpeg/src'
ee-gcc -D_EE -O2 -G0 -Wall  -I/usr/local/ps2dev/ps2sdk/ee/include -I/usr/local/p
s2dev/ps2sdk/common/include -I. -I../include -c jcapimin.c -o jcapimin.o
In file included from jcapimin.c:39:
jinclude.h:177: parse error before "size_t"
In file included from jcapimin.c:41:
../include/jpeglib.h:137: parse error before '*' token
../include/jpeglib.h:137: warning: type defaults to `int' in declaration of `JSAMPROW'
../include/jpeglib.h:137: warning: data definition has no type or storage class
../include/jpeglib.h:139: parse error before '*' token
../include/jpeglib.h:139: warning: type defaults to `int' in declaration of `JSAMPARRAY'
../include/jpeglib.h:139: warning: data definition has no type or storage class
../include/jpeglib.h:141: parse error before '*' token
../include/jpeglib.h:141: warning: type defaults to `int' in declaration of `JSAMPIMAGE'
../include/jpeglib.h:141: warning: data definition has no type or storage class
../include/jpeglib.h:511: syntax error before "struct"
../include/jpeglib.h:963: parse error before "JSAMPARRAY"
../include/jpeglib.h:963: warning: no semicolon at end of struct or union
../include/jpeglib.h:1183: parse error before '*' token
../include/jpeglib.h:1183: warning: type defaults to `int' in declaration of `sample_range_limit'
../include/jpeglib.h:1183: warning: data definition has no type or storage class
../include/jpeglib.h:1245: warning: `main' is usually a function
../include/jpeglib.h:1265: parse error before '}' token
../include/jpeglib.h:1533: parse error before "JSAMPARRAY"
../include/jpeglib.h:1533: warning: no semicolon at end of struct or union
../include/jpeglib.h:1575: parse error before '*' token
../include/jpeglib.h:1575: warning: type defaults to `int' in declaration of `JSAMPARRAY'
../include/jpeglib.h:1575: `JSAMPARRAY' declared as function returning a function
../include/jpeglib.h:1575: `JSAMPARRAY' redeclared as different kind of symbol
../include/jpeglib.h:139: previous declaration of `JSAMPARRAY'
../include/jpeglib.h:1575: warning: data definition has no type or storage class
../include/jpeglib.h:1611: parse error before '}' token
../include/jpeglib.h:1795: parse error before '(' token
../include/jpeglib.h:1795: warning: type defaults to `int' in declaration of `jpeg_CreateCompress'
../include/jpeglib.h:1885: parse error before "JSAMPARRAY"
../include/jpeglib.h:1897: parse error before "JSAMPIMAGE"
../include/jpeglib.h:1961: parse error before "JSAMPARRAY"
../include/jpeglib.h:1973: parse error before "JSAMPIMAGE"
In file included from ../include/jpeglib.h:2189,
                 from jcapimin.c:41:
jpegint.h:113: parse error before "JSAMPARRAY"
jpegint.h:137: parse error before "JSAMPARRAY"
jpegint.h:151: parse error before "JSAMPIMAGE"
jpegint.h:167: parse error before "JSAMPARRAY"
jpegint.h:185: parse error before "JSAMPIMAGE"
jpegint.h:211: parse error before "JSAMPARRAY"
jpegint.h:317: parse error before "JSAMPARRAY"
jpegint.h:335: parse error before "JSAMPIMAGE"
jpegint.h:363: parse error before "JSAMPIMAGE"
jpegint.h:439: parse error before "JSAMPARRAY"
jpegint.h:473: parse error before "JSAMPIMAGE"
jpegint.h:493: parse error before "JSAMPIMAGE"
jpegint.h:509: parse error before "JSAMPARRAY"
jpegint.h:743: parse error before "input_array"
In file included from ../include/jpeglib.h:2191,
                 from jcapimin.c:41:
jerror.h:411: parse error before '->' token
jerror.h:535: warning: type defaults to `int' in declaration of `_mp'
jerror.h:535: `p1' undeclared here (not in a function)
jerror.h:535: warning: data definition has no type or storage class
jerror.h:535: warning: type defaults to `int' in declaration of `_mp'
jerror.h:535: conflicting types for `_mp'
jerror.h:535: previous declaration of `_mp'
jerror.h:535: `p2' undeclared here (not in a function)
jerror.h:535: warning: data definition has no type or storage class
jerror.h:535: warning: type defaults to `int' in declaration of `_mp'
jerror.h:535: conflicting types for `_mp'
jerror.h:535: previous declaration of `_mp'
jerror.h:535: `p3' undeclared here (not in a function)
jerror.h:535: warning: data definition has no type or storage class
jerror.h:535: parse error before '->' token
jerror.h:535: parse error before '->' token
jerror.h:545: warning: type defaults to `int' in declaration of `_mp'
jerror.h:545: conflicting types for `_mp'
jerror.h:535: previous declaration of `_mp'
jerror.h:545: `p1' undeclared here (not in a function)
jerror.h:545: warning: data definition has no type or storage class
jerror.h:545: warning: type defaults to `int' in declaration of `_mp'
jerror.h:545: conflicting types for `_mp'
jerror.h:545: previous declaration of `_mp'
jerror.h:545: `p2' undeclared here (not in a function)
jerror.h:545: warning: data definition has no type or storage class
jerror.h:545: warning: type defaults to `int' in declaration of `_mp'
jerror.h:545: conflicting types for `_mp'
jerror.h:545: previous declaration of `_mp'
jerror.h:545: `p3' undeclared here (not in a function)
jerror.h:545: warning: data definition has no type or storage class
jerror.h:545: warning: type defaults to `int' in declaration of `_mp'
jerror.h:545: conflicting types for `_mp'
jerror.h:545: previous declaration of `_mp'
jerror.h:545: `p4' undeclared here (not in a function)
jerror.h:545: warning: data definition has no type or storage class
jerror.h:545: parse error before '->' token
jerror.h:545: parse error before '->' token
jerror.h:557: warning: type defaults to `int' in declaration of `_mp'
jerror.h:557: conflicting types for `_mp'
jerror.h:545: previous declaration of `_mp'
jerror.h:557: `p1' undeclared here (not in a function)
jerror.h:557: warning: data definition has no type or storage class
jerror.h:557: warning: type defaults to `int' in declaration of `_mp'
jerror.h:557: conflicting types for `_mp'
jerror.h:557: previous declaration of `_mp'
jerror.h:557: `p2' undeclared here (not in a function)
jerror.h:557: warning: data definition has no type or storage class
jerror.h:557: warning: type defaults to `int' in declaration of `_mp'
jerror.h:557: conflicting types for `_mp'
jerror.h:557: previous declaration of `_mp'
jerror.h:557: `p3' undeclared here (not in a function)
jerror.h:557: warning: data definition has no type or storage class
jerror.h:557: warning: type defaults to `int' in declaration of `_mp'
jerror.h:557: conflicting types for `_mp'
jerror.h:557: previous declaration of `_mp'
jerror.h:557: `p4' undeclared here (not in a function)
jerror.h:557: warning: data definition has no type or storage class
jerror.h:557: warning: type defaults to `int' in declaration of `_mp'
jerror.h:557: conflicting types for `_mp'
jerror.h:557: previous declaration of `_mp'
jerror.h:557: `p5' undeclared here (not in a function)
jerror.h:557: warning: data definition has no type or storage class
jerror.h:557: parse error before '->' token
jerror.h:557: parse error before '->' token
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:557: previous declaration of `_mp'
jerror.h:569: `p1' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p2' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p3' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p4' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p5' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p6' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p7' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: warning: type defaults to `int' in declaration of `_mp'
jerror.h:569: conflicting types for `_mp'
jerror.h:569: previous declaration of `_mp'
jerror.h:569: `p8' undeclared here (not in a function)
jerror.h:569: warning: data definition has no type or storage class
jerror.h:569: parse error before '->' token
jerror.h:569: parse error before '->' token
jcapimin.c:99: `cinfo' undeclared here (not in a function)
jcapimin.c:101: parse error before '(' token
jcapimin.c:101: warning: type defaults to `int' in declaration of `memset'
jcapimin.c:101: warning: parameter names (without types) in function declaration

jcapimin.c:101: `memset' declared as function returning a function
jcapimin.c:101: parse error before numeric constant
jcapimin.c:115: parse error before '(' token
jcapimin.c: In function `jpeg_finish_compress':
jcapimin.c:301: structure has no member named `global_state'
jcapimin.c:303: structure has no member named `global_state'
jcapimin.c:313: structure has no member named `global_state'
jcapimin.c:325: structure has no member named `progress'
jcapimin.c:327: structure has no member named `progress'
jcapimin.c:329: structure has no member named `progress'
jcapimin.c:331: structure has no member named `progress'
jcapimin.c:341: called object is not a function
jcapimin.c: In function `jpeg_write_marker':
jcapimin.c:395: structure has no member named `global_state'
jcapimin.c:397: structure has no member named `global_state'
jcapimin.c:399: structure has no member named `global_state'
jcapimin.c: In function `jpeg_write_m_header':
jcapimin.c:433: structure has no member named `global_state'
jcapimin.c:435: structure has no member named `global_state'
jcapimin.c:437: structure has no member named `global_state'
jcapimin.c: In function `jpeg_write_tables':
jcapimin.c:511: structure has no member named `global_state'
jcapimin.c:519: structure has no member named `err'
make[1]: *** [jcapimin.o] Error 1
make[1]: Leaving directory `/usr/local/ps2dev/ps2sdk-ports/libjpeg/src'
make: *** [all-src] Error 2
also had this problem with libpng:

Code: Select all

#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \

    defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)

#  ifndef PNG_NO_USER_TRANSFORM_PTR
taking out the \ , CRs and extra spaces resolved the issue for the most part at any rate.

Could these be a problem with my local install of the GCC/SDK?

Also, I think there is a redundancy in the sdk/toolchain:

Code: Select all

/usr/local/ps2dev/ps2sdk/ee/include/time.h:17: warning: redefinition of `clock_t'
/usr/local/ps2dev/ee/ee/sys-include/sys/types.h:66: warning: `clock_t' previously declared here

Posted: Fri Mar 11, 2005 1:49 am
by evilo
concerning libpng, the port is complete and working, and I have it compiling fine under cygwin and using gcc 3.2.2, and without any warning/errors about the "\"..

I know that multi-line is deprecated in gcc, but as it was working as it for me, I don't know why you have that error... which version of GCC do you use ?

libpng fixed for cygwin/toolchain

Posted: Fri Mar 11, 2005 2:13 am
by cory1492
using "gcc -v" gcc version 3.3.3 (cygwin special)

Code: Select all

$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/3.3.3/specs
Configured with: /gcc/gcc-3.3.3-3/configure --verbose --prefix=/usr --exec-prefi
x=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/s
hare/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc,
pascal --enable-nls --without-included-gettext --enable-libgcj --with-system-zli
b --enable-interpreter --enable-threads=posix --enable-java-gc=boehm --enable-sj
lj-exceptions --disable-version-specific-runtime-libs --disable-win32-registry
Thread model: posix
gcc version 3.3.3 (cygwin special)
Do you think I should use 3.2.2 with a clean cygwin/toolchain install instead? It may resolve the other problems I was having ("forgot" that some of this is still partially done without the ps2 toolchain)

At any rate, I went through the entire libpng and fixed the nothing after || and nothing after && errors I was getting, here is a copy (I tested it on a ps2v9 with a 255kb test file)- also I modded the makefile to point to the ports dir in the sdk for zlib, as well as including a install section in the makefile.

Many files were changed to fix the above error, Id give you a diff file but Im not able to get diff to output anything useful for me just yet (my next learning experience I guess...)

fixed up libpng rar'd

Posted: Fri Mar 11, 2005 2:26 am
by cory1492
hrrm, wonder if that could be the reason my ee-objdump gives no info on disassembly of something I built with the ee toolchain...

Code: Select all

$ ee-objdump -d syscall.elf
syscall.elf:     file format elf32-littlemips

Disassembly of section .text:

00100000 <_ftext>&#58;
  100000&#58;	e0 ff bd 27 	*unknown*
  100004&#58;	10 00 02 3c 	*unknown*
  100008&#58;	10 00 bf ff 	*unknown*
  10000c&#58;	00 00 b0 ff 	*unknown*
  100010&#58;	00 68 43 90 	*unknown*
  100014&#58;	0f 00 60 14 	*unknown*
  100018&#58;	10 00 10 3c 	*unknown*
  10001c&#58;	04 5a 02 8e 	*unknown*
etc. --> always *unknown*

Posted: Fri Mar 11, 2005 2:33 am
by evilo
since the GCC patches are made for the GCC 3.2.2... yes definitely !

Posted: Fri Mar 11, 2005 3:15 am
by cory1492
hrmm, the 3.2.2 is no longer available to the cygwin installer as far as I can tell. I bet that would resolve all the problems Im having right now though :)

arent the patches done to 3.2.2 to get the toolchain ee-gcc and iop-gcc only though?
$ ee-gcc -v
Reading specs from /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/specs
Configured with: ../configure --prefix=/usr/local/ps2dev/ee --target=ee --enable
-languages=c,c++ --with-newlib --with-headers=/usr/local/ps2dev/ee/ee/include --
enable-cxx-flags=-G0
Thread model: single
gcc version 3.2.2

$ iop-gcc -v
Reading specs from /usr/local/ps2dev/iop/lib/gcc-lib/iop/3.2.2/specs
Configured with: ../configure --prefix=/usr/local/ps2dev/iop --target=iop --enab
le-languages=c --with-newlib --without-headers
Thread model: single
gcc version 3.2.2

Posted: Fri Mar 11, 2005 3:19 am
by evilo
use the oopo script : http://www.oopo.net/consoledev/

it will download & install everything you need (including gcc)

be sure to have wget and cvs installed (check the cygwin packages)

good work !

Posted: Fri Mar 11, 2005 3:20 am
by cory1492
see above evilo, thanks for helping out BTW

using up to date cygwin with the toolchain installed by oopos script, perhaps I should not install the gcc when I install cygwin?

Posted: Fri Mar 11, 2005 3:27 am
by evilo
ohh.. yes, you have gcc 3.2.2 patched already ;)

so no, you don't need it install it from cygwin, since concerning the PS2, the oopo script will download it from gnu and install/patch it.. !

be sure to compile with ee-gcc (if you target the EE) and not gcc ... , see makefile in the SDK for proper examples...

[EDIT]
just readed again your first post.. and everything is fine...
I just got confused after when you mentioned gcc 3.3.3 and thougth you made some kind of custom install !

Posted: Fri Mar 11, 2005 3:30 am
by cory1492
could that be the problem then, some of libpng is compiling under gcc 3.3.3 and the rest under ee-gcc?

It works fine now with those \ taken out but I have been having other problems that just seem odd to me...

custom install, rofl - Im not that good yet :)

Posted: Fri Mar 11, 2005 8:48 am
by mharris
cory1492 wrote:hrrm, wonder if that could be the reason my ee-objdump gives no info on disassembly of something I built with the ee toolchain...

Code: Select all

$ ee-objdump -d syscall.elf
syscall.elf&#58;     file format elf32-littlemips

Disassembly of section .text&#58;

00100000 <_ftext>&#58;
  100000&#58;	e0 ff bd 27 	*unknown*
  100004&#58;	10 00 02 3c 	*unknown*
  100008&#58;	10 00 bf ff 	*unknown*
  10000c&#58;	00 00 b0 ff 	*unknown*
  100010&#58;	00 68 43 90 	*unknown*
  100014&#58;	0f 00 60 14 	*unknown*
  100018&#58;	10 00 10 3c 	*unknown*
  10001c&#58;	04 5a 02 8e 	*unknown*
etc. --> always *unknown*
This is a bug in ee-binutils that I introduced back in January :-( See the thread in the toolchain forum for more info. Basically, "ee-objdump -d" is broken in the ps2toolchain in CVS.

Hint: Much of the time, "iop-objdump -d" should work for you, as most of the opcodes are the same.

I have a patch ready to submit when I get home, if my kids let me.