From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: error while static linking of libxenctrl and libxenguest Date: Mon, 19 May 2008 17:16:06 +0200 Message-ID: <20080519151606.GR5731@implementation> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hello, When statically linking the following program: #include #include #include int main(void) { printf("%p\n", xc_domain_resume); printf("%p\n", xc_domain_save); return 0; } gcc -static test.c -o test -lxenguest -lxenctrl -lpthread -lz we get /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/libxenctrl.a(xc_private.o): In function `lock_pages': /home/sthibault/xen-unstable-stubdom.hg/tools/libxc/xc_private.c:130: multiple definition of `lock_pages' /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/libxenguest.a(xg_private.o):/home/sthibault/xen-unstable-stubdom.hg/tools/libxc/xg_private.c:15: first defined here /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/libxenctrl.a(xc_private.o): In function `unlock_pages': /home/sthibault/xen-unstable-stubdom.hg/tools/libxc/xc_private.c:142: multiple definition of `unlock_pages' /usr/lib/gcc/x86_64-linux-gnu/4.2.3/../../../../lib/libxenguest.a(xg_private.o):/home/sthibault/xen-unstable-stubdom.hg/tools/libxc/xg_private.c:24: first defined here Since libxenguest depends on libxenctrl anyway, shouldn't it use xc_private's lock/unlock functions? Samuel