Ruby on WinCE / cegcc

I’m trying to get Ruby up and running on an ARM-based Windows CE device
(Pocket PC 2003 and Windows Mobile 5 pda devices). The pre-built
binaries on ruby-mswince don’t work very well
for anything other than the simplest of code - ie anything with a
‘require’ is toast, as relative paths do not work; so anything relying
on gems (even gems itself!) is no good.

Has anyone attempted to get Ruby running using the Windows CE cross
development tools (http://cegcc.sourceforge.net/) for Cygwin/Linux? This
could be a better solution as I believe thay have implemented some sort
of relative path system in their ‘newlib’ libc replacement.

Using the arm-wince-cegcc toolset I can seemingly configure the code ok
using:

CC=/opt/cegcc/bin/arm-wince-cegcc-gcc.exe
CPP=/opt/cegcc/bin/arm-wince-cegcc-cpp.exe
LIBS=“-I/opt/cegcc/include”
LDFLAGS=“-L/opt/cegcc/lib”
./configure --host=arm-wince --prefix=/WinCE/built

… and then get part way into the build process (up to ext/bigdecimal)
but then it throws up dozens of undefined references when trying to
link… I guess I need to build a load of other arm-wince native
libraries as well?

Is this worthwhile? The dozens of other questions about ruby on
wince/pocket pc all have the same problems (wince:strerror or the path
problems), so some kind of solution is needed.

John S. wrote:

Is this worthwhile? The dozens of other questions about ruby on
wince/pocket pc all have the same problems (wince:strerror or the path
problems), so some kind of solution is needed.

Ok, so after spending a whole day on this I actually got the latest
version of Ruby (1.8.6-p111) to compile using the arm-wince-cegcc
toolchain and run on a Windows Mobile 5 device. It also doesn’t spit out
the wince::strerror, so good news there.

However, the relative path problem is still there - I thought the extra
stuff in newlib from the cegcc project may have gone some way to
alleviating it, but as of now it’s still unuseable for all but the most
trivial of code (can you imagine modifying all of the files that a
framework like Rails uses, so that everything was absolute?).

Don’t think by having a running ruby binary that you’ll be installing
gems, left right and centre, or firing up a Rails app any time soon :frowning:

If anyone is interested, I’ll put a web page up on a system at work to
allow others to use it. I’ll also document the modifications needed in
order to compile cleanly.

Looks like a dead end for my intentions of Ruby on WinCE/Pocket PC
though, unless someone can figure out a workaround for the Windows CE
path problem?

John S. wrote:

John S. wrote:

Is this worthwhile? The dozens of other questions about ruby on
wince/pocket pc all have the same problems (wince:strerror or the path
problems), so some kind of solution is needed.

If anyone is interested, I’ll put a web page up on a system at work to
allow others to use it. I’ll also document the modifications needed in
order to compile cleanly.

Looks like a dead end for my intentions of Ruby on WinCE/Pocket PC
though, unless someone can figure out a workaround for the Windows CE
path problem?

Ok, so I’ve documented what I’ve done so far, and I’ve also put up
pre-built binaries of the latest stable version of Ruby for Windows CE
/ARM for anyone who is interested.

I have almost got Rubygems to install, but I fail on requiring
‘socket’… which is one module (along with ext/dl) that I couldn’t
manage to build cleanly.

When doing the final linking of ruby, I get a single unresolved symbol
from ext/socket/socket.a; “__h_errno_location”.

I managed to fix all of the other symbol errors and multiple
declarations, but this one still eludes me; and I cannot see it anywhere
in the CEGCC libraries. If anyone has any further information, the full
error is on my website along with the rest of the build information.

http://www.target-earth.net/gadgets/

Sorry there are no patches as such, but everything I have done is
detailed - this definitely seems the way to go if we can get patches
into the official codebase to handle a compile time option for the CEGCC
build.

-John

On Sun, Feb 24, 2008 at 9:44 AM, Dominik H. [email protected]
wrote:

And lets be honest: Rails isnt something you run on a WinCE device, is it?

There goes my super-portable website idea! :frowning: Oh well. :slight_smile:

Dominik H.

Arlen

Arlen C. wrote:

On Sun, Feb 24, 2008 at 9:44 AM, Dominik H. [email protected]
wrote:

And lets be honest: Rails isnt something you run on a WinCE device, is it?

There goes my super-portable website idea! :frowning: Oh well. :slight_smile:

Dominik H.

Arlen

No need to be so sad :wink:

with the help of someone on the cegcc-devel list, I may have just gotten
the socket extensions working :slight_smile:

I can now do both a ‘require socket’ and ‘require webrick’ in irb
without Ruby having a fit!

Hopefully a I’ll have a proper patch coming soon.

-John

On [Sun, 24.02.2008 02:43], John S. wrote:

allow others to use it. I’ll also document the modifications needed in
I have almost got Rubygems to install, but I fail on requiring

http://www.target-earth.net/gadgets/

Sorry there are no patches as such, but everything I have done is
detailed - this definitely seems the way to go if we can get patches
into the official codebase to handle a compile time option for the CEGCC
build.

-John

Posted via http://www.ruby-forum.com/.

Thanks so far, finally a binary for the ARM/WinCE platform.
Just sad to hear, that WinCE cant handle relative pathes, but for small
tools
(like calculators or whatsoever) it might be still useful.
And lets be honest: Rails isnt something you run on a WinCE device, is
it?

John S. wrote:

I’ve built another release; this time the socket library built cleanly
with a modification to use liberrno from CEGCC. I can now do a ‘require
webrick’ and even install rubygem! (although I get an error right at the
end when it’s trying to install ri docs)

I’ve done further testing and the patched socket extension actually
works - at least at a localhost level! Wow, I’ve really surprised
myself now!.

http://www.target-earth.net/gadgets/code/rubyce.html#sockets

This could well mean that bigger, more complicated packages are not far
away from running! :wink:

As a treat for you all, I’ve replaced the previous binaries on my site
with a new set that were compiled with -O3 optimisation; definitely
quicker. If anyone can report on how well these run on a physical device
that would be appreciated!

-John

I’ve done some further work on the Ruby Arm-WinCE-CEGCC port this week:

http://www.target-earth.net/gadgets/code/rubyce.html#regression

Some bad news; Gem just doesn’t seem to work right and I’m still a
little way from getting a Rails instance running.

Good news is that I’m gradually copying the regression tests from the
Ruby source over to a Windows CE style of absolute path names where
requires (mostly local ‘require’ directives) and I’m pleasantly
surprised at the amount of tests that pass without error. Once they’re
all converted I’ll put up an archive that other Ruby on Arm-WinCE-CEGCC
users can overlay on their installations.

There are quite a few tests that fail however, and I’m sure that these
will be causing problems somewhere along the line.

I also have a suspicion that in certain areas the low memory environment
is causing problems. Very little I can do about that, other than look at
a dynamic version of Ruby… something I’ve only just started on
(libz.dll is built, but openssl is proving trickier).

-John

Just wanted to let you know that people still are reading this thread
and that you shouldnt give up your good work.

You are on a good way to more and more ruby power on the WinCE platform.

Thanks again!

I’ve built another release; this time the socket library built cleanly
with a modification to use liberrno from CEGCC. I can now do a ‘require
webrick’ and even install rubygem! (although I get an error right at the
end when it’s trying to install ri docs)

http://www.target-earth.net/gadgets/

There is a new file on my site (dated 24 Feb 2008) including a pre-built
binary version, along with a pre-installed version of rubygem.

I should have a proper patch soon… it’s just working out how to build
this external library at the same time and include it in the final
linking process. The rest of the modifications against the plain Ruby
source tree now work cleanly with a single patch.

-John

Mike S. wrote:

Thanks, John!
It’s great to have 1.8.6 working on my iPAQ 4150.

Thanks again.
Mike S.

John S. пишет:

Thanks Dominik and Mike, it’s great to hear positive feedback - I’ve had
no-one contact me so I didn’t even know if people had tried this
version.

Anyway, I have done a little more work - at one point I managed to get
ruby and all of the extensions to build dynamically; the size was
reduced dramatically. I also managed to build a dll version of libz
which the extension for ruby correctly linked against. Couldn’t manage
the same for OpenSSL yet though, which results in the ruby openssl
extensions being around 500Kbytes in size with the statically linked
libssl and libcrypto libraries.

One problem is that the actual dynamic ruby binary wouldn’t run on the
device. That’s something I’m going to have to investigate further.

On a more positive note, I would say that approximately 60-70% of the
ruby regression tests work with only minor edits (mostly where they do
local ‘requires’ for test files). It’s the others that need looking at -
test_imap.rb for example gives the ‘cannot allocate memory’ problem.

-John

Thanks, John!
It’s great to have 1.8.6 working on my iPAQ 4150.

Thanks again.
Mike S.

John S. пишет: