caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Trying to build a native cross-compiler for Linux ARM target
@ 2001-10-31 13:36 David Mentre
  2001-11-05  8:51 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: David Mentre @ 2001-10-31 13:36 UTC (permalink / raw)
  To: caml-list

Hello,

I'm trying to build a native cross-compiler for Linux ARM
target. Following a post of Xavier[1], I've made the following steps:

 1. do a ./configure -prefix /local/mentre/install/arm-ocaml-3.02

 2. modify config/Makefile with:
ARCH=arm
MODEL=default
SYSTEM=linux_elf
NATIVECC=/skiff/local/bin/arm-linux-gcc
NATIVECCCOMPOPTS=-Wall -Wno-unused
NATIVECCLINKOPTS=
NATIVECCLIBS= -lm
ASFLAGS=
ASPP=/skiff/local/bin/arm-linux-gcc
ASPPFLAGS=-c -DSYS_$(SYSTEM)

 3. modify utils/ccomp.ml with:
L63:         command(Printf.sprintf "/skiff/local/bin/arm-linux-ar rc %s %s"

 4. modify asmcomp/arm/proc.ml with:
L193:  Sys.command ("/skiff/local/bin/arm-linux-as -o " ^ outfile ^ " " ^ infile)

 5. make world && make opt && make install


However, when I compile a test program, it fails:

pochi(mentre):/tmp [42] cat ./test-arm.ml
let rec fib x = if x <= 1 then 1 else fib (x - 1) + fib (x - 2)

let _ =
  print_int (fib 4);
  print_newline ()

pochi(mentre):/tmp [32] /local/mentre/install/arm-ocaml-3.02/bin/ocamlopt ./test-arm.ml -o test-arm
/local/mentre/install/arm-ocaml-3.02/lib/ocaml/stdlib.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
Error during linking


 6. I have noticed that this ranlib is encoded in utils/config.ml so
    I've modified this file with:
let native_partial_linker = "/skiff/local/bin/arm-linux-ld -r "
let ranlib = "/skiff/local/bin/arm-linux-ranlib"

 7. make world && make opt && make install


However, my test program still fails to compile:

pochi(mentre):/tmp [37] /local/mentre/install/arm-ocaml-3.02/bin/ocamlopt ./test-arm.ml -o test-arm
/local/mentre/install/arm-ocaml-3.02/lib/ocaml/stdlib.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
Error during linking

What I have missed ?

Best regards,
d.

[1] http://caml.inria.fr/archives/199903/msg00006.html
-- 
 David.Mentre@inria.fr
 Opinions expressed here are only mine.
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

* Re: [Caml-list] Trying to build a native cross-compiler for Linux ARM target
  2001-10-31 13:36 [Caml-list] Trying to build a native cross-compiler for Linux ARM target David Mentre
@ 2001-11-05  8:51 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 2001-11-05  8:51 UTC (permalink / raw)
  To: David Mentre; +Cc: caml-list

> [cross-compilation & ranlib madness]

Try to put

RANLIB=/skiff/local/bin/arm-linux-ranlib
RANLIBCMD=/skiff/local/bin/arm-linux-ranlib

in config/Makefile.  Modifying utils/config.ml is not enough and not
recommended anyway (it's generated).

Hope this helps,

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2001-11-05  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-31 13:36 [Caml-list] Trying to build a native cross-compiler for Linux ARM target David Mentre
2001-11-05  8:51 ` Xavier Leroy

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).