Discussion:
Q: should it work?
Danny Backx
2006-03-31 18:55:09 UTC
Permalink
Hi,

I've been playing with Shaun's work on the gcc/newlib/binutils combo to
cross-compile stuff for my PocketPC.

That worked rather well, but I wanted to move on to newer tools before
putting much effort in improving the current stuff.

So I "upgraded" to gcc 4.1, newlib 1.14, and binutils 2.16 .

And now I can't recompile and run even the most simple program.

Are there obvious pitfalls or should it "just work" ?

Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Shaun Jackman
2006-03-31 19:56:19 UTC
Permalink
Hello Danny,

gas (binutils) > 2.13.2.1 has a known issue assembling DLLs for wince.
They assemble without errors but won't run. I should say the existance
of an issue is known, but the nature of the issue is a bit of a
mystery.

The last version of the rest of binutils (not gas) I tried was 2.15.
There's no reason updating to a recent version shouldn't work, but I
haven't tried it. The last version of GCC I tried was 3.4.2. The same
goes for it.

The upstream newlib sources do not contain newlib/libc/sys/wince,
which is only available as a patch either from me (through Debian in
the package pocketpc-gcc) or from Craig Vanderborgh (through Voxware
in the package GNUWINCE).

I haven't worked on the Pocket PC (WinCE) platform in some time, but
Craig actively works on it, and Eric House will hopefully be taking
over the Debian package from me.

Cheers,
Shaun
Post by Danny Backx
Hi,
I've been playing with Shaun's work on the gcc/newlib/binutils combo to
cross-compile stuff for my PocketPC.
That worked rather well, but I wanted to move on to newer tools before
putting much effort in improving the current stuff.
So I "upgraded" to gcc 4.1, newlib 1.14, and binutils 2.16 .
And now I can't recompile and run even the most simple program.
Are there obvious pitfalls or should i
Danny Backx
2006-04-01 13:14:46 UTC
Permalink
Shaun,

Thanks a lot for your quick answer.

I must admit I didn't look good enough at the voxware site to figure out
that the tar files are still there, even though the install directory
pointed to by the gnuwince.html page is missing.

A quick resume of what I found and experienced this far :
- I started using Shauns stuff from the debian ftp server a while ago
(I'm not using Debian so I recompiled it.)
- Even though Shaun says this cannot be used to build apps that provide
a windows user interface, I've been able to do so (but not every
windowing API appears to work).
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
I was thinking about doing that, but am inclined to start off with a
more up to date source distribution, to at least have a chance on the
GCC/binutils folks pick up the patches.

By the way I have a standard PocketPC (a Mio 168) and a PC with
Mandriva, and I'd like to develop GUI apps for the PocketPC. As an
experiment I'm porting Xinvest (http://xinvest.sunsite.dk).

What I am missing :
- Documentation so I know what I'm doing (to be honest, I've been doing
some trial and error, there has to be a better way).
I'd like to find out more about the processor (how do you program
it in assembler, what's the ABI, ..). Also I don't have much info
on how WinCE really works on this hardware.
- Explanation about the limitations I'm experiencing. I realise that
the answer I may get is "we don't know".
- A bit of help in getting the new software releases operational, but
maybe the first thing to do there is figure out which part is broken.
(Shaun suggests it is gas, but I've blindly upgraded all three
softwares - gcc, binutils, newlib - so the first thing I should do is
assess which one is causing the problem.)
- For this last bit : should I theoretically be able to pick up the
wince stuff from either Shaun's debian distribution or the voxware
stuff, or are there more up to date versions of that ?

Suggestions ?

