From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C8E0EBCAC for ; Tue, 17 May 2005 08:52:37 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4H6qbaR031274 for ; Tue, 17 May 2005 08:52:37 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA28804 for ; Tue, 17 May 2005 08:52:37 +0200 (MET DST) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j4H6qYLY031269 for ; Tue, 17 May 2005 08:52:36 +0200 Received: from [192.168.1.200] (ppp22-114.lns2.syd3.internode.on.net [59.167.22.114]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id j4H6qPMG034532; Tue, 17 May 2005 16:22:26 +0930 (CST) Subject: Re: [Caml-list] Re: Problems linking in an object file produced with "ocamlopt -c -output-obj" From: skaller Reply-To: skaller@users.sourceforge.net To: "Corey O'Connor" Cc: Ocaml In-Reply-To: References: Content-Type: text/plain Message-Id: <1116312743.32536.286.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 17 May 2005 16:52:24 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 428994B5.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 428994B2.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocamlopt:01 -output-obj:01 sourceforge:01 asmrun:01 char:01 char:01 gcc:01 extern:01 initialiser:01 ocaml:01 bug:01 glebe:01 corey:98 poof:98 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: 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