Thread overview
gdc / nokia / arm-*-gnueabi
Jan 13, 2007
Frits van Bommel
Jan 13, 2007
Walter Bright
Jan 13, 2007
John Reimer
Jan 13, 2007
Luís Marques
Jan 14, 2007
Walter Bright
Jan 14, 2007
Kris
Jan 14, 2007
Chad J
January 13, 2007
Hey

I'm building an arm gdc cross-compiler that'll compile D code to run on maemo[0] platforms (nokia 770[1] and nokia n800[2] internet tablets). There is a bunch of us here at nokia interested in experimenting with D/making it a core part of our platform in the long run.

The good:
I was able to build an arm-*-linux cross-compiling gdc toolchain & phobos.
It works perfectly. The produced code runs correctly on the device, even
including the garbagge-collector. I had to apply some patching here and
there (mostly to phobos) but nothing specifically magical.

Screenshot: http://www.flickr.com/photo_zoom.gne?id=329290303&size=l

The bad:
We're no longer using arm-*-linux target. We're using the newer
arm-*-linux-gnueabi (armel) abi. This is a more powerfull eabi that allows
thumb interworking, etc. The gdc doesn't seem to work when compiled for
this target. To be precise -- the cc1d segfaults during compilation of
certain language structs (it happens when trying to compile phobos). The
segfaults are not totally random nor _very_ often (ie. it's possible to
compile some phobos files without problems). But something is obviously
broken ;)

Some data:

Debug backtrace of cc1d leading to segfault: http://pastebin.ca/315685

Outout during phobos building:
http://pastebin.ca/315687

Strace of cc1d leading to segfault: http://pastebin.ca/315694

I'm building gdc using gcc-3.4.4 from CodeSourcery (this is our default
toolchain).

Any help/pointers would be appreciated!

Regards,

[0]: http://www.maemo.org
[1]: http://www.nokia.com/770
[2]: http://www.nseries.com/n800

-- 
Michael Dominic Kostrzewa
Nokia - Multimedia
Helsinki

January 13, 2007
Michael Dominic Kostrzewa wrote:
> Hey
> 
> I'm building an arm gdc cross-compiler that'll compile D code to run on
> maemo[0] platforms (nokia 770[1] and nokia n800[2] internet tablets).
> There is a bunch of us here at nokia interested in experimenting with
> D/making it a core part of our platform in the long run.
> 
> The good:
> I was able to build an arm-*-linux cross-compiling gdc toolchain & phobos.
> It works perfectly. The produced code runs correctly on the device, even
> including the garbagge-collector. I had to apply some patching here and
> there (mostly to phobos) but nothing specifically magical. 
> 
> Screenshot:
> http://www.flickr.com/photo_zoom.gne?id=329290303&size=l

A link to that has been posted somewhere in these groups a while back. Good work.

> The bad:
> We're no longer using arm-*-linux target. We're using the newer
> arm-*-linux-gnueabi (armel) abi. This is a more powerfull eabi that allows
> thumb interworking, etc. The gdc doesn't seem to work when compiled for
> this target. To be precise -- the cc1d segfaults during compilation of
> certain language structs (it happens when trying to compile phobos). The
> segfaults are not totally random nor _very_ often (ie. it's possible to
> compile some phobos files without problems). But something is obviously
> broken ;)
> 
> Some data:
> 
> Debug backtrace of cc1d leading to segfault:
> http://pastebin.ca/315685
> 
> Outout during phobos building:
> http://pastebin.ca/315687
> 
> Strace of cc1d leading to segfault:
> http://pastebin.ca/315694
> 
> I'm building gdc using gcc-3.4.4 from CodeSourcery (this is our default
> toolchain). 
> 
> Any help/pointers would be appreciated! 
> 
> Regards,
> 
> [0]: http://www.maemo.org
> [1]: http://www.nokia.com/770
> [2]: http://www.nseries.com/n800

I think D.gnu is a more appropriate group for this. Folluwup set.
January 13, 2007
Michael Dominic Kostrzewa wrote:
> I had to apply some patching here and
> there (mostly to phobos) but nothing specifically magical.

Please let me know what those patches are, so they can be folded in.
January 13, 2007
On Sat, 13 Jan 2007 22:28:16 +0200, Michael Dominic Kostrzewa wrote:

> Hey
> 
> I'm building an arm gdc cross-compiler that'll compile D code to run on maemo[0] platforms (nokia 770[1] and nokia n800[2] internet tablets). There is a bunch of us here at nokia interested in experimenting with D/making it a core part of our platform in the long run.
> 
> The good:
> I was able to build an arm-*-linux cross-compiling gdc toolchain & phobos.
> It works perfectly. The produced code runs correctly on the device, even
> including the garbagge-collector. I had to apply some patching here and
> there (mostly to phobos) but nothing specifically magical.
> 
> Screenshot: http://www.flickr.com/photo_zoom.gne?id=329290303&size=l
> 
> The bad:
> We're no longer using arm-*-linux target. We're using the newer
> arm-*-linux-gnueabi (armel) abi. This is a more powerfull eabi that allows
> thumb interworking, etc. The gdc doesn't seem to work when compiled for
> this target. To be precise -- the cc1d segfaults during compilation of
> certain language structs (it happens when trying to compile phobos). The
> segfaults are not totally random nor _very_ often (ie. it's possible to
> compile some phobos files without problems). But something is obviously
> broken ;)
> 
> Some data:
> 
> Debug backtrace of cc1d leading to segfault: http://pastebin.ca/315685
> 
> Outout during phobos building:
> http://pastebin.ca/315687
> 
> Strace of cc1d leading to segfault: http://pastebin.ca/315694
> 
> I'm building gdc using gcc-3.4.4 from CodeSourcery (this is our default
> toolchain).
> 
> Any help/pointers would be appreciated!
> 
> Regards,
> 
> [0]: http://www.maemo.org
> [1]: http://www.nokia.com/770
> [2]: http://www.nseries.com/n800
>


