From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: "Michal Marek" <mmarek@suse.com>,
"Emese Revfy" <re.emese@gmail.com>,
"Kees Cook" <keescook@chromium.org>,
"Behan Webster" <behanw@converseincode.com>,
"Luis R . Rodriguez" <mcgrof@kernel.org>,
"Vinícius Tinti" <viniciustinti@gmail.com>,
"Kyeongmin Cho" <korea.drzix@gmail.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>,
"Peter Foley" <pefoley2@pefoley.com>
Subject: Re: [PATCH v3] kbuild: Add support to generate LLVM bitcode files
Date: Fri, 21 Apr 2017 14:02:46 +0900 [thread overview]
Message-ID: <CAK7LNASfCFW4KZ72rYXQTpYFGf+KJcjK+L8wvHtiHmXNVYRtwg@mail.gmail.com> (raw)
In-Reply-To: <20170404172706.171971-1-mka@chromium.org>
Hi Matthias,
2017-04-05 2:27 GMT+09:00 Matthias Kaehlcke <mka@chromium.org>:
> From: Vinícius Tinti <viniciustinti@gmail.com>
>
> Add rules to kbuild in order to generate LLVM bitcode files with the .ll
> extension when using clang.
First, I'd like to be sure about the terminology "LLVM bitcode"
because "bitcode" sounds like human-unreadable binary.
For example, 'man llvm-as' says:
llvm-as is the LLVM assembler. It reads a file containing
human-readable LLVM assembly language, translates it to LLVM
bitcode, and writes the result into a file or to standard output.
As far as I understood:
*.ll - LLVM assembly (human readable file)
*.bc - LLVM bitcode (binary file)
Is this correct?
> # from c code
> CC=clang make kernel/pid.ll
This does not work because CC is overridden in the top-level Makefile.
It should be
make CC=clang kernel/pid.ll
> # from asm code
> CC=clang make arch/x86/kernel/preempt.ll
arch/x86/kernel/preempt.* does not exist
(at least in the latest tree).
> +
> +quiet_cmd_as_ll_S = CPP $(quiet_modtag) $@
> + cmd_as_ll_S = $(CPP) $(a_flags) -o $@ $<
> +
> +$(obj)/%.ll: $(src)/%.S FORCE
> + $(call if_changed_dep,as_ll_S)
> +
I could not understand how this rule can convert
architecture-specific assembly to LLVM intermediate expression.
This is just pre-processing *.S file.
Actually, this is completely the same as the rule *.S -> *.s
quiet_cmd_cpp_s_S = CPP $(quiet_modtag) $@
cmd_cpp_s_S = $(CPP) $(a_flags) -o $@ $<
$(obj)/%.s: $(src)/%.S FORCE
$(call if_changed_dep,cpp_s_S)
--
Best Regards
Masahiro Yamada
next prev parent reply other threads:[~2017-04-21 5:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 17:27 [PATCH v3] kbuild: Add support to generate LLVM bitcode files Matthias Kaehlcke
2017-04-20 18:04 ` Matthias Kaehlcke
2017-04-21 5:02 ` Masahiro Yamada [this message]
2017-04-21 19:55 ` Matthias Kaehlcke
2017-04-23 6:57 ` Masahiro Yamada
2017-04-24 2:21 ` Masahiro Yamada
-- strict thread matches above, loose matches on Subject: below --
2014-07-23 12:00 [PATCH v2] kbuild: add " Tinti
2014-09-11 23:13 ` [PATCH v3] " Vinícius Tinti
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=CAK7LNASfCFW4KZ72rYXQTpYFGf+KJcjK+L8wvHtiHmXNVYRtwg@mail.gmail.com \
--to=yamada.masahiro@socionext.com \
--cc=behanw@converseincode.com \
--cc=ghackmann@google.com \
--cc=grundler@chromium.org \
--cc=keescook@chromium.org \
--cc=korea.drzix@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=md@google.com \
--cc=mka@chromium.org \
--cc=mmarek@suse.com \
--cc=pefoley2@pefoley.com \
--cc=re.emese@gmail.com \
--cc=viniciustinti@gmail.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).