From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id A15697ED25 for ; Sat, 20 Jul 2013 13:36:31 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rixed@happyleptic.org) identity=pra; client-ip=5.135.156.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="rixed@happyleptic.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of rixed@happyleptic.org) identity=mailfrom; client-ip=5.135.156.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="rixed@happyleptic.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@pim.happyleptic.org) identity=helo; client-ip=5.135.156.187; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="rixed@happyleptic.org"; x-sender="postmaster@pim.happyleptic.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgUFAAZ16lEFh5y7/2dsb2JhbABagwbBVoESFnSCJAEBBAF+CwshJQ8FKIg+CrcLjleBPxaCem4DkBCHTAGRTYMUgWY X-IPAS-Result: AgUFAAZ16lEFh5y7/2dsb2JhbABagwbBVoESFnSCJAEBBAF+CwshJQ8FKIg+CrcLjleBPxaCem4DkBCHTAGRTYMUgWY X-IronPort-AV: E=Sophos;i="4.89,708,1367964000"; d="scan'208";a="26715918" Received: from pim.happyleptic.org ([5.135.156.187]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 20 Jul 2013 13:36:31 +0200 Received: from rixed.happyleptic.org ([82.67.194.89] helo=dell.happyleptic.org) by pim.happyleptic.org with esmtp (Exim 4.80) (envelope-from ) id 1V0VSg-0002PX-1R for caml-list@inria.fr; Sat, 20 Jul 2013 13:36:30 +0200 Received: from rixed by dell.happyleptic.org with local (Exim 4.80) (envelope-from ) id 1V0VSa-0005Iq-K6 for caml-list@inria.fr; Sat, 20 Jul 2013 13:36:24 +0200 Date: Sat, 20 Jul 2013 13:36:24 +0200 From: rixed@happyleptic.org To: caml-list@inria.fr Message-ID: <20130720113624.GA14182@dell.happyleptic.org> References: <20130719154909.GA29399@dell.happyleptic.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="YiEDa0DAkWCtVeE4" Content-Disposition: inline In-Reply-To: <20130719154909.GA29399@dell.happyleptic.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] compiling custom runtime --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > boot/ocamlrun boot/ocamlc -nostdlib -I boot -compat-32 -o ocamlc \ > compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma driver/main.cmo > File "_none_", line 1: > Error: Error while linking boot/stdlib.cma(Array): > The external function `caml_create_vect' is not available So, caml_create_vect is in boot/ocamlrun but the boot/ocamlc that's shipped in the tarball apparently don't know how to reach it. Evgeny Roubinchtein suggested me to read again the manual about mixing C and ocaml, and so I tried to add the -use-runtime parameter and it solved this issue. In my limited understanding of the bootstraping process this option should really always be present when using the shipped boot/ocamlc. This was not enough, though, to trick myocamlbuild, so eventualy I used a shell wrapper around ocamlrun (see attached patch). There ought to be a better way! --YiEDa0DAkWCtVeE4 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=use-runtime diff --git a/Makefile b/Makefile index 10c80d2..0b1b1c6 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ LIBFILES=stdlib.cma std_exit.cmo *.cmi camlheader # Start up the system from the distribution compiler coldstart: cd byterun; $(MAKE) all - cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE) + cp byterun/ocamlrun$(EXE) boot/actual.ocamlrun$(EXE) cd yacc; $(MAKE) all cp yacc/ocamlyacc$(EXE) boot/ocamlyacc$(EXE) cd stdlib; $(MAKE) COMPILER=../boot/ocamlc all @@ -215,7 +215,7 @@ promote-cross: # Promote the newly compiled system to the rank of bootstrap compiler # (Runs on the new runtime, produces code for the new runtime) promote: promote-cross - cp byterun/ocamlrun$(EXE) boot/ocamlrun$(EXE) + cp byterun/ocamlrun$(EXE) boot/actual.ocamlrun$(EXE) # Restore the saved bootstrap compiler if a problem arises restore: diff --git a/boot/ocamlrun b/boot/ocamlrun new file mode 100755 index 0000000..fcb291c --- /dev/null +++ b/boot/ocamlrun @@ -0,0 +1,16 @@ +#!/bin/bash + +d=$(dirname $0) + +# Dodge ocamlrun own options by avoiding interfering in that case +case "$1" in + -*) c="$1" ;; + *) c=$(basename $1) ;; +esac + +if test "$c" = ocamlc ; then + shift + $d/actual.ocamlrun $d/ocamlc -use-runtime $d/ocamlrun "$@" +else + $d/actual.ocamlrun "$@" +fi --YiEDa0DAkWCtVeE4--