<div dir="ltr">Add -no-integrated-as. This is a known abuse of the compiler to output something other than assembly:<div><a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-February/070522.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-February/070522.html</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 13, 2015 at 5:59 PM, Jovi Zhangwei <span dir="ltr"><<a href="mailto:jovi.zhangwei@gmail.com" target="_blank">jovi.zhangwei@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I just tried clang 3.6 compile on one file in Linux kernel, it failed,<br>
but clang 3.4 can success.<br>
(I didn't apply any patch on clang source code, it's from clang repo<br>
36 release tag)<br>
<br>
Anyone can help this would be much appreciated.<br>
<br>
In Linux kernel:<br>
<br>
jovi@ubuntu:~/linux$ make CC=clang kernel/sched/core.o<br>
<br>
CHK include/config/kernel.release<br>
<br>
CHK include/generated/uapi/linux/version.h<br>
<br>
CHK include/generated/utsrelease.h<br>
<br>
CC kernel/bounds.s<br>
<br>
clang: warning: optimization flag '-fno-delete-null-pointer-checks' is<br>
not supported<br>
<br>
kernel/bounds.c:18:2: error: unexpected token at start of statement<br>
<br>
DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);<br>
<br>
^<br>
<br>
include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'<br>
<br>
asm volatile("\n->" #sym " %0 " #val : : "i" (val))<br>
<br>
^<br>
<br>
<inline asm>:2:1: note: instantiated into assembly here<br>
<br>
->NR_PAGEFLAGS $25 __NR_PAGEFLAGS<br>
<br>
^<br>
<br>
kernel/bounds.c:19:2: error: unexpected token at start of statement<br>
<br>
DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);<br>
<br>
^<br>
<br>
include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'<br>
<br>
asm volatile("\n->" #sym " %0 " #val : : "i" (val))<br>
<br>
^<br>
<br>
<inline asm>:2:1: note: instantiated into assembly here<br>
<br>
->MAX_NR_ZONES $4 __MAX_NR_ZONES<br>
<br>
^<br>
<br>
kernel/bounds.c:21:2: error: unexpected token at start of statement<br>
<br>
DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));<br>
<br>
^<br>
<br>
include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'<br>
<br>
asm volatile("\n->" #sym " %0 " #val : : "i" (val))<br>
<br>
^<br>
<br>
<inline asm>:2:1: note: instantiated into assembly here<br>
<br>
->NR_CPUS_BITS $8 ilog2(CONFIG_NR_CPUS)<br>
<br>
^<br>
<br>
kernel/bounds.c:23:2: error: unexpected token at start of statement<br>
<br>
DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));<br>
<br>
^<br>
<br>
include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'<br>
<br>
asm volatile("\n->" #sym " %0 " #val : : "i" (val))<br>
<br>
^<br>
<br>
<inline asm>:2:1: note: instantiated into assembly here<br>
<br>
->SPINLOCK_SIZE $4 sizeof(spinlock_t)<br>
<br>
^<br>
<br>
4 errors generated.<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>