xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <JBeulich@suse.com>
Subject: [PATCH for-4.7] xen/build: Fix build with Clang
Date: Thu, 7 Apr 2016 19:46:45 +0100	[thread overview]
Message-ID: <1460054805-2393-1-git-send-email-andrew.cooper3@citrix.com> (raw)

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 <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>

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
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

             reply	other threads:[~2016-04-07 18:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 18:46 Andrew Cooper [this message]
2016-04-07 19:12 ` [PATCH for-4.7] xen/build: Fix build with Clang Jan Beulich
2016-04-07 19:16   ` Andrew Cooper
2016-04-07 19:21     ` Jan Beulich
2016-04-07 19:23       ` Andrew Cooper
2016-04-07 20:55       ` Doug Goldstein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460054805-2393-1-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).