Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocamlc -output-obj problems
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] ocamlc -output-obj problems
Hi,

I'm having serious problems with ocamlc -output-obj.

It seems if I create a global variable, the interpreter won't run (it
gets into caml_interprete, but I don't know where it goes wrong once
in that function).

Without any globals present, it runs fine.

let table = Hashtbl.create 8;;

Hashtbl.add table 42 "hello world";;

the above code, as simple as it is, causes things to break. Remove it,
and it'll run.

I experience the same problems when linking against Bigarray library,
and having a global value in my Console module.

The only custom parts in my ocaml environment are now just
libcamlrun.a, providing stub functions that return errors/raise
exceptions for functions I don't want/need to support.

My makefile is:

CFLAGS=-DCAML_NAME_SPACE -O -fno-defer-pop -ffreestanding -I
../include -I ../byterun -I ../ocaml/lib/ocaml -nostdlib -nostartfiles
-nostdinc

bytekernel.o: asm.mli keyboard.ml VFS.ml PCI.ml busManager.ml bytekernel.ml
	ocamlc -output-obj -o bytekernel.o asm.mli keyboard.ml VFS.ml PCI.ml
busManager.ml bytekernel.ml

kernel.elf: asm_loader.o irq.o c_loader.o bytekernel.o idt.o
asm_stubs.o fake_math.o console_stubs.o
	ld -s -static -nostdlib -Ttext 0x1000000 -e asm_start -L ../libc -L
../libm -L ../byterun \
		-o kernel.elf asm_loader.o irq.o c_loader.o idt.o asm_stubs.o
bytekernel.o fake_math.o console_stubs.o \
		-lcamlrun `gcc -print-file-name=libgcc.a` -lm -lc -L
../ocaml/lib/ocaml -lbigarray

Someone got half a clue on this?

Kindest Regards,

Jonathan