[cooker] kernel-release-clang

Hi,

I've split kernel-release to new package kernel-release-clang so you can
have installed kernel compiled with GCC and LLVM/clang together.

https://abf.openmandriva.org/openmandriva/kernel-release-clang

Feel free to give it a good test.

Hi,

I'm thinking we want to publish this in News - OpenMandriva as soon as there are successful builds. Then pubic relations folks can distribute news to Linux mags and social media.

So please keep us informed here or make a note of this on IRC.

Ben Bullard
ben79

Too late, I've already did it

https://www.phoronix.com/scan.php?page=news_item&px=OpenMandriva-Clang-Kernel

napisał:

I don’t see an announce in our news.Â

How to test it?

Just run on cooker:

dnf install kernel-release-clang-desktop-clang

Then reboot :slight_smile:

Hi,

How to test it?

Just run on cooker:

dnf install kernel-release-clang-desktop-clang

Then reboot :slight_smile:

Yes, but we need to fix it first :slight_smile:

Tooling eg: make prepare & *config part which defines the compiler
for kernel internals is built with gcc right now.

Just poke me on IRC , it is easy to fix up.

Logs were checked by guys from ClangBuiltLinux and they said clang is used
every where. Anyways I'll catch you on IRC.

śr., 16 paź 2019, 14:57 użytkownik Gabriel C <nix.or.die@gmail.com> napisał:

How that? We build quiet.

The problem is simple to explain and you can test by yourself local.

The kernel itself checks for the compiler in init/Kconfig , withe the
order gcc, clang.
Based on that it defines CC_IS_*_GCC or CC_IS_*_CLANG for the
Makefile's && .config.

To force that we need to do two things.

First is to build verbose so we can see what it does eg each instance
of make need have V=1 at least.

Second each instance of make .. need have both CC=$COMPILER
HOSTCC=$COMPILER, you did that I think for final make part
but that is not enough, since the make ... configs_part defines the
compiler and the make prepare parts building the tools with the
defines.

What I mean is this, just have a look:

We do right now this:
  make CC=clang ARCH=.. config_stuff

What we see is this:
...
HOSTCC scripts/basic/fixdep
...

While it looks fine is not. Adding verbose will show you this:

make V=1 CC=clang ARCH=x86_64 defconfig
make -f ./scripts/Makefile.build obj=scripts/basic
  gcc -Wp,-MD,scripts/basic/.fixdep.d <---

Now adding HOSTCC will fix this.
make V=1 CC=clang HOSTCC=clang ARCH=x86_64 defconfig
make -f ./scripts/Makefile.build obj=scripts/basic
  clang -Wp,-MD,scripts/basic/.fixdep.d <---

...
grep CONFIG_CC_IS .config
CONFIG_CC_IS_CLANG=y
...

Same for prepare etc :

make V=1 CC=clang prepare
make -f ./Makefile syncconfig
make -f ./scripts/Makefile.build obj=scripts/basic
  gcc -Wp,-MD,scripts/basic/.fixdep.d <---

Vs

make V=1 CC=clang HOSTCC=clang prepare
make -f ./Makefile syncconfig
make -f ./scripts/Makefile.build obj=scripts/basic
  clang -Wp,-MD,scripts/basic/.fixdep.d <---

We really want objtool and friends to be compiled with the same compiler.
I guess we need force that on gcc too so we are sure we build on gcc
build with GCC and CLANG build with clang,

Once we build the apps in clang build we need to check all. Some like
perf has an CLANG=1 build switch some I think not.