[llvmlinux] Compiling sources from llvmlinux/kernel.git

Jan-Simon Moeller dl9pf at gmx.de
Wed Nov 26 12:12:12 UTC 2014


Am Mittwoch, 26. November 2014, 12:53:17 schrieb Juan Simón:
> Hi,
> I've followed the instructions on main page to compile the kernel with
> clang on Ubuntu 14.04 64 bits:
> 
>    1. Get the latest SVN version of clang (version 3.5 from PPA)
>    2. Get the kernel pacthed from "git clone
>    git://git.linuxfoundation.org/llvmlinux/kernel.git"
>    3. Execute: "export HOSTCC=clang CC=clang"

Exporting it in your shell environment might not end up in the build process 
with dpkg rules. Export it in the rules file maybe ?


or create a "makefile" (little m !!!) in the toplevel kernel-dir with this 
content:

#

CC              := clang
CPP             := $(CC) -E
HOSTCC          := clang
lm = $(MAKE) -f Makefile O="$(1)" CPP="$(CPP)" CC="$(CC)" HOSTCC="$(HOSTCC)"

%:
	@$(call lm,$(O),$@)
all:
	@$(call lm,$(O),$@)

#


>    4. From here I compile the kernel at Ubuntu way to obtain DEB packages:
>       1. I patched the kernel with the patches in
>       http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc6-vivid/
>       2. cp /boot/config-`uname -r`
>       debian.master/config/amd64/config.flavour.i7
>       3. fakeroot debian/rules clean
>       4. debian/rules editconfigs
>       5. fakeroot debian/rules clean
>       6. fakeroot debian/rules binary-headers binary-i7 binary-arch-headers
> 
> I install the generated deb packages without problems.
> 
> This i7 flavour it has:
> 
> CONFIG_MCORE2=y
> 
> and it's patched with:
> 
> -cflags-$(CONFIG_MCORE2)        += -march=i686 $(call tune,core2)
> +cflags-$(CONFIG_MCORE2)        += -march=native $(call tune,native)
> 
> My doubts are:
> 
>    1. Is this kernel really compiled with clang? The compilation process
>    shows in console a lot of warnings typical of clang but when I execute
> "cat /proc/version", after reboot with the new kernel version, it shows:
> "Linux version 3.18.0-031800rc6-i7 (root at X58A-UD5) (gcc version 4.8.2
> (Ubuntu 4.8.2-19ubuntu1) )"
>    2. What's the kernel version in
>    git://git.linuxfoundation.org/llvmlinux/kernel.git? In LLVMLinux main
>    page <http://llvm.linuxfoundation.org/index.php/Main_Page> it says:
>    "Alternatively you can use the LLVMLinux kernel tree (recent mainline
> with latest LLVMLinux patches applied)" but when I execute "debian/rules
> editconfigs" it shows 3.17.0 in top of console and the git page shows
> <http://git.linuxfoundation.org/llvmlinux/kernel.git/> that the last change
> was at 15 Oct 2014.
-------------- next part --------------
#

CC              := clang
CPP             := $(CC) -E
HOSTCC          := clang
lm = $(MAKE) -f Makefile O="$(1)" CPP="$(CPP)" CC="$(CC)" HOSTCC="$(HOSTCC)"

%:
	@$(call lm,$(O),$@)
all:
	@$(call lm,$(O),$@)

#


More information about the LLVMLinux mailing list