From: Ian Campbell Subject: Re: [PATCH v4 05/27] libxc: ocaml: add simple binding for xentoollog (output only). Date: Tue, 12 Nov 2013 13:52:29 +0000 Message-ID: <1384264349.1883.59.camel@kazak.uk.xensource.com> References: <1383760205-20397-1-git-send-email-rob.hoes@citrix.com> <1383760205-20397-6-git-send-email-rob.hoes@citrix.com> <1384183828.19117.57.camel@kazak.uk.xensource.com> <360717C0B01E6345BCBE64B758E22C2D16F8C7@AMSPEX01CL03.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <360717C0B01E6345BCBE64B758E22C2D16F8C7@AMSPEX01CL03.citrite.net> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Rob Hoes Cc: Ian Jackson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2013-11-12 at 13:46 +0000, Rob Hoes wrote: > > > +xtl_LIBS = \ > > > + -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog > > $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \ > > > + -cclib -lxenctrl > > > > Sadly: > > /usr/bin/ld: cannot find -lxenctrl > > collect2: error: ld returned 1 exit status > > File "caml_startup", line 1, characters 0-1: > > Error: Error during linking > > > > You need to be using LDLIBS_libxenlight and CFLAGS_libxenlight etc like the > > tools/ocaml/libs/xl/Makefile does. On your system you are probably linking > > locally against the library in /usr/lib etc which is not desired... > > So does that mean this? > > +xtl_LIBS = \ > + -ccopt -L -ccopt $(OCAML_TOPLEVEL)/libs/xentoollog $(OCAML_TOPLEVEL)/libs/xentoollog/xentoollog.cmxa \ > + -cclib $(LDLIBS_libxenctrl) > > (this links fine on my machine) Looks better to me. I think all the usual confusion about C libraries in ocaml stubs are not a worry because this binary is in tree. Ian.