MLDonkey Forum Index
Homepage •  Bugs •  Tasks •  Patches •  SF.net Project Page •  ChangeLog •  German forum •  Links •  Wiki •  Downloads
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
How to cross-compile 3.0.7 to ARM?
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    MLDonkey Forum Index -> Alternative platforms
View previous topic :: View next topic  
Author Message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Tue Mar 29, 2011 5:14 am    Post subject: How to cross-compile 3.0.7 to ARM? Reply with quote

Hi --

Are there instructions anywhere on how to cross-compile mldonkey 3.0.7 from an (for example) x86_64 running fedora to an ARM running linux, with my own arm build chain?

I see precompiled binaries (3.0.5) for ARM, but I need to build my own.

What might my configure command look like?

Thanks!

-- Perry
Back to top
View user's profile Send private message
ygrek
professional


Joined: 20 Mar 2010
Posts: 610

PostPosted: Tue Mar 29, 2011 8:02 am    Post subject: Reply with quote

OCaml doesn't support cross-compiling. But there are some patches floating around. I didn't try them. I would recommend building in arm qemu ( there are prebuilt images available : http://www.aurel32.net/info/debian_arm_qemu.php )
_________________
Download | Report bugs | git mirror
Back to top
View user's profile Send private message Visit poster's website
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Tue Mar 29, 2011 8:06 am    Post subject: Reply with quote

I've built, and am debugging a ocaml cross-compiler. Having mldonkey configured correctly for cross-building would be very useful for finishing this.
Back to top
View user's profile Send private message
ygrek
professional


Joined: 20 Mar 2010
Posts: 610

PostPosted: Tue Mar 29, 2011 10:03 am    Post subject: Reply with quote

I fear mldonkey's configure is not cross-friendly.. And I do not know autotools well enough to help with this, sorry.
_________________
Download | Report bugs | git mirror
Back to top
View user's profile Send private message Visit poster's website
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 4001
Location: Germany

PostPosted: Tue Mar 29, 2011 4:17 pm    Post subject: Reply with quote

wagle wrote:
Having mldonkey configured correctly for cross-building would be very useful for finishing this.

As long as Ocaml does not officially support cross-compiling it makes no sense to code cross-compile support for MLDonkey.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Tue Mar 29, 2011 7:41 pm    Post subject: Reply with quote

Which came first, the chicken or the egg?


In this case, MLdonkey is driving my need for a cross compiler for ocaml. I have most of that, still working on getting some of the pieces lined up. INRIA is officially helping me out. If you help me out on the right way to cross compile MLdonkey, then maybe we get an official ocaml cross-compiler?


MLdonkey is the guinea pig for the future official ocaml cross-compiler. If someone knows the correct incantation to ./configure for MLdonkey, or even something half correct, that would be a big saver of time, and maybe my clock for doing this won't run out.
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 4001
Location: Germany

PostPosted: Tue Mar 29, 2011 7:53 pm    Post subject: Reply with quote

wagle wrote:
INRIA is officially helping me out.

Thatīs good news (and better than any unofficial 3rd party stuff which may
never be committed to Ocaml SVN). If you can provide me with their patches
I can try to adjust MLdonkey configure to their proposals.
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Tue Mar 29, 2011 8:24 pm    Post subject: Reply with quote

The way its working is this:

I have ocaml 3.12.0 building 3 of the twenty odd binaries. I have MLdonkey 3.0.7 configuring with a half-correct ./configure incantation. Based on what the resultant MLdonkey build tries to do, I am working on getting those pieces included in the ocaml cross-build. My ocaml cross-compiler is wholly undocumented because I keep changing how it works, and am not wasting time writing documentation that I would throw away. But it WILL be documented when I finish.

Its bootstrapping, moving back and forth between my working on ocaml and mldonkey. Hence my much recent meditation on chickens and eggs.

The mldonkey ./configure has --host and --target options, hence I thought it already supported cross-compiling in some fashion.

I'll be back after I try some stuff for a few hours. I might be pretty close. Closer than I thought yesterday.
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Wed Mar 30, 2011 4:18 am    Post subject: Reply with quote

I can't give you the x86_64 to armv6l build chain I am using, it not mine to give you.

Can you point me at a arm cross-build-chain you want to use? If we get it to work on that, then we all benefit.
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Wed Mar 30, 2011 9:38 pm    Post subject: Reply with quote

If you don't want to setup a ARM cross tool chain, how about suggesting things for me to try with mine? Or are you waiting for me to setup the instructions to setup an ARM tool chain?

Thanks!

-- Perry
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Wed Mar 30, 2011 10:51 pm    Post subject: Reply with quote

http://www.codesourcery.com/sgpp/lite/arm/portal/release1592

has an easy to setup ARM toolchain
Back to top
View user's profile Send private message
spiralvoice
Sage


Joined: 06 Jan 2003
Posts: 4001
Location: Germany

PostPosted: Thu Mar 31, 2011 4:27 am    Post subject: Reply with quote

wagle wrote:
Or are you waiting for me to setup the instructions to setup an ARM tool chain?

No, I am pretty busy with real life so please do not expect answers fast. Wink

I am able to setup cross compile toolchains myself, but if I work to enhance
MLdonkey configure/Makefile structure with cross compile support it should
be more than a quick hack, especially in regard to Ocaml. I am looking for
well documented, tested and easy-to-use ways for cross-compiling which
can, at the end, be posted on the wiki so unexperienced users can
copyīnīpaste a bunch of shell commands with guaranteed success. Wink

If I find some time I will have a look at these pages which have some
patches for Ocaml cross compile support:

http://caml.inria.fr/mantis/view.php?id=4303 (Ocaml bugtracker)
http://brion.inria.fr/gallium/index.php/CrossCompiler
http://yl.is.s.u-tokyo.ac.jp/~tosh/ocaml-on-iphone/
_________________
Link overview and precompiled cores here: http://mldonkey.sourceforge.net/DownloadLinks
Back to top
View user's profile Send private message
wagle
neophyte


Joined: 29 Mar 2011
Posts: 19

PostPosted: Thu Mar 31, 2011 5:03 am    Post subject: Reply with quote

I have two ocaml cross compilers. Neither contains everything.

Right now, I'm juggling three balls:

(1) I ported that gallium 3.11.0 to 3.12.0. It currently requires 32-bit gcc to compile though (because ocaml gets confused about word size on a 64 bit host machine), which is a complication I don't know how to walk newbies though. It doesn't build everything. Xavier Clerc is now back from vacation and able to answer my questions.

(2) Now that I got things cleaned up for (1) above, Eric Cooper's cross compiler now drops in and almost works (except for the 32-bit gcc stuff). I'm working on merging what it does to what (1) above does. Eric Cooper is also back from vacation and able to answer my questions.

(3) MLdonkey 3.0.7 is my torture test. Right now I'm setting PATH to

export PATH=$OCAMLCROSS:$PATH:$CODESOURCERYCROSS

and doing

./configure OCAMLOPT=/opt/ocaml-cross-arm/bin/ocamlopt OCAMLLIB="/opt/ocaml-cross-arm/lib/ocaml" CC="arm-linux-uclibcgnueabi-gcc" CXX="arm-linux-uclibcgnueabi-g++" --build=x86_64-unknown-linux-gnu --host=arm-linux-uclibcgnueabi

to configure after the 32-bit x86 ocaml is installed into /usr/local/bin (the stuff in $OCAMLCROSS partially shadows the stuff in /usr/local/bin).

This used to build for a bit before dying, but now (for some reason) it dies on the first command because it's using the wrong CC compiler. Adding a "-cc" argument to the first command with the cross-CC shows that I am missing the libocamlrun.a library in both (1) and (2) above. Which I need to do next.

So, as I said, MLdonkey is my torture test. It demands things that I need to provide, that neither (1) or (2) above provide.

So my still open question is "does that configure command look roughly correct? What should be added, changed, and/or removed?

It's my job to get a ocaml cross-build system good enough to build mldonkey. Eventually it will reach prime-time, easy-to-do, etc status, but I imagine that to be months away, and not by last week, like my deadline wants.

Thanks!

-- Perry
Back to top
View user's profile Send private message
ygrek
professional


Joined: 20 Mar 2010
Posts: 610

PostPosted: Thu Mar 31, 2011 11:14 am    Post subject: Reply with quote

Ok, I have installed emdebian cross toolchain for armel, tested that gcc works by compiling hello world on amd64 and running it in armel qemu. Now I can test your modifications for ocaml (as time permits).
_________________
Download | Report bugs | git mirror
Back to top
View user's profile Send private message Visit poster's website
ygrek
professional


Joined: 20 Mar 2010
Posts: 610

PostPosted: Thu Mar 31, 2011 12:23 pm    Post subject: Reply with quote

configure args look reasonable, but mldonkey's makefile compiles several utilities and runs them during build (some preprocessors etc) so it shoud distinguish between native ocaml and cross-ocaml for this task, and this means tweaking makefile. Can you share your ocaml patches so that I can try it out?
_________________
Download | Report bugs | git mirror
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    MLDonkey Forum Index -> Alternative platforms All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Sourceforge.net Logo