Danny
Post by Shaun Jackman
Hello Danny,
gas (binutils) > 2.13.2.1 has a known issue assembling DLLs for wince.
They assemble without errors but won't run. I should say the existance
of an issue is known, but the nature of the issue is a bit of a
mystery.
The last version of the rest of binutils (not gas) I tried was 2.15.
There's no reason updating to a recent version shouldn't work, but I
haven't tried it. The last version of GCC I tried was 3.4.2. The same
goes for it.
The upstream newlib sources do not contain newlib/libc/sys/wince,
which is only available as a patch either from me (through Debian in
the package pocketpc-gcc) or from Craig Vanderborgh (through Voxware
in the package GNUWINCE).
I haven't worked on the Pocket PC (WinCE) platform in some time, but
Craig actively works on it, and Eric House will hopefully be taking
over the Debian package from me.
Cheers,
Shaun
Post by Danny Backx
Hi,
I've been playing with Shaun's work on the gcc/newlib/binutils combo to
cross-compile stuff for my PocketPC.
That worked rather well, but I wanted to move on to newer tools before
putting much effort in improving the current stuff.
So I "upgraded" to gcc 4.1, newlib 1.14, and binutils 2.16 .
And now I can't recompile and run even the most simple program.
Are there obvious pitfalls or should it "just work" ?
Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Shaun Jackman
2006-04-02 00:11:05 UTC
Permalink
Post by Danny Backx
Shaun,
Thanks a lot for your quick answer.
I must admit I didn't look good enough at the voxware site to figure out
that the tar files are still there, even though the install directory
pointed to by the gnuwince.html page is missing.
http://win-ce.voxware.com:28575/Development%20Tools/gnuwince.html
Post by Danny Backx
- I started using Shauns stuff from the debian ftp server a while ago
(I'm not using Debian so I recompiled it.)
- Even though Shaun says this cannot be used to build apps that provide
a windows user interface, I've been able to do so (but not every
windowing API appears to work).
Eric House is also using the pocketpc-gcc toolchain to build Win32 API
code. On this topic, he would be the person with whom to speak.
Post by Danny Backx
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
To use the GUI API, you've probably attacked the same problems as
Eric. Get in touch with him.
Post by Danny Backx
I was thinking about doing that, but am inclined to start off with a
more up to date source distribution, to at least have a chance on the
GCC/binutils folks pick up the patches.
I absolutely agree with moving to a newer toolchain. The toolchain
only stopped because it was the last version with which *I* developed.
Post by Danny Backx
By the way I have a standard PocketPC (a Mio 168) and a PC with
Mandriva, and I'd like to develop GUI apps for the PocketPC. As an
experiment I'm porting Xinvest (http://xinvest.sunsite.dk).
An X11 app! Very ambitious. Which X server will you use? I'd think a
GTK+DirectFB application would be easier.
Post by Danny Backx
- Documentation so I know what I'm doing (to be honest, I've been doing
some trial and error, there has to be a better way).
There's no documentation. Reading the source is the only way to reach
enlightenment. newlib/libc/sys/wince and pocketpc-sdk will be good
reading.
Post by Danny Backx
I'd like to find out more about the processor (how do you program
it in assembler, what's the ABI, ..). Also I don't have much info
on how WinCE really works on this hardware.
The processor is an ARM sumpin sumpin (Intel StrongARM mebbe).

The ABI may be the standard ARM ABI:

http://www.arm.com/products/DevTools/ABI.html

I have no idea what syscall ABI the Pocket PC uses. In my discussion
with Eric on this topic, we concluded that the machine syscall
interface (SWI probably) may or may not be a rather fast moving and
unpredictable target, which is usually wrapped by coredll.dll to such
a degree that you should consider calling the coredll.dll API the
syscall interface.
Post by Danny Backx
- Explanation about the limitations I'm experiencing. I realise that
the answer I may get is "we don't know".
I suppose this depends on what limitations you have encountered.
Post by Danny Backx
- A bit of help in getting the new software releases operational, but
maybe the first thing to do there is figure out which part is broken.
(Shaun suggests it is gas, but I've blindly upgraded all three
softwares - gcc, binutils, newlib - so the first thing I should do is
assess which one is causing the problem.)
gas is broken only when building a DLL. In what manner is the
toolchain not working for you?
Post by Danny Backx
- For this last bit : should I theoretically be able to pick up the
wince stuff from either Shaun's debian distribution or the voxware
stuff, or are there more up to date versions of that ?
The pocketpc-gcc toolchain uses newer version of the upstream software
than GNUWINCE. Voxware, however, has some binary tarballs of the
toolchain that might help you hit the ground running. Although, if you
unpack the .deb packages, I suppose you could call those the same
thing.
Post by Danny Backx
Suggestions ?
Eat more r
eehouse
2006-04-02 07:18:47 UTC
Permalink
Post by Shaun Jackman
Eric House is also using the pocketpc-gcc toolchain to build Win32 API
code. On this topic, he would be the person with whom to speak.
Happy to help if I can.

As Shaun says, I've been focussed on moving an app that was originally
developed with "Embedded Visual Studio" to the Debian pocketpc tools
that Shaun maintains. I'm working with an app that's written using the
standard win32 APIs, rather than porting posix code to Wince, say.
Post by Shaun Jackman
Post by Danny Backx
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
To use the GUI API, you've probably attacked the same problems as
Eric. Get in touch with him.
There have been two classes of problems, IIRC.

First, the pocketpc tools rely on headers supplied by the MinGW
project which is entirely focussed on desktop win32 systems.
Microsoft supplies different headers for the two platforms for good
reason: sometimes the APIs and structures are subtly different. For
example, some functions that are exported by .dlls on the desktop are
inline macros on pocketpc. And some structs, though they have the
same name, are defined differently, perhaps with fields removed that
don't make sense on a handheld.

