We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

The LLVMLinux Project

00:00

Formal Metadata

Title
The LLVMLinux Project
Title of Series
Number of Parts
90
Author
License
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Identifiers
Publisher
Release Date
Language

Content Metadata

Subject Area
Genre
Abstract
The Linux Kernel with Dragon Wings This Lightning Talk introduces the LLVMLinux Project which is the collaboration platform for all efforts around compiling the Linux Kernel with the LLVM/Clang compiler infrastructure. We'll talk and demo what we have reached so far and what we plan to do next. What challenges we face in exchanging the compiler and what is already upstreamed.
25
Thumbnail
15:46
51
54
Thumbnail
15:34
55
57
Thumbnail
1:02:09
58
Thumbnail
16:08
62
Thumbnail
13:26
65
67
GoogolLine (geometry)Projective planeCompilerFeedbackKernel (computing)Lecture/Conference
GoogolCodeFunction (mathematics)Line (geometry)Kernel (computing)CodeError messageGoogolFunction (mathematics)CASE <Informatik>Product (business)InformationSource codeUML
InformationLecture/Conference
Source codeCurvatureLink (knot theory)Error messageThermal expansionFunction (mathematics)Macro (computer science)Macro (computer science)Pairwise comparisonPosition operatorStatement (computer science)Condition numberFunction (mathematics)Pointer (computer programming)Error messageNetwork topologySource code
Level (video gaming)CompilerBranch (computer science)DataflowCodeKernel (computing)Mathematical analysisInformationSource code
Android (robot)NP-hardArmDevice driverOpen setCompilerKernel (computing)Software testingMeta elementArchitecturePatch (Unix)Software developerKernel (computing)INTEGRALMereologyIntermediate languageMultiplicationAndroid (robot)Projective planePatch (Unix)Stress (mechanics)QuicksortCompilerComputer architectureLatent heatMathematical optimizationArmScripting languageCodeVolumenvisualisierungForceRepresentation (politics)Source codeComputer animation
Meta elementPatch (Unix)Set (mathematics)Projective planeLine (geometry)Shape (magazine)ProgrammschleifeHydraulic jumpKernel (computing)Queue (abstract data type)Lecture/Conference
WebsiteWeb pageElectronic mailing listInformationArchitectureProjective planeWhiteboardLink (knot theory)Coefficient of determinationWeb pageInformationKernel (computing)
TrailSoftware developerSlide ruleComputer architecturePatch (Unix)Lecture/Conference
Electronic mailing listTelecommunicationWebsiteQR codeElectronic mailing listSlide ruleEmailRight angleCodeComputer animation
CloningScripting languagePatch (Unix)BuildingKernel (computing)Computer-generated imageryEmulationLinker (computing)Assembly languageSoftware frameworkCloningArmSoftware frameworkSoftware testingPhysical systemScripting languageKernel (computing)MathematicsPatch (Unix)MaizeComputer fileCodeSet (mathematics)Just-in-Time-CompilerLecture/ConferenceComputer animation
Patch (Unix)Cycle (graph theory)Software testingBootingRootMathematicsLecture/Conference
Revision controlBootingPatch (Unix)Kernel (computing)Software frameworkHill differential equationExpressionBootingExpressionBitWhiteboardPhysical systemSoftware testingCASE <Informatik>Just-in-Time-CompilerComputer animation
Adaptive behaviorRevision controlBoom (sailing)Kernel (computing)Template (C++)Lecture/Conference
ExpressionSoftware frameworkDisintegrationAssembly languageKernel (computing)WebsiteAsynchronous Transfer ModeReal numberRewritingLine (geometry)Function (mathematics)CodeDifferent (Kate Ryan album)Computer animation
Drop (liquid)Right angleLecture/Conference
Transcript: English(auto-generated)
Yeah, hello everyone and thanks for joining this talk so I want to present the LLVM Linux project and we were at the last plumbers and exclusively for FOSDEM We can present the t-shirt. Yeah, because
The feedback was really nice, but you have no t-shirt. So here it is So, what's this project about First of all, well, why do we want to compile the kernel with Clang? Yeah, we have GCC
We have a compiler. So why? well one reason Is we get a few more diagnostics out of Clang, yeah In the first line you see the output from GCC in this case for two and
And the second line that's the same error for Clang and you get more informative output With Clang, that's also the reason why for example Google they built their
huge code base Side by side with GCC and Clang they use GCC in production But they built with Clang for the diagnostics. Yeah So that's one example why that could be interesting for the kernel Well, we have a lot of such
warnings errors and so on So that can be quite noisy and we have to find out. Okay, what's useful now and not but still we get a lot of information out of this and more informative hints on what What might be wrong at this?
Place also we get more informative hints on what to do what to fix so Even you see here those nice carrot pointers so Clang knows how
More detail not just something went wrong and this statement so it went wrong at this position. So that's One of the strength of Clang
Comparison for the macros in GCC you just get an error. Well we have in this macro we have An error or invalid operands In Clang we get the macro expanded so you get to know
Where in the maybe daisy chain macros the bad condition happened? Yeah, so It's not then up to you to dig through maybe multiple macros and find the The spot where the back is you get a more detailed output here another thing which is
Interesting here. Is that Clang allows? More things like we have a static analyzer Where we can create
An analysis of our code flow and we can also get Detailed information on what goes wrong for example in this branch here We are currently working on
adding this analyzer with the checker to Our compilation to the Linux kernel. It's still in early stage and of course the kernel is a huge code base, but we are working on this and We are curious to see what we will find here. What can be improved?
so What else? LLVM is also part of a few more projects for example. It's an integral part of render script in Android
it's part of the Gallium 3d engine in multiple ways and This for example also full build of Debian with Clang
Tomorrow Sylvester will have his talk and he will Talk about this in more detail. So that's where Clang is already in use There's also FreeBSD port and and also Minix 3 is using it So that's quite interesting
So now back to the Linux kernel back to our LLVM Linux project So well, of course, our goal is to build the Linux kernel with Clang
For as much architectures we can reach Clang is actually inherently a cross compiler Clang uses a kind of intermediate representation. So You parse the you parse your your code get it into an intermediate
Representation can do all sorts of optimization on that intermediate Representation and finally you dump it into the Architecture specific code. So apparently Clang is a sort of a cross compiler already
So targeting multiple architectures is actually quite easy So what we want to do is we want to enable building the kernel with feeling Currently we reach that on arm x86
We are looking into MIPS, but that doesn't have a lot of traction right now now The Goal of the project is also to find anything that's kind of a blocker So we have a few spots where kind of the kernel Tends to use a really GCC specific. Yeah and see Lang
Maybe because of its architecture cannot do that. Yes There are a few things where we have to find what's what's what's the blocker here? And actually where do we solve it? Yeah, be it a kernel or be it ceiling?
We are we are no fork of the kernel or Clang yeah, we are kind of aggregating patches for both projects and we are Contributing them back to the upstream to Clang and to the Linux kernel currently for Clang and LLVM
Our patch set is quite small. It's and it's like five for each LLVM and Clang So that's kind of up to ten for the kernel. Our patch queue is quite bigger Because we have especially on x86 a few spots where
We have to kind of jump through a few hoops loops to get it working And We want to kind of Get those patches in a shape where we can move them into mainline. So
You can find information about the project here LLVM dot Linux foundation org We have Their project status page we have the roadmap there and
You can find also our links to the build board there we have a build board running which continuously builds against kernel Clang LLVM upstream Of course with our patch set on top so we are actively
Tracking the development hat so we can we can enable the the work on upstreaming the patches Architecture supported I will Go into more details in the next slides
So website you can reach us on IRC. So we are on the channel LLVM Linux on OFTC You can reach me on my NIC DL9PF there. So just drop by the channel
If you have any questions Or if you need support if you want to try it out. We have a mailing list LLVM Linux So you can post and subscribe to that list if that was too fast to note it down take a
quick shot on the QR code I will Presented on the last slide too. All right now show me the code Just go to JIT dot Linux foundation org slash LLVM Linux dot JIT
So what do you get? So it's it's no clone of the kernel It's no clone of the LLVM and Clang what you get there is a Kind of Make framework Yeah, it's a set of make files
It will download the kernel download LLVM download C lang apply all patches and then build it So in the end you get a compiled kernel kernel compiled with clang out We still we are working on
Support for cable so we want to make all those nifty changes and all those nitty-gritty workarounds we want to Make them available in the kernels cable system. So actually we can kind of throw away our
Our scripts sooner or later So that's hosted there We also do testing in this framework So for example for the arm targets, we have a QM system arm target where you just can kind of go to the
Go to the subfolder hit make and it will build everything and even boot a root FS and test it Yeah, so complete we can Do the complete cycle until it runs so that's what we actually use
What's our tool for our work in kind of getting the patches working getting everything? working and kind of for tracking upstream and for pushing our Changes upstream just an example on how to use it. So
Could go to targets via Express and The simple case would just you you hit make. Yeah this will do everything for you and
it will it will even it allows you even to boot a target boot a test system with kyamu and Verify it works There are a few targets we have the versatile Express but also
There's a target for the MSM boards I 586 x86 64 Raspberry Pi, I think we will merge Beadle board target in the next days if it's not merged yet but that's pretty rough, but
Well, it's quite easy to set up your own target. Yeah, it's just copy the template make a few adaptions and Boom you have your own target. So it's quite easy to Create your own versions create your own adaptions
x86 currently we are the only working target here is kernel 3.3 Because we have currently huge problems on on mainline That's because we had some rewrites in the in the real mode code and
That's still making troubles right now But we are working on that okay, so What what do we have to do? Flace is a big problem for us We are debugging segment differences. So if you compile with GCC and if you compile with clang the output has different
Style of linking so that's what we are debugging moving x86 to mainline So If you have any more questions
drop by on ISC check it out and build it We are always happy if you just ask Hey, I have this blob problem or what's going on ask us on ISC. We are there. All right