From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: Michal Marek <mmarek@suse.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
Grant Grundler <grundler@chromium.org>,
Michael Davidson <md@google.com>,
Greg Hackmann <ghackmann@google.com>,
Behan Webster <behanw@converseincode.com>,
Peter Foley <pefoley2@pefoley.com>
Subject: Re: [RFC PATCH] kbuild: Fix asm-offset generation to work with clang
Date: Fri, 14 Apr 2017 14:53:20 +0900 [thread overview]
Message-ID: <CAK7LNAQoKyyzsHuEoRppTFPA2fQhF5j8=tJmgQ2Uw2A+sC=cEA@mail.gmail.com> (raw)
In-Reply-To: <20170414003745.GI28657@google.com>
Hi Matthias,
2017-04-14 9:37 GMT+09:00 Matthias Kaehlcke <mka@chromium.org>:
> El Tue, Apr 11, 2017 at 11:03:54AM -0700 Matthias Kaehlcke ha dit:
>
>> El Tue, Apr 11, 2017 at 09:01:41PM +0900 Masahiro Yamada ha dit:
>>
>> > 2017-04-04 6:25 GMT+09:00 Matthias Kaehlcke <mka@chromium.org>:
>> > > When using clang with -no-integerated-as clang will use the gnu
>> > > assembler instead of the integrated assembler. However clang will
>> > > still perform asm error checking before sending the inline assembly
>> > > language to gas.
>> > >
>> > > The generation of asm-offsets from within C code is dependent on gcc's
>> > > blind passing of whatever is in asm() through to gas. Arbirary text is
>> > > passed through which is then modified by a sed script into the
>> > > appropriate .h and .S code. Since the arbitrary text is not valid
>> > > assembly language, clang fails.
>> > >
>> > > This can be fixed by making the arbitrary text into an ASM comment and
>> > > then updating the sed scripts accordingly to work as expected.
>> > >
>> > > This solution works for both gcc and clang.
>> > >
>> > > Based-on-patch-from: Behan Webster <behanw@converseincode.com>
>> > > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>> >
>> >
>> >
>> > Could you check Jeroen Hofstee's work for U-Boot?
>> >
>> > http://patchwork.ozlabs.org/patch/375026/
>>
>> No I didn't come across it, thanks for the pointer!
>>
>> > His idea is to use .ascii string
>> > in order to handle this in arch-agnostic way.
>>
>> Looks good, way cleaner than my proposed solution :)
>>
>> > If you are happy about this idea,
>> > I can forward his patch (with a little bit adjustment).
>>
>> With forward you mean you plan to port it? Otherwise I'm also happy to
>> give it a go, just let me know.
>>
>> > We may want to refactor the patch because
>> > the double mark ".ascii" and "->" seem redundant,
>> > but it is just a detail.
>>
>> Agree, since we are already touching this part we might as well remove
>> the "->".
>
> Thinking about it a bit more it seems safer to keep the "->" since
> the input file might contain actual ".ascii" directives.
I am not sure about this, but I do not have a strong option, either.
OK. I am keeping both .ascii and -> just in case.
https://patchwork.kernel.org/patch/9680709/
--
Best Regards
Masahiro Yamada
prev parent reply other threads:[~2017-04-14 5:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 21:25 [RFC PATCH] kbuild: Fix asm-offset generation to work with clang Matthias Kaehlcke
2017-04-11 12:01 ` Masahiro Yamada
2017-04-11 18:03 ` Matthias Kaehlcke
2017-04-14 0:37 ` Matthias Kaehlcke
2017-04-14 5:53 ` Masahiro Yamada [this message]
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='CAK7LNAQoKyyzsHuEoRppTFPA2fQhF5j8=tJmgQ2Uw2A+sC=cEA@mail.gmail.com' \
--to=yamada.masahiro@socionext.com \
--cc=behanw@converseincode.com \
--cc=ghackmann@google.com \
--cc=grundler@chromium.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=md@google.com \
--cc=mka@chromium.org \
--cc=mmarek@suse.com \
--cc=pefoley2@pefoley.com \
/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).