Version française
Home     About     Download     Resources     Contact us    
Browse thread
Problems linking in an object file produced with "ocamlopt -c -output-obj"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Re: Problems linking in an object file produced with "ocamlopt -c -output-obj"
On Tue, 2005-05-17 at 16:14, Corey O'Connor wrote:
> > _caml_atom_table
> > _caml_static_data_end
> > _caml_static_data_start
> > _caml_code_area_end
> > _caml_code_area_start
> 
> Umm.. Well. I changed asmrun/startup.c from:
> char * caml_static_data_start, * caml_static_data_end;
> char * caml_code_area_start, * caml_code_area_end;
> 
> To:
> char * caml_static_data_start, * caml_static_data_end = NULL;
> char * caml_code_area_start, * caml_code_area_end = NULL;
> 
> And *poof*, the errors went away. 
> 
> This is under Mac OS X 10.4 for what it's worth. Maybe something
> changed with GCC 4.0 effecting the export of extern variables with no
> initializers?

See ISO C99, 6.9.2./1

Variables with external linkage must be defined exactly
once (if they're used) or at most once (if they're not).

The above fragments do not constitute an external
definition, an initialiser is required for that.

The Ocaml sources are incorrect, you patch fixes them.
This should go in the bug tracker. 

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net