pyavitz / rpi-img-builder

Image Builder for the Raspberry Pi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

using clang/llvm with lto for kernel compiling

ptr1337 opened this issue · comments

Since Kernel 5.11 + lto can be used for compiling which could be a great performance improvement
The compile time would be little bit longer.

Also adding -mtune="x" for compile flags can improve the kernel

still not implemented ? :x

i using it since 5.13 on my rig and there is definitly a performance increase.
However, also to retarded to use the new irc :D

still not implemented ? :x

i using it since 5.13 on my rig and there is definitly a performance increase.
However, also to retarded to use the new irc :D

I just haven't gotten around to implementing it yet, as I've never personally used it and not 100% sure how to integrate it into the builder. I'll do some reading and asking around and see what I can do within the next week or so.

As for IRC, it's not rocket science or anything :)

the new one is rocket science.

i can help you if you want

Well you know where to find me, if you wanna chat.

If you have a working example, you can also post it here or Projects, much like Tenkawa did with ccache.

Ideas, thoughts and or changes?

git clone -b clang https://github.com/pyavitz/rpi-img-builder.git clang

I try a full compile.

but mostly i would say changegs in the defconf for lto.

-fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=4 -ffat-lto-objects -fuse-linker-plugin

maybe need thiis CC FLAAGS somehow

I try a full compile.

but mostly i would say changegs in the defconf for lto.

Trying to figure out how to remove this warning:

dpkg-architecture: warning: specified GNU system type aarch64-linux-gnu does not match CC system type
aarch64-unknown-linux-gnu, try setting a correct CC environment variable

Happens on both cross and native, just a diff warning. Although the kernels appear to be fine after the build?

BEcause Cross compiling.
Let me check, ill do native.

Didnt found the LTO option in the config.
its compiling now. , if i see lto compiling ill tell you

I made further adjustments to it and added missing depends. Cross is kinda sketchy using Focal, but running Native using Hirsute seems to work just fine.

LLVM=1 LLVM_IAS=1
and IAS also please.

Also you need to adjust the defconfig for lto compiling.