diff options
| author | VinÃcius Tinti <viniciustinti@gmail.com> | 2017-04-24 16:04:58 -0400 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-04-24 19:13:52 -0400 |
| commit | 433db3e260bc8134d4a46ddf20b3668937e12556 (patch) | |
| tree | 2174c7cc5e16f1a275a8bfc456428099c94d2700 /scripts | |
| parent | 785f11aa595bc3d4e74096cbd598ada54ecc0d81 (diff) | |
kbuild: Add support to generate LLVM assembly files
Add rules to kbuild in order to generate LLVM assembly files with the .ll
extension when using clang.
# from c code
make CC=clang kernel/pid.ll
Signed-off-by: VinÃcius Tinti <viniciustinti@gmail.com>
Signed-off-by: Behan Webster <behanw@converseincode.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index d883116ebaa4..e5f1425c601f 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
| @@ -177,6 +177,14 @@ cmd_cc_symtypes_c = \ | |||
| 177 | $(obj)/%.symtypes : $(src)/%.c FORCE | 177 | $(obj)/%.symtypes : $(src)/%.c FORCE |
| 178 | $(call cmd,cc_symtypes_c) | 178 | $(call cmd,cc_symtypes_c) |
| 179 | 179 | ||
| 180 | # LLVM assembly | ||
| 181 | # Generate .ll files from .c | ||
| 182 | quiet_cmd_cc_ll_c = CC $(quiet_modtag) $@ | ||
| 183 | cmd_cc_ll_c = $(CC) $(c_flags) -emit-llvm -S -o $@ $< | ||
| 184 | |||
| 185 | $(obj)/%.ll: $(src)/%.c FORCE | ||
| 186 | $(call if_changed_dep,cc_ll_c) | ||
| 187 | |||
| 180 | # C (.c) files | 188 | # C (.c) files |
| 181 | # The C file is compiled and updated dependency information is generated. | 189 | # The C file is compiled and updated dependency information is generated. |
| 182 | # (See cmd_cc_o_c + relevant part of rule_cc_o_c) | 190 | # (See cmd_cc_o_c + relevant part of rule_cc_o_c) |
