caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Cross-compile ocaml for ARM
@ 2002-09-22 14:31 Guillaume Valadon
  2002-09-23  8:48 ` Sven LUTHER
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Valadon @ 2002-09-22 14:31 UTC (permalink / raw)
  To: caml-list

hello,

I am trying to build a native ocaml-3.06 for Linux arm using the
method explained in http://caml.inria.fr/archives/200110/msg00334.html.

The 'make world' worked fine but the 'make opt' failed in the asmrun
directory with:
signals.c: In function 'init_signals':
signals.c: 'segv_handler' undeclared (first use in this function)
[ usual gcc stuff about undeclared identifier ]

The segv_handler function is located line 478 or 486 but is never 
declared due to preprocessors tests. Uncommenting the test line 486
resolved the problem (ok, that's a dirty hack) but 'make opt' failed 
again with :
../../ocamlcomp.sh -c -warn-error A unix.mli
../../ocamlcomp.sh: line 5
/path/to/ocaml-3.06/otherlibs/unix/../../ocamlc.opt: cannot execute
binary file

How do i resolve these problems ?

Guillaume
-- 
mailto:guillaume@valadon.net
ICQ uin : 1752110

Page ouebe : http://guillaume.valadon.net

     "Everybody be cool. You ... be cool" - Seth Gecko
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Cross-compile ocaml for ARM
  2002-09-22 14:31 [Caml-list] Cross-compile ocaml for ARM Guillaume Valadon
@ 2002-09-23  8:48 ` Sven LUTHER
  2002-09-23 14:11   ` Jacques Garrigue
  0 siblings, 1 reply; 4+ messages in thread
From: Sven LUTHER @ 2002-09-23  8:48 UTC (permalink / raw)
  To: Guillaume Valadon; +Cc: caml-list

On Sun, Sep 22, 2002 at 04:31:44PM +0200, Guillaume Valadon wrote:
> hello,
> 
> I am trying to build a native ocaml-3.06 for Linux arm using the
> method explained in http://caml.inria.fr/archives/200110/msg00334.html.
> 
> The 'make world' worked fine but the 'make opt' failed in the asmrun
> directory with:
> signals.c: In function 'init_signals':
> signals.c: 'segv_handler' undeclared (first use in this function)
> [ usual gcc stuff about undeclared identifier ]
> 
> The segv_handler function is located line 478 or 486 but is never 
> declared due to preprocessors tests. Uncommenting the test line 486
> resolved the problem (ok, that's a dirty hack) but 'make opt' failed 
> again with :
> ../../ocamlcomp.sh -c -warn-error A unix.mli
> ../../ocamlcomp.sh: line 5
> /path/to/ocaml-3.06/otherlibs/unix/../../ocamlc.opt: cannot execute
> binary file
> 
> How do i resolve these problems ?

I don't really know, but notice that the arm native code compiler builds
fine on debian/arm's autobuilder. You can follow the links found at :

http://buildd.debian.org/bymaint.php?maint=Sven%20Luther%20%3Cluther%40debian.org%3E%20

To get to the full build log of ocaml on arm, in order to compare it to
your build log, and see where the problem is.

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Cross-compile ocaml for ARM
  2002-09-23  8:48 ` Sven LUTHER
@ 2002-09-23 14:11   ` Jacques Garrigue
  2002-09-25 12:29     ` Guillaume Valadon
  0 siblings, 1 reply; 4+ messages in thread
From: Jacques Garrigue @ 2002-09-23 14:11 UTC (permalink / raw)
  To: guillaume; +Cc: caml-list

