From: Nathan Chancellor <nathan@kernel.org>
To: Zhihao Lin <zh.lin@mail.utoronto.ca>
Cc: clang-built-linux@googlegroups.com, llvm@lists.linux.dev
Subject: Re: Generating LLVM IR
Date: Wed, 6 Jul 2022 08:18:07 -0700 [thread overview]
Message-ID: <YsWnr0C2hFNSAqch@dev-arch.thelio-3990X> (raw)
In-Reply-To: <YT3PR01MB8756D354EA9FC06D5009E205A0809@YT3PR01MB8756.CANPRD01.PROD.OUTLOOK.COM>
Hi Zhihao,
On Wed, Jul 06, 2022 at 10:57:53AM +0000, Zhihao Lin wrote:
> Hello, I'm trying to build the kernel using LLVM and generate LLVM IR.
> In the makefile, I saw there is a target "dir/file.ll" provided.
> However, I want to add more attributes to the IR file generated, such
> as adding debug information. Is there any way to generate personalized
> IR by either modifying the Makefile or changing Makefile variables?
You can add additional flags to the "dir/file.ll" compiler invocation
with the KCFLAGS make variable:
$ make KCFLAGS="-ffoo -Wfoo" dir/file.ll
Additionally, there are kernel configurations, such as CONFIG_DEBUG_INFO
or CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT (depending on the kernel
version you are working against), which will add the compiler arguments
to generate debug info.
If you have any further questions, feel free to let us know! I have
added our new mailing list (llvm@lists.linux.dev) to the thread so it
can be archived at https://lore.kernel.org/llvm for future travellers,
please use that list if you start any new threads in the future :)
Cheers,
Nathan
parent reply other threads:[~2022-07-06 15:18 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <YT3PR01MB8756D354EA9FC06D5009E205A0809@YT3PR01MB8756.CANPRD01.PROD.OUTLOOK.COM>]
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=YsWnr0C2hFNSAqch@dev-arch.thelio-3990X \
--to=nathan@kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=llvm@lists.linux.dev \
--cc=zh.lin@mail.utoronto.ca \
/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