graysky2 / kernel_compiler_patch

Kernel patch enables compiler optimizations for additional CPUs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LLVM/Clang patches ?

AdelKS opened this issue · comments

Hello!

First of all, thank you for these patches! I started experimenting lately with building the kernel with llvm, using linux-tkg building script. Enabling your patches don't seem to make the building fail, but would LLVM use the -march=native flag too ?

Thanks.

Adel

No idea about clang... this patch is enables gcc stuff. I think you need to look elsewhere for clang stuff but I am no expert..

Okay! Thank you for your fast answer. I will look this up somewhere else!

Feel free to update if you find something that you feel will be helpful for others.

I definitely will ! If I find anything. I will put this on the side for now.

After getting a look at the patches. I think it should work with these patches right away, I guess that's why it's building fine with this patch with Clang. I am no expert in Kernel building, is there a way to display the used flags during compilation ?

Whatever you setup for your own (Arch stores them $MAKEFLAGS), plus whatever is getting build here based on your choice with my patch. I do not build much with clang so I can't suggest. Perhaps there is a verbose switch you can add?

Try running ps when you're compiling, the flags will probably be listed

Great idea @FireBurn ! So yes, Clang does compile with -march native. So the patches as-is work with clang out of the box. Makes sense since all that is done, to my little knowledge, is a change in the CC and LD variables (and some others). The arguments given are the same.

@graysky2 If we can get another confirmation that it works with Clang, then maybe you can change the README to not make it sound it's GCC specific. I don't know what you think about that.