On Sun, Sep 22, 2002 at 04:31:44PM +0200, Guillaume Valadon wrote:
> I am trying to build a native ocaml-3.06 for Linux arm using the
> method explained in http://caml.inria.fr/archives/200110/msg00334.html.
> 
[..]
> The segv_handler function is located line 478 or 486 but is never 
> declared due to preprocessors tests. Uncommenting the test line 486
> resolved the problem (ok, that's a dirty hack) but 'make opt' failed 
> again with :
> ../../ocamlcomp.sh -c -warn-error A unix.mli
> ../../ocamlcomp.sh: line 5
> /path/to/ocaml-3.06/otherlibs/unix/../../ocamlc.opt: cannot execute
> binary file
> 
> How do i resolve these problems ?

This message is a bit strange: ocamlcomp.sh is only supposed to call
ocamlc.opt if you have built it after ocamlc. And logically you
shouldn't be able to use ocamlc.opt with a cross compiler.
Did you really follow the instructions in the message above?
Didn't you do "make world.opt" in place of "make world"? This would
attempt to compile the libraries with ocamlc.opt, as you seem to do,
and would of course fail (since ocamlc.opt is an ARM binary).
If this is the case, erase ocamlc and start again using "make world"
and then "make opt", and eventually "make opt.opt" if you need it.

Hope this helps,

     Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Cross-compile ocaml for ARM
  2002-09-23 14:11   ` Jacques Garrigue
@ 2002-09-25 12:29     ` Guillaume Valadon
  0 siblings, 0 replies; 4+ messages in thread
From: Guillaume Valadon @ 2002-09-25 12:29 UTC (permalink / raw)
  To: caml-list

re,

> This message is a bit strange: ocamlcomp.sh is only supposed to call
> ocamlc.opt if you have built it after ocamlc. And logically you
> [ ... ]
> If this is the case, erase ocamlc and start again using "make world"
> and then "make opt", and eventually "make opt.opt" if you need it.

Yes, I did something wrong this week end ...

But now, I did:

$ ./configure -prefix /home/QtPalmtop -no-curses
Then I edited config/Makefile, utils/ccomp.ml, and asmcomp/arm/proc.ml
according to the thread starting with
http://caml.inria.fr/archives/200110/msg00334.html

$ make world
$ make op
[ ... ]
signals.c:545: `segv_handler' undeclared (first use in this function)
signals.c:545: (Each undeclared identifier is reported only once
signals.c:545: for each function it appears in.)
make[1]: *** [signals.o] Error 1
make[1]: Leaving directory `/opt/Qtopia/tmp/ocaml-3.06/asmrun'
make: *** [runtimeopt] Error 2

I did my dirty hack then:
$ make opt

It works fine but it produce x86 binaries instead of arm ...

I the, tried
$ make opt.opt
[ ... ]
../../ocamlcompopt.sh -warn-error A -I ../../otherlibs/dynlink -c -impl
odyl_config.ppo
../../ocamlcompopt.sh: line 5:
/opt/Qtopia/tmp/ocaml-3.06/camlp4/odyl/../../ocamlopt.opt: cannot
execute binary file
../../ocamlcompopt.sh: line 5:
/opt/Qtopia/tmp/ocaml-3.06/camlp4/odyl/../../ocamlopt.opt: Success
make[2]: *** [odyl_config.cmx] Error 1
make[2]: Leaving directory `/opt/Qtopia/tmp/ocaml-3.06/camlp4/odyl'
make[1]: *** [opt.opt] Error 2
make[1]: Leaving directory `/opt/Qtopia/tmp/ocaml-3.06/camlp4'
make: *** [camlp4optopt] Error 2

This week-end I managed to build arm binaries using these steps :
- edit config/Makefile and *.ml
- make coldstart
- edit asmrun/signals.c and enable function at line 486
- edit ocamlcomp.sh replace ocamlc.opt by $topdir/ocamlrun ocamlc
- edit ocamlcompopt.sh replace ocamlopt.opt by $topdir/ocamrun ocamlopt
- make opt.opt
- edit config/Makefile : put arm-linux-gcc in NATIVECC and MKSHAREDLIB
- make coldstart

I only tested ocamlrun, ocaml and pervasives.* on an arm computer but it
works fine.

Guillaume
-- 
mailto:guillaume@valadon.net
ICQ uin : 1752110

Page ouebe : http://guillaume.valadon.net

     "Une gonzesse de perdue, c'est dix copains qui reviennent." - Renaud
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-09-25 12:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-22 14:31 [Caml-list] Cross-compile ocaml for ARM Guillaume Valadon
2002-09-23  8:48 ` Sven LUTHER
2002-09-23 14:11   ` Jacques Garrigue
2002-09-25 12:29     ` Guillaume Valadon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).