The second class of problem is that the official tools cooperate with
the OS in undocumented or unexpected ways. For example, an app built
with evc 3 will always be run in "emulated" mode on a PPC 2003 device.
That's generally not what you want (if you're using menus, anyway), so
you want to appear to have been built with more recent tools. The way
the OS determines what toolset built the app is by the major and minor
version flags in the .pe file header (in the .exe). The only way to
figure out what the flags should be is to examine an app or .dll that
works and set yours the same.
Post by Shaun Jackman
Post by Danny Backx
I was thinking about doing that, but am inclined to start off with a
more up to date source distribution, to at least have a chance on the
GCC/binutils folks pick up the patches.
I absolutely agree with moving to a newer toolchain. The toolchain
only stopped because it was the last version with which *I* developed.
I'd also like to see us move to the most recent stable toolchain.
Emphasis on "stable", though. I'm trying to ship a PPC app, not ask
my users to help find gcc bugs. The current toolchain seems to work
as far as I've pushed it, but the project benefits by appealing to as
many potential developers as possible.
Post by Shaun Jackman
Post by Danny Backx
By the way I have a standard PocketPC (a Mio 168) and a PC with
Mandriva, and I'd like to develop GUI apps for the PocketPC. As an
experiment I'm porting Xinvest (http://xinvest.sunsite.dk).
An X11 app! Very ambitious. Which X server will you use? I'd think a
GTK+DirectFB application would be easier.
Post by Danny Backx
- Documentation so I know what I'm doing (to be honest, I've been doing
some trial and error, there has to be a better way).
There's no documentation. Reading the source is the only way to reach
enlightenment. newlib/libc/sys/wince and pocketpc-sdk will be good
reading.
I'm not sure if you're trying to do the same things, but you're
welcome to take a look at the Makefile for my app. (Ignore the
comments at the top. They're stale. I'd fix 'em, but CVS is down on
sourceforge. And I think I'm switching to subversion anyway....)

http://cvs.sourceforge.net/viewcvs.py/xwords/xwords4/wince/Makefile?rev=1.12&view=markup

At the moment, it builds perfectly (it's even a bit smaller than when
built with eVC), but only on my machine. I've submitted patches to
the MinGW project to modify the headers for PPC but the patches have
not yet been accepted.
Post by Shaun Jackman
Post by Danny Backx
I'd like to find out more about the processor (how do you program
it in assembler, what's the ABI, ..). Also I don't have much info
on how WinCE really works on this hardware.
The processor is an ARM sumpin sumpin (Intel StrongARM mebbe).
http://www.arm.com/products/DevTools/ABI.html
I have no idea what syscall ABI the Pocket PC uses. In my discussion
with Eric on this topic, we concluded that the machine syscall
interface (SWI probably) may or may not be a rather fast moving and
unpredictable target, which is usually wrapped by coredll.dll to such
a degree that you should consider calling the coredll.dll API the
syscall interface.
I have not attempted to program below the Win32 API level. At some
point I'd like to try compiling THUMB code, but that's as low as I'll
go. Actually, that's not quite true. I also ship on Palm, and
compile for ARM there too. It'd be great if some part of the app
could be identical for both, but there's too little gained to justify
any work in that direction. Palm *as an ARM platform* is an even
faster moving target than PPC.

--Eric
--
******************************************************************************
* From the desktop of: Eric House, ***@eehouse.org *
* Crosswords 4.1.4 for PalmOS now ARM-native: xwords.sourceforge.net *
******************************************************************************
Danny Backx
2006-04-02 10:42:31 UTC
Permalink
Post by eehouse
Post by Shaun Jackman
Eric House is also using the pocketpc-gcc toolchain to build Win32 API
code. On this topic, he would be the person with whom to speak.
Happy to help if I can.
As Shaun says, I've been focussed on moving an app that was originally
developed with "Embedded Visual Studio" to the Debian pocketpc tools
that Shaun maintains. I'm working with an app that's written using the
standard win32 APIs, rather than porting posix code to Wince, say.
That's very close to what I'm doing.
Post by eehouse
Post by Shaun Jackman
Post by Danny Backx
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
To use the GUI API, you've probably attacked the same problems as
Eric. Get in touch with him.
There have been two classes of problems, IIRC.
First, the pocketpc tools rely on headers supplied by the MinGW
project which is entirely focussed on desktop win32 systems.
Microsoft supplies different headers for the two platforms for good
reason: sometimes the APIs and structures are subtly different. For
example, some functions that are exported by .dlls on the desktop are
inline macros on pocketpc. And some structs, though they have the
same name, are defined differently, perhaps with fields removed that
don't make sense on a handheld.
As I wrote in the other message, this may be why I can't create dialogs.
Post by eehouse
The second class of problem is that the official tools cooperate with
the OS in undocumented or unexpected ways. For example, an app built
with evc 3 will always be run in "emulated" mode on a PPC 2003 device.
That's generally not what you want (if you're using menus, anyway), so
you want to appear to have been built with more recent tools. The way
the OS determines what toolset built the app is by the major and minor
version flags in the .pe file header (in the .exe). The only way to
figure out what the flags should be is to examine an app or .dll that
works and set yours the same.
Interesting, I'll have a look.

