Opened 14 years ago

Closed 13 years ago

Last modified 17 months ago

#8562 closed patch

WINCE: gcc compile fix

Reported by: lordhoto Owned by: SF/knakos
Priority: normal Component: Port: WinCE
Keywords: Cc:


This patch adds support for compiling the wince port with a gcc cross toolchain, I used this one: maybe it works with others, but maybe it needs some modifications. It compiles fine and starts up on my PocketPC 2002 device, but I was only able to run old scumm games like Indy3 or Loom EGA, no idea why though.

Things to be done:

- $AR $RANLIB are not checked those need to be overrewritten in after configure run to arm-wince-pe-ar and arm-wince-pe-ranlib - check why some games just crash it - make distclean doesn't clean up all dep dirs, needs to be changed - hack for PocketSCUMM.rc handling in Makefile, maybe move to backend specific dir

I hope it's any useful for further work, maybe I'll try to fix some things though.

Ticket imported from: #1531780. Ticket imported from: patches/667.

Attachments (2)

wince-gcc-v1.patch.gz (6.5 KB ) - added by lordhoto 14 years ago.
patch v1 against svn from 20060731
wince-gcc-v2.patch.gz (12.0 KB ) - added by lordhoto 14 years ago.
patch v1 against svn from 20060801

Download all attachments as: .zip

Change History (14)

by lordhoto, 14 years ago

Attachment: wince-gcc-v1.patch.gz added

patch v1 against svn from 20060731

comment:1 by lordhoto, 14 years ago

I just noticed that there are some gfx glitches like not restored mouse cursor and such, that could be a backend specific problem or a problem of the used SDL version.

by lordhoto, 14 years ago

Attachment: wince-gcc-v2.patch.gz added

patch v1 against svn from 20060801

comment:2 by lordhoto, 14 years ago

The gfx glitches were more or less a problem with the SDL version of the toolchain, I compiled a new version with Arismes patches (GAPI works fine now, maybe a WinDIB specific problem, since the old version didn't use GAPI), still SDL_FLIPVIDEO isn't defined by that version, so the second landscape mode doesn't work. I guess the patches for that were never made public (or I don't know where).

I fixes the problems with 'leftover' .deps dirs after a make distclean. Games don't crash anymore, was a problem of missing SCUMM_NEED_ALIGMENT define.

I fixes some formatting problems, added some default cases and other minor stuff like that. I also added that output from stdout and stderr will be redirected to \scummvm_stdout.txt and \scummvm_stderr.txt the former method doesn't work for my (maybe it doesn't even work for the offical build, no idea).

Things left to fix: - $AR $RANLIB are not checked those need to be overrewritten in after configure run to arm-wince-pe-ar and arm-wince-pe-ranlib - hack for PocketSCUMM.rc handling in Makefile, move to backend specific dir - check if there is any possibility to catch wince exceptions, __try and __except as done with eVC doesn't work.

Here's the new patch. (If someone is interested in the updated toolchain + all the libs feel free to mail me, it works just with cygwin though)

comment:3 by fingolfin, 14 years ago

Extremly minor tidbit I noticed: Your patch to gui/ seems to add theme-config.o a second time=

Also, I commited a change some hours ago that corrected various broken #include "backend/FOO" statements, which partially collides with your patch. Maybe you can attach a new one?

comment:4 by SF/knakos, 14 years ago

I've toyed myself with gcc building of pocketscumm, using two toolchains: a) the debian pocketgcc package (3.x.x), and b) the vlc port of gcc for pocketpc (4.1.0 experimental). In case (a) the toolchain is severely limited in terms of ce header adequacy, while in (b) the build completes ok. But there are indications of wrong code emission, failure to execute properly prebuilt libs and, less importantly, exception handling (I rebuilt some of the needed libraries with the gcc toolchain). LordHoto reports that this version also suffers from crashes at "random" points, which may be bad emitted code or ce backend/lib problems. As I've seen this thing happen numerous times, I believe it's a gcc related issue.

Given my not-so-fond recent memories of this process (especially debugging), I will be considering this an ongoing, background job for me. One more thing to check is the cegcc toolchain (4.1.1). I will committing any changes only to the trunk, and iff there are positive results.

comment:5 by lordhoto, 14 years ago

Did you update the patch yourself now? Or shall I still attach a new patch version?

One place which seems to fail is the VOC player I get wrong read values there.

comment:6 by fingolfin, 14 years ago

What is the status of this item?

comment:7 by fingolfin, 14 years ago

Status: newpending

comment:8 by SF/knakos, 14 years ago

Randomly put together - bear with me:

1) Recent findings: CE Scummvm only compiles with vs2005 which is a non-free tool. Migrating to gcc untangles us of the mess of ms toolchains.

2) It seems that the vlc gcc toolchain is the better bet from all available toolchains. I hit a rather hard wall there (no static member init), but after advice from joostp & DJWillis we are through that one.

3) I've upped the priority of this issue in my internal todo list. It is now, more or less, most of what I do for scummvm. I'm not committing anything to the repository until a have a (semi) stable version.

4) Although my efforts started before LordHoto submitted this patch, leading to me having a similar codebase already, I will be integrating some of his stuff into the final patch.

5) Current status: The wince-gcc port is shaping up nicely. Games are playable. Currently I'm having some problems with the tremor library. It is my estimation that it's nearing completion.

6) The patch will go into the trunk of course and not the 0.9.0 branch.

7) After things have stabilized a bit, I'm gonna go into a beta test period to ensure nothing bad is broken in the port.

8) Initially it seems the binary size increases with gcc build, while on the other hand we get a hefty speed increase (subjective measurement).

9) Of course, I'm talking about a "complete" gcc compilation effort, including all dependent libraries (mad, tremor, mpeg2dec, sdl and zlib).

10) The compilation process will also be documented in the Wiki including links to modified lib files, and prebuilt lib images.

Until the initial commit happens (no concrete timeframe yet due to the nature of the "bugs"; let's say in the order of magnitude of months :-) ) I'm keeping this one open.

comment:9 by SF/knakos, 14 years ago

Status: pendingnew

comment:10 by SF/knakos, 13 years ago

Status: newclosed

comment:11 by SF/knakos, 13 years ago

Partially accepted. Thanks for your hard work Lordhoto.

comment:12 by digitall, 17 months ago

Component: Port: WinCE
Note: See TracTickets for help on using tickets.