<br><div class="gmail_quote">On Fri, Sep 7, 2012 at 10:03 AM,  <span dir="ltr"><<a href="mailto:llvmdev-request@cs.uiuc.edu" target="_blank">llvmdev-request@cs.uiuc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Message: 1<br>
Date: Thu, 06 Sep 2012 21:58:52 -0400<br>
From: Behan Webster <<a href="mailto:behanw@converseincode.com">behanw@converseincode.com</a>><br>
To: "<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>" <<a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a>><br>
Subject: [LLVMdev] The LLVMLinux Project<br>
Message-ID: <<a href="mailto:504954DC.3010708@converseincode.com">504954DC.3010708@converseincode.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"<br>
<br>
I'd like to announce the LLVMLinux project. This project aims to fully<br>
build the Linux kernel using Clang/LLVM on the various architectures<br>
supported by the Linux kernel. The project consolidates the work of the<br>
lll-project, the PAX team, and Mark Charlebois' work on the ARM kernel.<br>
<br>
<a href="http://llvm.linuxfoundation.org" target="_blank">http://llvm.linuxfoundation.org</a> <<a href="http://llvm.linuxfoundation.org/" target="_blank">http://llvm.linuxfoundation.org/</a>><br>
<br>
The hope is that this project will help reduce duplicate work, as well<br>
as concentrate, and accelerate efforts around this subject matter in<br>
order to allow Linux Kernel developers, and system integrators to have<br>
the choice of a Clang compiled Linux kernel. The goal is for this<br>
project to be a testing/proving ground for these updates and to get<br>
patches that make this possible upstream to their respective projects<br>
(Clang/LLVM and the Linux Kernel).<br>
<br>
Currently the work is centred around the ARM, x86 and x86_64<br>
architectures but contributions to support other architectures are<br>
welcome. Patches accepted!<br>
<br>
The Linux Kernel has some issues with being compiled with Clang; these<br>
are issues which the LLVMLinux project is attempting to fix in the Linux<br>
Kernel code base and pushed upstream:<br>
<br>
* The use of variable length arrays in structs (VLAIS)<br>
* Kbuild support for Clang (currently Kbuild is gcc specific)<br>
* Use of explicit register variables<br>
* Extra __refdata annotations needed to overcome segment reference errors<br>
* EXPORT_SYMBOL of inline functions<br>
<br>
However, there are some things in Clang/LLVM which also need to be<br>
addressed in order to make a Clang compiled Linux Kernel possible.<br>
Amongst other things these are:<br>
<br>
* The Linux kernel currently uses compiler flags which are unsupported<br>
in Clang:<br>
   * -fdelete-null-pointer-checks<br>
   * --fno-inline-functions-called-once<br>
   * --Wno-unused-but-set-variable vs --Wno-unused-variable (GCC 4.6)<br>
   * --mabi=aapcs-linux (Bug 11326)<br>
* Clang also reports errors for redefinitions of posix functions used in<br>
Linux kernel. It should be possible to suppress this.<br>
<br>
The LLVMLinux project is certainly following and hope to contribute to<br>
issues listed in the LLVM Meta bug 4068.<br>
<br>
But let me finish by thanking you all for the LLVM project and Clang<br>
toolchain. They are truly an awesome accomplishment.<br>
<br>
Behan<br>
<br>
--<br>
Behan Webster<br>
<a href="mailto:behanw@converseincode.com">behanw@converseincode.com</a><br>
<br>
<br>
</blockquote></div><font><span style="font-size:10pt"><br>Thanks Behan for the project summary. <br><br>I've been focused on building ARM Linux (versatile express) with Clang as part of the LLVMLinux project.<br><br>
There is only one remaining ARM specific issue with Clang/LLVM which if fixed would allow an unmodified Clang/LLVM build to build the tip ARM Linux kernel with a few Linux patches:<br>
<br>
* ARM 64-bit type handling (ARM paired registers), namely Bug 11753<br>
<br>Other non-gating Clang/LLVM issues:<br><br>* Improved Clang IA support for ARM - to remove gas dependency<br>
* Compiler-rt cross build for ARM which is needed for EABI builds (Bug 12989)<br>
</span></font><br>The --mabi=aapcs-linux (Bug 11326) issue listed above would be very nice to have fixed as the only kernel workaround is to remove the flag.<br><br>The debug output from Clang is very helpful and I look forward to building upstream Linux for ARM in the near future with upstream Clang/LLVM. <br>
<br>- Mark Charlebois<br><br>