Do you have a clue on why I'm seeing two sets of window bars (one at the
top, one at the bottom) ?

Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Danny Backx
2006-04-02 10:37:54 UTC
Permalink
I've cut out some of the pieces, and answered/followed up on others.
Post by Shaun Jackman
Post by Danny Backx
I must admit I didn't look good enough at the voxware site to figure out
that the tar files are still there, even though the install directory
pointed to by the gnuwince.html page is missing.
http://win-ce.voxware.com:28575/Development%20Tools/gnuwince.html
On line 8 of this document (in my browser, not the source), the link to
the "current release" is broken.
Post by Shaun Jackman
An X11 app! Very ambitious. Which X server will you use? I'd think a
GTK+DirectFB application would be easier.
Actually I'm stripping out the X and building a WinCE GUI on it, so I'm
re-using the application logic.
Post by Shaun Jackman
http://www.arm.com/products/DevTools/ABI.html
Thanks, I'll start reading that and the source while I do experiments.
Post by Shaun Jackman
Post by Danny Backx
- Explanation about the limitations I'm experiencing. I realise that
the answer I may get is "we don't know".
I suppose this depends on what limitations you have encountered.
I'll try to summarize here :
- Recompiled Shaun's stuff (Mandriva is RPM based, not DEB)
- I've been able to create and run GUI apps, but I had to work around
having WinMain() and no main() by still having an empty main()
function but telling the compiler to use _WinMain as the entry point
of the executable (gcc -e_WinMain)
I'd like to replace this by something more sensible.
- Also the current approach will only work for C, not C++.
- Had to remove the rename.o from the newlib libc.a because it clashed
with unistd.o, the both define the _rename symbol.
- I built include files based on the ones I found on my system from
wine. I've really taken over most of the wine files except where I
got in trouble using them, and edited them somewhat.
An example is that the TabCtrl_XX() macros all map to SendMessageA()
which is wrong for CE, it should use SendMessageW().
- I used Shauns SDK and extended it to generate libaygshell.a,
libcomctrl.a and libfileopen.a on a 'need to have' basis.
I'm not sure what I'm doing here but some things appear to work.

Limitations I see :
- I don't have a solution for icons/images in the build process yet.
- A simplistic drawing example compiled with eVC4 creates a 5K exe
file, my toolchain creates an exe of about 186K.
- Can't get dialog creation functions to work.
Erics mail makes me wonder whether this is another include file
issue.
- Tabs respond in strange ways, but maybe I need to use eVC4 on my
sources to check whether the problem is in my sources or in the
tools.
- I don't have a debugger
- Tools based on new GCC/binutils/newlib create apps that crash my PDA.
Here I'd have to start by figuring out which of the three tools is
the reason.
- The apps I create do run, but they appear to create a non-standard
toolbar. Not sure what's causing this.
Post by Shaun Jackman
Eat more rice pudding. It's tasty.
Hmm, I baked an almond cake a couple of days ago, there's still some :-)

Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
eehouse
2006-04-02 15:51:49 UTC
Permalink
Post by Danny Backx
I've cut out some of the pieces, and answered/followed up on others.
Good idea. I'll just keep what I can answer.
Post by Danny Backx
Post by Shaun Jackman
I suppose this depends on what limitations you have encountered.
- Recompiled Shaun's stuff (Mandriva is RPM based, not DEB)
- I've been able to create and run GUI apps, but I had to work around
having WinMain() and no main() by still having an empty main()
function but telling the compiler to use _WinMain as the entry point
of the executable (gcc -e_WinMain)
That may be better than what I had to do:

#ifdef __GNUC__
int
main()
{
return WinMain( GetModuleHandle(NULL), 0,
#if defined TARGET_OS_WINCE
GetCommandLineW(),
#elif defined TARGET_OS_WIN32
GetCommandLineA(),
#endif
SW_SHOWDEFAULT );
}
#endif
Post by Danny Backx
I'd like to replace this by something more sensible.
WinMain should be an acceptable entrypoint out-of-the box, without
any special flags to gcc. MinGW already allows this.
Post by Danny Backx
- Had to remove the rename.o from the newlib libc.a because it clashed
with unistd.o, the both define the _rename symbol.
There's currently a whole set of function names that get munged to
avoid a conflict. The windows side gets renamed, e.g. M$_select() for
select(). I've accomodated this with macros on the PPC side, but
since the same code compiles for win32 (mingw again) without the
munging there's clearly a better way.
Post by Danny Backx
- I built include files based on the ones I found on my system from
wine. I've really taken over most of the wine files except where I
got in trouble using them, and edited them somewhat.
An example is that the TabCtrl_XX() macros all map to SendMessageA()
which is wrong for CE, it should use SendMessageW().
Yep. I posted to the mingw list back in January explaining that
pocketpc dev tools were using their headers and needed some changes
and asking if they'd prefer that we submit patches or fork. They were
enthusiastic in prefering the first. I then submitted a patch
following their directions and nobody was even assigned to it for a
month. It's not a priority for them because there are so few PPC
developers using their stuff. Maybe if more of us complain... :-)

The patch is here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1426209&group_id=2435&atid=302435

I just did a cvs-update on the mingw include sources I've modified,
and there are no conflicts. I think this means the patch will still
apply cleanly.
Post by Danny Backx
- I used Shauns SDK and extended it to generate libaygshell.a,
libcomctrl.a and libfileopen.a on a 'need to have' basis.
I'm not sure what I'm doing here but some things appear to work.
I've already done this for the most recent version of the pocketpc-sdk
.deb. And my mingw patch adds the necessary headers.
Post by Danny Backx
- I don't have a solution for icons/images in the build process yet.
Crosswords (my app) uses lots of icons. See the source.
Post by Danny Backx
- A simplistic drawing example compiled with eVC4 creates a 5K exe
file, my toolchain creates an exe of about 186K.
My app's a tiny bit smaller than the last version I built with evc4,
but two caveats. First, when I moved from evc3 to evc4 it jumped from
about 100K to the current ~170K. I believed the change was due to
different compiler flags being default, but every time I tweaked them
I got a crashing binary. Still, it's clearly possible for the binary
to be much smaller.

