<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">It doesn&#39;t compile:<br><div style="margin-left:40px">/home/simon/fuentes/kernel/linux-3.17.4/security/apparmor/crypto.c:35:2: error: implicit declaration of function &lsquo;SHASH_DESC_ON_STACK&rsquo; [-Werror=implicit-function-declaration]<br>&nbsp; SHASH_DESC_ON_STACK(shash, apparmor_tfm);<br>&nbsp; ^<br>/home/simon/fuentes/kernel/linux-3.17.4/security/apparmor/crypto.c:35:22: error: &lsquo;shash&rsquo; undeclared (first use in this function)<br>&nbsp; SHASH_DESC_ON_STACK(shash, apparmor_tfm);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^<br></div>Is this a known bug? I haven&#39;t found it in bug tracker.<br></div><div class="gmail_default" style="font-family:verdana,sans-serif">I&#39;ve tested it with clang-3.5 and clang-3.6. Same error.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-26 13:12 GMT+01:00 Jan-Simon Moeller <span dir="ltr">&lt;<a href="mailto:dl9pf@gmx.de" target="_blank">dl9pf@gmx.de</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am Mittwoch, 26. November 2014, 12:53:17 schrieb Juan Simón:<br>
<span class="">&gt; Hi,<br>
&gt; I&#39;ve followed the instructions on main page to compile the kernel with<br>
&gt; clang on Ubuntu 14.04 64 bits:<br>
&gt;<br>
</span>&gt;&nbsp; &nbsp; 1. Get the latest SVN version of clang (version 3.5 from PPA)<br>
&gt;&nbsp; &nbsp; 2. Get the kernel pacthed from &quot;git clone<br>
&gt;&nbsp; &nbsp; git://<a href="http://git.linuxfoundation.org/llvmlinux/kernel.git" target="_blank">git.linuxfoundation.org/llvmlinux/kernel.git</a>&quot;<br>
&gt;&nbsp; &nbsp; 3. Execute: &quot;export HOSTCC=clang CC=clang&quot;<br>
<br>
Exporting it in your shell environment might not end up in the build process<br>
with dpkg rules. Export it in the rules file maybe ?<br>
<br>
<br>
or create a &quot;makefile&quot; (little m !!!) in the toplevel kernel-dir with this<br>
content:<br>
<br>
#<br>
<br>
CC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := clang<br>
CPP&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= $(CC) -E<br>
HOSTCC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := clang<br>
lm = $(MAKE) -f Makefile O=&quot;$(1)&quot; CPP=&quot;$(CPP)&quot; CC=&quot;$(CC)&quot; HOSTCC=&quot;$(HOSTCC)&quot;<br>
<br>
%:<br>
&nbsp; &nbsp; &nbsp; &nbsp; @$(call lm,$(O),$@)<br>
all:<br>
&nbsp; &nbsp; &nbsp; &nbsp; @$(call lm,$(O),$@)<br>
<br>
#<br>
<br>
<br>
&gt;&nbsp; &nbsp; 4. From here I compile the kernel at Ubuntu way to obtain DEB packages:<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;1. I patched the kernel with the patches in<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;<a href="http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc6-vivid/" target="_blank">http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.18-rc6-vivid/</a><br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;2. cp /boot/config-`uname -r`<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;debian.master/config/amd64/config.flavour.i7<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;3. fakeroot debian/rules clean<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;4. debian/rules editconfigs<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;5. fakeroot debian/rules clean<br>
&gt;&nbsp; &nbsp; &nbsp; &nbsp;6. fakeroot debian/rules binary-headers binary-i7 binary-arch-headers<br>
<span class="">&gt;<br>
&gt; I install the generated deb packages without problems.<br>
&gt;<br>
&gt; This i7 flavour it has:<br>
&gt;<br>
&gt; CONFIG_MCORE2=y<br>
&gt;<br>
&gt; and it&#39;s patched with:<br>
&gt;<br>
&gt; -cflags-$(CONFIG_MCORE2)&nbsp; &nbsp; &nbsp; &nbsp; += -march=i686 $(call tune,core2)<br>
&gt; +cflags-$(CONFIG_MCORE2)&nbsp; &nbsp; &nbsp; &nbsp; += -march=native $(call tune,native)<br>
&gt;<br>
&gt; My doubts are:<br>
&gt;<br>
</span>&gt;&nbsp; &nbsp; 1. Is this kernel really compiled with clang? The compilation process<br>
<span class="">&gt;&nbsp; &nbsp; shows in console a lot of warnings typical of clang but when I execute<br>
&gt; &quot;cat /proc/version&quot;, after reboot with the new kernel version, it shows:<br>
&gt; &quot;Linux version 3.18.0-031800rc6-i7 (root@X58A-UD5) (gcc version 4.8.2<br>
&gt; (Ubuntu 4.8.2-19ubuntu1) )&quot;<br>
</span>&gt;&nbsp; &nbsp; 2. What&#39;s the kernel version in<br>
<span class="">&gt;&nbsp; &nbsp; git://<a href="http://git.linuxfoundation.org/llvmlinux/kernel.git" target="_blank">git.linuxfoundation.org/llvmlinux/kernel.git</a>? In LLVMLinux main<br>
</span><span class="">&gt;&nbsp; &nbsp; page &lt;<a href="http://llvm.linuxfoundation.org/index.php/Main_Page" target="_blank">http://llvm.linuxfoundation.org/index.php/Main_Page</a>&gt; it says:<br>
&gt;&nbsp; &nbsp; &quot;Alternatively you can use the LLVMLinux kernel tree (recent mainline<br>
&gt; with latest LLVMLinux patches applied)&quot; but when I execute &quot;debian/rules<br>
&gt; editconfigs&quot; it shows 3.17.0 in top of console and the git page shows<br>
</span>&gt; &lt;<a href="http://git.linuxfoundation.org/llvmlinux/kernel.git/" target="_blank">http://git.linuxfoundation.org/llvmlinux/kernel.git/</a>&gt; that the last change<br>
<div class="HOEnZb"><div class="h5">&gt; was at 15 Oct 2014.<br>
</div></div></blockquote></div><br></div>