This is great!  D will likely prove to be a massive productivity boost for Nokia developers; I'm sure this will eventually be the case even with third party developers working on Nokia-based projects.

It would be great if we could get tango working on
this device at some point, as well. Feel free to drop in on the irc chat
groups #d and #d.tango (freenode) where you'll likely get all the realtime
help you need.

All the best!

-JJR
January 13, 2007
Hello Michael,

I just wanted to say, please continue this great effort. It will be very appreciated.

Best regards,
Luís
January 14, 2007
Luís Marques wrote:
> I just wanted to say, please continue this great effort. It will be very appreciated.

I agree.
January 14, 2007
== Quote from Walter Bright (newshound@digitalmars.com)'s article
> Luís Marques wrote:
> > I just wanted to say, please continue this great effort. It will be very appreciated.
> I agree.

Yeah, me too. The number of computers on desks is dwarfed by the number of "smart" devices. Getting D running on these platforms has always been a primary key to mass adoption, IMO. It's that foot in the door, with a size-287 boot on the end ...

Nice work!


January 14, 2007
Michael Dominic Kostrzewa wrote:
> Hey
> 
> I'm building an arm gdc cross-compiler that'll compile D code to run on
> maemo[0] platforms (nokia 770[1] and nokia n800[2] internet tablets).
> There is a bunch of us here at nokia interested in experimenting with
> D/making it a core part of our platform in the long run.
> 
> The good:
> I was able to build an arm-*-linux cross-compiling gdc toolchain & phobos.
> It works perfectly. The produced code runs correctly on the device, even
> including the garbagge-collector. I had to apply some patching here and
> there (mostly to phobos) but nothing specifically magical. 
> 
> Screenshot:
> http://www.flickr.com/photo_zoom.gne?id=329290303&size=l
> 
> The bad:
> We're no longer using arm-*-linux target. We're using the newer
> arm-*-linux-gnueabi (armel) abi. This is a more powerfull eabi that allows
> thumb interworking, etc. The gdc doesn't seem to work when compiled for
> this target. To be precise -- the cc1d segfaults during compilation of
> certain language structs (it happens when trying to compile phobos). The
> segfaults are not totally random nor _very_ often (ie. it's possible to
> compile some phobos files without problems). But something is obviously
> broken ;)
> 
> Some data:
> 
> Debug backtrace of cc1d leading to segfault:
> http://pastebin.ca/315685
> 
> Outout during phobos building:
> http://pastebin.ca/315687
> 
> Strace of cc1d leading to segfault:
> http://pastebin.ca/315694
> 
> I'm building gdc using gcc-3.4.4 from CodeSourcery (this is our default
> toolchain). 
> 
> Any help/pointers would be appreciated! 
> 
> Regards,
> 
> [0]: http://www.maemo.org
> [1]: http://www.nokia.com/770
> [2]: http://www.nseries.com/n800
> 

I'm sorry I can't really help since compiler crashes scare me, but I would like to say that I love what you are doing.

I hope to write games for mobile devices as soon as college goes away, and D is my language of choice.  So the more mobile devices with D support, the better.

Thank you so much!
January 14, 2007
On Sat, 13 Jan 2007 21:45:27 +0100, Frits van Bommel wrote:

> I think D.gnu is a more appropriate group for this. Folluwup set.

Thanks.

One thing I should have mentioned is that my debug/strace comes from gdc 0.20 but 0.21 gives same results.

Now when I think about this, it could be there is something broken in the toolchain itself. The previous (working) arm-*-linux gdc compiler was built against stock gcc 3.4.3 with just a few usual arm patches.

For the new arm-*-linux-gnueabi I had to use a Code Sourcery gcc 3.4.4. This is because gcc oficially supports gnueabi from version 4.1.x (with major bugs ironed out in 4.1.1 AFAIK) which is incompatible with gdc. Therefore, stock gcc can't be used.

Code Sourcery's gcc 3.4.4 is a seriously altered version with eabi support patched-in. CodeSourcery's doesn't provide individual patches so it's impossible to distinguish where eabi support starts and where black-magic patching-up starts. It could be that some of the CodeSourcery's black-magic breaks gdc compatibility (though gcc and g++ works as expected in this chain).

Summing it up, my current thinking is -- are there any plans to add gcc 4.1.x series support for gdc? Are there major differences between gcc 4.1.x and 4.0.x from the gdc point of view?

Best regards,


-- 
Michael Dominic Kostrzewa
Nokia - Multimedia
Helsinki