Second, there is a lot of cruft in the .a files that could be
eliminated. Run 'strings' on a stripped .exe to see all the debugging
code, for example.
Post by Danny Backx
- Can't get dialog creation functions to work.
Works for me with the mingw patches.
Post by Danny Backx
Erics mail makes me wonder whether this is another include file
issue.
The only struct that's flat-out wrong for PPC (that I've encountered,
that is; I haven't done an audit) is WIN32_FIND_DATA. But
DialogBoxParam is one of the functions that's not in the .dll and must
be implemented (via an inline, typically) locally. My impl is in the
sources, but should eventually be moved into a library that's part of
the sdk. Or incorporated in another patch to the mingw headers.

But that's not your problem: if you were trying to call the function
in the .dll your app wouldn't load at all.
Post by Danny Backx
- I don't have a debugger
That sucks most of all! It's pretty easy to keep code working on both
win32 and ppc to use whatever debugging Wine provides, but I do wonder
if I could have developed this app from scratch without eVC. Most of
my code is cross-platform, so I can debug it on Linux or Palm where I
have gdb, but for some issues logfile-based debugging is a very slow
process. Oh, and an emulator would be nice too. :-)
Post by Danny Backx
- The apps I create do run, but they appear to create a non-standard
toolbar. Not sure what's causing this.
That's because by default the linker flags them as Wince apps rather
than PocketPC 2003, which was the first to put the menubar at the
bottom. From my Makefile:

LFLAGS += -Wl,--major-subsystem-version,4,--minor-subsystem-version,20
Post by Danny Backx
Post by Shaun Jackman
Eat more rice pudding. It's tasty.
Hmm, I baked an almond cake a couple of days ago, there's still some :-)
'Round here we settle for pumpkin pie and ice cream.

--Eric
--
******************************************************************************
* From the desktop of: Eric House, ***@eehouse.org *
* Crosswords 4.1.4 for PalmOS now ARM-native: xwords.sourceforge.net *
******************************************************************************
Pedro Alves
2006-04-02 00:30:55 UTC
Permalink
Post by Danny Backx
Shaun,
Thanks a lot for your quick answer.
I must admit I didn't look good enough at the voxware site to figure out
that the tar files are still there, even though the install directory
pointed to by the gnuwince.html page is missing.
- I started using Shauns stuff from the debian ftp server a while ago
(I'm not using Debian so I recompiled it.)
- Even though Shaun says this cannot be used to build apps that provide
a windows user interface, I've been able to do so (but not every
windowing API appears to work).
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
I was thinking about doing that, but am inclined to start off with a
more up to date source distribution, to at least have a chance on the
GCC/binutils folks pick up the patches.
By the way I have a standard PocketPC (a Mio 168) and a PC with
Mandriva, and I'd like to develop GUI apps for the PocketPC. As an
experiment I'm porting Xinvest (http://xinvest.sunsite.dk).
- Documentation so I know what I'm doing (to be honest, I've been doing
some trial and error, there has to be a better way).
I'd like to find out more about the processor (how do you program
it in assembler, what's the ABI, ..). Also I don't have much info
on how WinCE really works on this hardware.
- Explanation about the limitations I'm experiencing. I realise that
the answer I may get is "we don't know".
- A bit of help in getting the new software releases operational, but
maybe the first thing to do there is figure out which part is broken.
(Shaun suggests it is gas, but I've blindly upgraded all three
softwares - gcc, binutils, newlib - so the first thing I should do is
assess which one is causing the problem.)
- For this last bit : should I theoretically be able to pick up the
wince stuff from either Shaun's debian distribution or the voxware
stuff, or are there more up to date versions of that ?
Suggestions ?
Danny
Post by Shaun Jackman
Hello Danny,
gas (binutils) > 2.13.2.1 has a known issue assembling DLLs for wince.
They assemble without errors but won't run. I should say the existance
of an issue is known, but the nature of the issue is a bit of a
mystery.
The last version of the rest of binutils (not gas) I tried was 2.15.
There's no reason updating to a recent version shouldn't work, but I
haven't tried it. The last version of GCC I tried was 3.4.2. The same
goes for it.
The upstream newlib sources do not contain newlib/libc/sys/wince,
which is only available as a patch either from me (through Debian in
the package pocketpc-gcc) or from Craig Vanderborgh (through Voxware
in the package GNUWINCE).
I haven't worked on the Pocket PC (WinCE) platform in some time, but
Craig actively works on it, and Eric House will hopefully be taking
over the Debian package from me.
Cheers,
Shaun
Post by Danny Backx
Hi,
I've been playing with Shaun's work on the gcc/newlib/binutils combo to
cross-compile stuff for my PocketPC.
That worked rather well, but I wanted to move on to newer tools before
putting much effort in improving the current stuff.
So I "upgraded" to gcc 4.1, newlib 1.14, and binutils 2.16 .
And now I can't recompile and run even the most simple program.
Are there obvious pitfalls or should it "just work" ?
Danny
Hi Danny!

