From patchwork Thu Apr 7 18:46:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 8776021 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7D58A9FBEA for ; Thu, 7 Apr 2016 18:50:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A58C720212 for ; Thu, 7 Apr 2016 18:50:08 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA22E201D3 for ; Thu, 7 Apr 2016 18:50:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoExO-0003zi-UL; Thu, 07 Apr 2016 18:47:06 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aoExO-0003zc-9S for xen-devel@lists.xen.org; Thu, 07 Apr 2016 18:47:06 +0000 Received: from [85.158.143.35] by server-3.bemta-6.messagelabs.com id 76/F1-07120-92BA6075; Thu, 07 Apr 2016 18:47:05 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRWlGSWpSXmKPExsXitHSDva7marZ wg89nmS2WfFzM4sDocXT3b6YAxijWzLyk/IoE1owZTafYCi4LVLz5+IGpgXEjXxcjJ4eEgL/E xU0f2UBsNgF9id0vPjGB2CIC6hKnOy6ygtjMAnkSZ1p6WboYOTiEBSwkVpzQBgmzCKhIHFjfA VbCK+AhceDiCRaIkXIS54//ZAaxhQTUJK71X2KHqBGUODnzCQvESAmJgy9eMEPUc0vcPj2VeQ IjzywkZbOQlC1gZFrFqF6cWlSWWqRrqJdUlJmeUZKbmJmja2hgppebWlycmJ6ak5hUrJecn7u JERggDECwg3Hnc6dDjJIcTEqivEtWsIUL8SXlp1RmJBZnxBeV5qQWH2KU4eBQkuCdswooJ1iU mp5akZaZAwxVmLQEB4+SCG8xSJq3uCAxtzgzHSJ1ilFRSpzXAiQhAJLIKM2Da4PFxyVGWSlhX kagQ4R4ClKLcjNLUOVfMYpzMCoJ84aATOHJzCuBm/4KaDET0OIL/GCLSxIRUlINjJLybdr3Py 41uvZCSsD4jnQb96IHvXrddktnqH8u+WPBMZWbvTZJd979zdwLrUTy33y7Zzzh2dFaT+mPbqv YGDcYhV/SWnTx0HefbUlNncIn6q7N2b71l/erj81/+26fEn3W8bDNxmp2Z+yznZVc1RnmkytD JuV6iQpZf3gv2R1VKiMczxUvo8RSnJFoqMVcVJwIAKeg1EOKAgAA X-Env-Sender: prvs=898633312=Andrew.Cooper3@citrix.com X-Msg-Ref: server-5.tower-21.messagelabs.com!1460054821!8127871!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.28; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25310 invoked from network); 7 Apr 2016 18:47:04 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-5.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 7 Apr 2016 18:47:04 -0000 X-IronPort-AV: E=Sophos;i="5.24,449,1454976000"; d="scan'208";a="352292816" From: Andrew Cooper To: Xen-devel Date: Thu, 7 Apr 2016 19:46:45 +0100 Message-ID: <1460054805-2393-1-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , Wei Liu , Jan Beulich Subject: [Xen-devel] [PATCH for-4.7] xen/build: Fix build with Clang X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP c/s 607044bf9 "build: avoid putting local absolute symbols in symbol tables" breaks the build with Clang, as the command line argument isn't understood. Clang does not appear to have any equivielent option, and already has outstanding issues with duplicate symbols. Excluding this option makes the problem no worse. Signed-off-by: Andrew Cooper --- CC: Jan Beulich The clang build already has many duplicate symbols for some reason I have yet to identify, e.g. Duplicate symbol 'asid.c#get_cpu_info' (ffff82d0801e6840 != ffff82d0801c8190) Duplicate symbol 'ats.c#__list_add' (ffff82d08015b900 != ffff82d0801546a0) Duplicate symbol 'common.c#clear_bit' (ffff82d080213560 != ffff82d0801baf10) Duplicate symbol 'common.c#constant_test_bit' (ffff82d080213550 != ffff82d0801ba750) Duplicate symbol 'common.c#cpumask_check' (ffff82d080218c50 != ffff82d0801baf20) Duplicate symbol 'common.c#cpumask_clear_cpu' (ffff82d080214990 != ffff82d0801bae40) Duplicate symbol 'common.c#get_cpu_info' (ffff82d080212210 != ffff82d0801bad20) The resulting binary does function. Someone with more time can investigate making symbol handling work better with Clang --- xen/Rules.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index d4dffde..7183d69 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -50,9 +50,15 @@ ALL_OBJS-$(CONFIG_X86) += $(BASEDIR)/crypto/built_in.o CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h -CFLAGS += -Wa,--strip-local-absolute CFLAGS += '-D__OBJECT_FILE__="$@"' +ifneq ($(clang),y) +# Clang doesn't understand this command line argument, and doesn't appear to +# have an suitable alternative. The resulting compiled binary does function, +# but has an excessively large symbol table. +CFLAGS += -Wa,--strip-local-absolute +endif + CFLAGS-$(verbose) += -DVERBOSE CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS