Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Trying to build a native cross-compiler for Linux ARM target
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Mentre <David.Mentre@i...>
Subject: [Caml-list] Trying to build a native cross-compiler for Linux ARM target
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