A few months ago I started doing the same thing. I forward ported all
the patches I could find to gcc/binutils/newlib/gdb into the newest
head/trunk versions
of those projects. My goal was to get Qt4 working for Pocket PC. I have
successfully ported it, although I never made public announcement, in any
Qt or kde channel ;) I first wanted to port the sql module. So I say
GUIs are quite possible ;)

Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
As for newlib, most of the work is based on Craig's (from Voxware) work.
I am now in contact with him, and plan on merging my changes
with his version (Hi Craig ;) ).

I am just now preparing for cegcc-0.0.2 release. I should upload it
tomorrow.

It would be great if we could join every effort in getting gnu tools
working for wince.

Cheers,
Pedro Alves
Danny Backx
2006-04-02 10:46:03 UTC
Permalink
Post by Pedro Alves
Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
Thanks,

My first thing to check is whether the recent binutils is also the
source of my problems.

Where can I see the sources of your project? Nothing appears through the
WebCVS and similar interfaces.

Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
eehouse
2006-04-02 15:11:19 UTC
Permalink
Post by Danny Backx
Post by Pedro Alves
Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
Thanks,
My first thing to check is whether the recent binutils is also the
source of my problems.
Where can I see the sources of your project? Nothing appears through the
WebCVS and similar interfaces.
Their CVS server has been having problems lately, though code browsing
was working for me last night. At any rate, the source tarball
associated with the most recent PPC beta is quite up-to-date.

http://prdownloads.sourceforge.net/xwords/wince41_b6_src.zip?download

--Eric
--
******************************************************************************
* From the desktop of: Eric House, ***@eehouse.org *
* Crosswords 4.1.4 for PalmOS now ARM-native: xwords.sourceforge.net *
******************************************************************************
p***@portugalmail.pt
2006-04-03 10:03:38 UTC
Permalink
Post by Danny Backx
Post by Pedro Alves
Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
Thanks,
My first thing to check is whether the recent binutils is also the
source of my problems.
Where can I see the sources of your project? Nothing appears through the
WebCVS and similar interfaces.
Danny
--
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info
Sorry for the delay!

Just released cegcc-0.0.2. Go check it at http://cegcc.berlios.de/
The sources are in the download section. There are also cygwin binaries available.

You think you have fast ADSL, until you realise what the A stands for...
Took me all night to upload the files to berlios, so I may have sliped something.
Please post any questions on this release at the
cegcc's mailing list. You will find it at the cegcc's berlios project page.

Cheers,
Pedro Alves

__________________________________________________________
O email preferido dos portugueses agora com
2 000 MB de espaço e acesso gratuito à Internet
http://www.portugalmail.pt/2000mb
Pedro Alves
2006-04-02 00:31:12 UTC
Permalink
Post by Danny Backx
Shaun,
Thanks a lot for your quick answer.
I must admit I didn't look good enough at the voxware site to figure out
that the tar files are still there, even though the install directory
pointed to by the gnuwince.html page is missing.
- I started using Shauns stuff from the debian ftp server a while ago
(I'm not using Debian so I recompiled it.)
- Even though Shaun says this cannot be used to build apps that provide
a windows user interface, I've been able to do so (but not every
windowing API appears to work).
- To do that, I've implemented some workarounds that I'd like to get rid
of. Also maybe some of the limitations can be lifted by further work.
I was thinking about doing that, but am inclined to start off with a
more up to date source distribution, to at least have a chance on the
GCC/binutils folks pick up the patches.
By the way I have a standard PocketPC (a Mio 168) and a PC with
Mandriva, and I'd like to develop GUI apps for the PocketPC. As an
experiment I'm porting Xinvest (http://xinvest.sunsite.dk).
- Documentation so I know what I'm doing (to be honest, I've been doing
some trial and error, there has to be a better way).
I'd like to find out more about the processor (how do you program
it in assembler, what's the ABI, ..). Also I don't have much info
on how WinCE really works on this hardware.
- Explanation about the limitations I'm experiencing. I realise that
the answer I may get is "we don't know".
- A bit of help in getting the new software releases operational, but
maybe the first thing to do there is figure out which part is broken.
(Shaun suggests it is gas, but I've blindly upgraded all three
softwares - gcc, binutils, newlib - so the first thing I should do is
assess which one is causing the problem.)
- For this last bit : should I theoretically be able to pick up the
wince stuff from either Shaun's debian distribution or the voxware
stuff, or are there more up to date versions of that ?
Suggestions ?
Danny
Post by Shaun Jackman
Hello Danny,
gas (binutils) > 2.13.2.1 has a known issue assembling DLLs for wince.
They assemble without errors but won't run. I should say the existance
of an issue is known, but the nature of the issue is a bit of a
mystery.
The last version of the rest of binutils (not gas) I tried was 2.15.
There's no reason updating to a recent version shouldn't work, but I
haven't tried it. The last version of GCC I tried was 3.4.2. The same
goes for it.
The upstream newlib sources do not contain newlib/libc/sys/wince,
which is only available as a patch either from me (through Debian in
the package pocketpc-gcc) or from Craig Vanderborgh (through Voxware
in the package GNUWINCE).
I haven't worked on the Pocket PC (WinCE) platform in some time, but
Craig actively works on it, and Eric House will hopefully be taking
over the Debian package from me.
Cheers,
Shaun
Post by Danny Backx
Hi,
I've been playing with Shaun's work on the gcc/newlib/binutils combo to
cross-compile stuff for my PocketPC.
That worked rather well, but I wanted to move on to newer tools before
putting much effort in improving the current stuff.
So I "upgraded" to gcc 4.1, newlib 1.14, and binutils 2.16 .
And now I can't recompile and run even the most simple program.
Are there obvious pitfalls or should it "just work" ?
Danny
Hi Danny!

