All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: "Roger Pau Monné" <roger.pau@citrix.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	AndrewCooper <andrew.cooper3@citrix.com>,
	IanJackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH 1/2] x86/clang: fix build with indirect thunks
Date: Thu, 25 Jan 2018 02:39:36 -0700	[thread overview]
Message-ID: <5A69B3E802000078001A23DE@prv-mh.provo.novell.com> (raw)
In-Reply-To: <20180124170625.t6fsnfenzp3bqjme@MacBook-Pro-de-Roger.local>

>>> On 24.01.18 at 18:06, <roger.pau@citrix.com> wrote:
> On Wed, Jan 24, 2018 at 09:40:40AM -0700, Jan Beulich wrote:
>> >>> On 24.01.18 at 16:48, <roger.pau@citrix.com> wrote:
>> > The build with clang is currently broken because clang requires asm
>> > macros to be declared inside the same inline asm declaration where
>> > they are used.
>> 
>> I don't understand this: What if I have two asm()-s needing it? Does
>> this need to be done in each one? I'd expect this to result in duplicate
>> definitions on gas then (which may or may not be benign).
> 
> It's quite fun, this approach works fine with clang regardless of the
> number of asm()-s needing it. It doesn't complain about duplicate
> macros or anything. OTOH gcc complains with "Error: Macro `foo' was
> already defined".

And does clang need it in each asm()? Albeit - since the order
functions are being output is undefined, it probably should go into
each one. Hence the answer would only affect whether ...

> One option might be to guard indirect_thunk_asm.h with:
> 
> .ifndef INDIRECT_THUNK_ASM
> .equ INDIRECT_THUNK_ASM, 1
> 
> ...
> 
> .endif

... this would be needed conditionally for gas, or unconditionally.

>> > --- a/xen/Rules.mk
>> > +++ b/xen/Rules.mk
>> > @@ -66,8 +66,10 @@ endif
>> >  
>> >  AFLAGS-y                += -D__ASSEMBLY__
>> >  
>> > -# Clang's built-in assembler can't handle embedded .include's
>> > -CFLAGS-$(clang)         += -no-integrated-as
>> > +# Clang's built-in assembler doesn't understand assembler directives without
>> > +# an absolute value:
>> > +# https://bugs.llvm.org/show_bug.cgi?id=27369 
>> > +AFLAGS-$(clang)         += -no-integrated-as
>> 
>> I also don't understand this - when you switch (back) to AFLAGS, you
>> don't affect C files.
> 
> Yes, it affects C files because now they are assembled using the
> integrated as, not the external one.
> 
>> Furthermore without using its integrated assembler
>> for C files at present - how is the build broken?
> 
> Not using the integrated as is a workaround for using the indirect
> thunk. If we can manage to get the indirect thunk to work with the
> integrated as there's no need to use the external one for C files.

Well, that'll hopefully become more clear with a more precise
description.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-01-25  9:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-24 15:48 [PATCH 0/2] clang: fixes for the indirect thunk Roger Pau Monne
2018-01-24 15:48 ` [PATCH 1/2] x86/clang: fix build with indirect thunks Roger Pau Monne
2018-01-24 16:40   ` Jan Beulich
2018-01-24 17:06     ` Roger Pau Monné
2018-01-25  9:39       ` Jan Beulich [this message]
2018-01-25  9:50         ` Roger Pau Monné
2018-01-24 15:48 ` [PATCH 2/2] x86: fix indirect thunk usage of CONFIG_INDIRECT_THUNK Roger Pau Monne
2018-01-24 16:23   ` Jan Beulich
2018-01-24 16:52     ` Roger Pau Monné
2018-01-25 10:13       ` Jan Beulich
2018-01-25 10:15       ` Roger Pau Monné

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=5A69B3E802000078001A23DE@prv-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.