[cfe-dev] clang 3.6 compile failure but clang 3.4 success
Jovi Zhangwei
jovi.zhangwei at gmail.com
Fri Feb 13 19:12:29 PST 2015
Hi,
Thanks for help, it works.
After strace clang, I found clang 3.4 don't invoke external assembler
when compile files,
is this means clang 3.4 use integrated assembler? then why clang 3.4
don't failure when compile that kernel file?
Actually what I wish in my case is clang 3.6 don't invoke external
assembler, just like clang 3.4.
Thank you.
On Fri, Feb 13, 2015 at 6:09 PM, Reid Kleckner <rnk at google.com> wrote:
> Add -no-integrated-as. This is a known abuse of the compiler to output
> something other than assembly:
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-February/070522.html
>
> On Fri, Feb 13, 2015 at 5:59 PM, Jovi Zhangwei <jovi.zhangwei at gmail.com>
> wrote:
>>
>> Hi,
>>
>> I just tried clang 3.6 compile on one file in Linux kernel, it failed,
>> but clang 3.4 can success.
>> (I didn't apply any patch on clang source code, it's from clang repo
>> 36 release tag)
>>
>> Anyone can help this would be much appreciated.
>>
>> In Linux kernel:
>>
>> jovi at ubuntu:~/linux$ make CC=clang kernel/sched/core.o
>>
>> CHK include/config/kernel.release
>>
>> CHK include/generated/uapi/linux/version.h
>>
>> CHK include/generated/utsrelease.h
>>
>> CC kernel/bounds.s
>>
>> clang: warning: optimization flag '-fno-delete-null-pointer-checks' is
>> not supported
>>
>> kernel/bounds.c:18:2: error: unexpected token at start of statement
>>
>> DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS);
>>
>> ^
>>
>> include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'
>>
>> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
>>
>> ^
>>
>> <inline asm>:2:1: note: instantiated into assembly here
>>
>> ->NR_PAGEFLAGS $25 __NR_PAGEFLAGS
>>
>> ^
>>
>> kernel/bounds.c:19:2: error: unexpected token at start of statement
>>
>> DEFINE(MAX_NR_ZONES, __MAX_NR_ZONES);
>>
>> ^
>>
>> include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'
>>
>> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
>>
>> ^
>>
>> <inline asm>:2:1: note: instantiated into assembly here
>>
>> ->MAX_NR_ZONES $4 __MAX_NR_ZONES
>>
>> ^
>>
>> kernel/bounds.c:21:2: error: unexpected token at start of statement
>>
>> DEFINE(NR_CPUS_BITS, ilog2(CONFIG_NR_CPUS));
>>
>> ^
>>
>> include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'
>>
>> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
>>
>> ^
>>
>> <inline asm>:2:1: note: instantiated into assembly here
>>
>> ->NR_CPUS_BITS $8 ilog2(CONFIG_NR_CPUS)
>>
>> ^
>>
>> kernel/bounds.c:23:2: error: unexpected token at start of statement
>>
>> DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t));
>>
>> ^
>>
>> include/linux/kbuild.h:5:25: note: expanded from macro 'DEFINE'
>>
>> asm volatile("\n->" #sym " %0 " #val : : "i" (val))
>>
>> ^
>>
>> <inline asm>:2:1: note: instantiated into assembly here
>>
>> ->SPINLOCK_SIZE $4 sizeof(spinlock_t)
>>
>> ^
>>
>> 4 errors generated.
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
More information about the cfe-dev
mailing list