A few months ago I started doing the same thing. I forward ported all
the patches I could find to gcc/binutils/newlib/gdb into the newest
head/trunk versions
of those projects. My goal was to get Qt4 working for Pocket PC. I have
successfully ported it, although I never made public announcement, in any
Qt or kde channel ;) I first wanted to port the sql module. So I say
GUIs are quite possible ;)

Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
As for newlib, most of the work is based on Craig's (from Voxware) work.
I am now in contact with him, and plan on merging my changes
with his version (Hi Craig ;) ).

I am just now preparing for cegcc-0.0.2 release. I should upload it
tomorrow.

It would be great if we could join every effort in getting gnu tools
working for wince.

Cheers,
Pedro Alves
Andy WU
2006-04-03 02:20:47 UTC
Permalink
Post by Pedro Alves
Hi Danny!
A few months ago I started doing the same thing. I forward ported all
the patches I could find to gcc/binutils/newlib/gdb into the newest
head/trunk versions
of those projects. My goal was to get Qt4 working for Pocket PC. I have
successfully ported it, although I never made public announcement, in any
Qt or kde channel ;) I first wanted to port the sql module. So I say
GUIs are quite possible ;)
Eventually I created a webpage for my effort so others could use it too.
Check out: http://cegcc.berlios.de/
I was never able to get a recent snapshot of binutils working correctly,
although I tried. Most of the problems were related to getting the
relocs done right.
I am now using the version from cvs20050202 + patches, gcc4.1.1trunk,
and newlib-cvs.
As for newlib, most of the work is based on Craig's (from Voxware) work.
I am now in contact with him, and plan on merging my changes
with his version (Hi Craig ;) ).
I am just now preparing for cegcc-0.0.2 release. I should upload it
tomorrow.
It would be great if we could join every effort in getting gnu tools
working for wince.
Cheers,
Pedro Alves
Hi Pedro,

I'm very glad to find this msg and I'm trying to solve the cross-gcc
problems all these days. I have tried the cegcc-0.0.1 package and your sample
code from the package works on my pocketpc. I find several problem:
1. The evc built exe can not load the dll built with cegcc, the program
freez and quit. The dll is only c library and does not contain any GUI codes.I
don't know how to solve this problem.
2. The cegcc source code does not compile with my cygwin. The binutils
compiles ok but the gcc package will not compile. The following is the error
message:

