From nobody Fri Apr 26 16:22:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1589992838; cv=none; d=zohomail.com; s=zohoarc; b=oDG42sEBfpjHyCIu2pgj/PFi3F/GON2LOLTRJEG4fWKTdTugCMuKk9IRq1rLBxgUZcJ5e9Wuwim+5TlSEYzMgiEA16ltF7eTAV5kvQ2n7QETlG+WPl6FqQZjasN/7Ab7a2CtbwL1U7DVtuVid7PMt+2T1HhOvbmh7pjdUrMSkmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589992838; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=hw6PNcvx/++geCqFTgldpJ7PjsNliTV0e2MMyfFz+kk=; b=i4mXKZDsx2X0kuQPhrpsbv3fgaV5Td6qQZuQ3CfZKLg01pdvWEJhrLCWoTh+ayxm9TdC3TNQd/8rdBAABRmz2zdZSFSQ4SityG/7xdt7IwzuyG/zYO2mw9EQLe3RJoJFah0CQKkb4jFGm9bwGPNUt3lNZJyL9bmSVCiuJvw4oAc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1589992838202212.43009384032587; Wed, 20 May 2020 09:40:38 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jbRlA-0003tt-LL; Wed, 20 May 2020 16:40:00 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jbRl9-0003to-J5 for xen-devel@lists.xenproject.org; Wed, 20 May 2020 16:39:59 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 89ff5119-9ab8-11ea-aa4a-12813bfff9fa; Wed, 20 May 2020 16:39:57 +0000 (UTC) X-Inumbo-ID: 89ff5119-9ab8-11ea-aa4a-12813bfff9fa Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: vic9C3J8syvj01Av36Yw7bN1hPC785ufRTbsmxUCFdUpQp/Lx1JyLyuiUSd4szXY4rOrWTtJ7E cnR9LsQv08y7meAPD+9gcM4Sx55Cee40gQZdnjkC8xyiJjbiCacP7iqtHkPYtGQP2vOcvDfYhk hlG9yRGH8NVeLvQgLna+c2SaueOJ1PUE9WQ76d3z80Eo5zU+MAlTcc5yowBpc8LHQ88xwIKKri MUauDF9t+sad6SJkB2bjqS0SvBZbwLO8YEzB4HUR2R0pOr8HP9y1tVZNY18qBAfS62bdfq8Rw5 vVE= X-SBRS: 2.7 X-MesageID: 18273329 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,414,1583211600"; d="scan'208";a="18273329" From: Anthony PERARD To: Subject: [XEN PATCH] tools/xenstore: mark variable in header as extern Date: Wed, 20 May 2020 17:39:42 +0100 Message-ID: <20200520163942.131919-1-anthony.perard@citrix.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Anthony PERARD , Ian Jackson , Wei Liu Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" This patch fix "multiple definition of `xprintf'" (or xgt_handle) build error with GCC 10.1.0. These are the error reported: gcc xs_tdb_dump.o utils.o tdb.o talloc.o -o xs_tdb_dump /usr/bin/ld: utils.o:./utils.h:27: multiple definition of `xprintf'; xs= _tdb_dump.o:./utils.h:27: first defined here [...] gcc xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_tra= nsaction.o xenstored_control.o xs_lib.o talloc.o utils.o tdb.o hashtable.o = xenstored_posix.o -lsystemd -Wl,-rpath-link=3D... ../libxc/libxenctr= l.so -lrt -o xenstored /usr/bin/ld: xenstored_watch.o:./xenstored_core.h:207: multiple definit= ion of `xgt_handle'; xenstored_core.o:./xenstored_core.h:207: first defined= here /usr/bin/ld: xenstored_domain.o:./xenstored_core.h:207: multiple defini= tion of `xgt_handle'; xenstored_core.o:./xenstored_core.h:207: first define= d here /usr/bin/ld: xenstored_transaction.o:./xenstored_core.h:207: multiple d= efinition of `xgt_handle'; xenstored_core.o:./xenstored_core.h:207: first d= efined here /usr/bin/ld: xenstored_control.o:./xenstored_core.h:207: multiple defin= ition of `xgt_handle'; xenstored_core.o:./xenstored_core.h:207: first defin= ed here /usr/bin/ld: xenstored_posix.o:./xenstored_core.h:207: multiple definit= ion of `xgt_handle'; xenstored_core.o:./xenstored_core.h:207: first defined= here A difference that I noticed with earlier version of the build chain is that before, I had: $ nm xs_tdb_dump.o | grep xprintf 0000000000000008 C xprintf And now, it's: 0000000000000000 B xprintf With the patch apply, the symbol isn't in xs_tdb_dump.o anymore. Signed-off-by: Anthony PERARD Acked-by: Andrew Cooper Reviewed-by: Ian Jackson --- tools/xenstore/utils.h | 2 +- tools/xenstore/xenstored_core.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/xenstore/utils.h b/tools/xenstore/utils.h index 522c3594a2ba..6a1b5de9bdc1 100644 --- a/tools/xenstore/utils.h +++ b/tools/xenstore/utils.h @@ -24,7 +24,7 @@ static inline bool strends(const char *a, const char *b) void barf(const char *fmt, ...) __attribute__((noreturn)); void barf_perror(const char *fmt, ...) __attribute__((noreturn)); =20 -void (*xprintf)(const char *fmt, ...); +extern void (*xprintf)(const char *fmt, ...); =20 #define eprintf(_fmt, _args...) xprintf("[ERR] %s" _fmt, __FUNCTION__, ##_= args) =20 diff --git a/tools/xenstore/xenstored_core.h b/tools/xenstore/xenstored_cor= e.h index 56a279cfbb47..c4c32bc88f0c 100644 --- a/tools/xenstore/xenstored_core.h +++ b/tools/xenstore/xenstored_core.h @@ -204,7 +204,7 @@ void finish_daemonize(void); /* Open a pipe for signal handling */ void init_pipe(int reopen_log_pipe[2]); =20 -xengnttab_handle **xgt_handle; +extern xengnttab_handle **xgt_handle; =20 int remember_string(struct hashtable *hash, const char *str); =20 --=20 Anthony PERARD