checking for arm-wince-pe-gcc...
/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/./gcc/xgcc
-B/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/./gcc/ -nostdinc
-B/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/arm-wince-pe/newlib/ -isystem
/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/arm-wince-pe/newlib/targ-include
-isystem /cygdrive/g/tmp/cross-cegcc/cegcc/gcc-trunk/newlib/libc/include
-B/usr/local/cegcc/arm-wince-pe/bin/ -B/usr/local/cegcc/arm-wince-pe/lib/
-isystem /usr/local/cegcc/arm-wince-pe/include -isystem
/usr/local/cegcc/arm-wince-pe/sys-include
setting gcc_no_link=yes
checking for C compiler default output file name... configure: error: C compiler
cannot create executables
See `config.log' for more details.

B.R.

Andy WU
p***@portugalmail.pt
2006-04-03 10:20:42 UTC
Permalink
Post by eehouse
Post by Shaun Jackman
I suppose this depends on what limitations you have encountered.
- Recompiled Shaun's stuff (Mandriva is RPM based, not DEB)
- I've been able to create and run GUI apps, but I had to work around
having WinMain() and no main() by still having an empty main()
function but telling the compiler to use _WinMain as the entry point
of the executable (gcc -e_WinMain)
#ifdef __GNUC__
int
main()
{
return WinMain( GetModuleHandle(NULL), 0,
#if defined TARGET_OS_WINCE
GetCommandLineW(),
#elif defined TARGET_OS_WIN32
GetCommandLineA(),
#endif
SW_SHOWDEFAULT );
}
#endif
Post by Shaun Jackman
I'd like to replace this by something more sensible.
WinMain should be an acceptable entrypoint out-of-the box, without
any special flags to gcc. MinGW already allows this.
cegcc-0.0.2 knows this too already.
Post by eehouse
Post by Shaun Jackman
- I built include files based on the ones I found on my system from
wine. I've really taken over most of the wine files except where I
got in trouble using them, and edited them somewhat.
An example is that the TabCtrl_XX() macros all map to SendMessageA()
which is wrong for CE, it should use SendMessageW().
Yep. I posted to the mingw list back in January explaining that
pocketpc dev tools were using their headers and needed some changes
and asking if they'd prefer that we submit patches or fork. They were
enthusiastic in prefering the first. I then submitted a patch
following their directions and nobody was even assigned to it for a
month. It's not a priority for them because there are so few PPC
developers using their stuff. Maybe if more of us complain... :-)
http://sourceforge.net/tracker/index.php?func=detail&aid=1426209&group_id=2435&atid=302435
I just did a cvs-update on the mingw include sources I've modified,
and there are no conflicts. I think this means the patch will still
apply cleanly.
Post by Shaun Jackman
- I used Shauns SDK and extended it to generate libaygshell.a,
libcomctrl.a and libfileopen.a on a 'need to have' basis.
I'm not sure what I'm doing here but some things appear to work.
I've already done this for the most recent version of the pocketpc-sdk
.deb. And my mingw patch adds the necessary headers.
This is great, In porting Qt4 I used MSFT's headers. I planned on using mingw's
headers, but never got into it. Currently I use a scheme like:

windows.h
---------------
#ifndef blabla_h
#define blabla_h
#include "fixmsheaders.h"
#include_next "Windows.h"
#endif

in which the fixmsheaders.h fixed most things to have gcc eat the msfts headers.

Then in applicaion, I add the sdk's include file dir as -dirafter.

Of course, mingw headers would be much better.
Post by eehouse
Post by Shaun Jackman
- I don't have a debugger
That sucks most of all! It's pretty easy to keep code working on both
win32 and ppc to use whatever debugging Wine provides, but I do wonder
if I could have developed this app from scratch without eVC. Most of
my code is cross-platform, so I can debug it on Linux or Palm where I
have gdb, but for some issues logfile-based debugging is a very slow
process. Oh, and an emulator would be nice too. :-)
In cegcc-0.0.2 you will find gdb and a gdb-stub. Currently they depend on
Rapi, so I've only tested them on cygwin. It should be possible to reuse
the Rapi implementation from the synce project. Rapi is mostly used to upload
the stub and the target files to the device. The rest is socket communications.

Cheers,
Pedro Alves

__________________________________________________________
Para grandes mails, grandes contas
Portugalmail: 2 000 MB de espaço
http://www.portugalmail.pt/2000mb
Shaun Jackman
2006-04-03 14:11:43 UTC
Permalink
On 4/3/06, ***@portugalmail.pt <***@portugalmail.pt> wrote:
...
Post by p***@portugalmail.pt
This is great, In porting Qt4 I used MSFT's headers. I planned on using mingw's
windows.h
---------------
#ifndef blabla_h
#define blabla_h
#include "fixmsheaders.h"
#include_next "Windows.h"
#endif
in which the fixmsheaders.h fixed most things to have gcc eat the msfts headers.
Then in applicaion, I add the sdk's include file dir as -dirafter.
...

I also use the #include_next scheme to patch header files. When the
header file I want to patch is in a standard include directory, such
as /PREFIX/include, I put a patch header in /PREFIX/sys-include,
which, believe it or not, is a included by GCC by default *before*
/PREFIX/include. My header file then uses #include_next to get the
actual header file.

I do not know for what sys-include is intended, but I've hijacked it
for this purpose, and it works very well!

p***@portugalmail.pt
2006-04-03 10:27:09 UTC
Permalink
Post by Andy WU
Hi Pedro,
I'm very glad to find this msg and I'm trying to solve the cross-gcc
problems all these days. I have tried the cegcc-0.0.1 package and your sample
1. The evc built exe can not load the dll built with cegcc, the program
freez and quit. The dll is only c library and does not contain any GUI codes.I
don't know how to solve this problem.
2. The cegcc source code does not compile with my cygwin. The binutils
compiles ok but the gcc package will not compile. The following is the error
checking for arm-wince-pe-gcc...
/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/./gcc/xgcc
-B/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/./gcc/ -nostdinc
-B/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/arm-wince-pe/newlib/ -isystem
/cygdrive/g/tmp/cross-cegcc/cegcc/build-gcc/arm-wince-pe/newlib/targ-include
-isystem /cygdrive/g/tmp/cross-cegcc/cegcc/gcc-trunk/newlib/libc/include
-B/usr/local/cegcc/arm-wince-pe/bin/ -B/usr/local/cegcc/arm-wince-pe/lib/
-isystem /usr/local/cegcc/arm-wince-pe/include -isystem
/usr/local/cegcc/arm-wince-pe/sys-include
setting gcc_no_link=yes
checking for C compiler default output file name... configure: error: C > compiler
cannot create executables
See `config.log' for more details.
B.R.
Andy WU
If you look at the config.log file, you will probably find that ld isn't finding
coredll.lib and/or winsock.lib

Please try the cegcc-0.0.2 release. You will find build instructions in the wiki.

Start here:
http://cegcc.berlios.de

And please post any cegcc related questions at the cegcc mailing list.

Cheers,
Pedro Alves

__________________________________________________________
Email gratuito com 2 000 MB
Espaço para guardar 1 milhão de mensagens
http://www.portugalmail.pt/2000mb
Loading...