[llvmlinux] clang 3.6 compile failure but clang 3.4 success

Jovi Zhangwei jovi.zhangwei at gmail.com
Sat Feb 14 01:59:49 UTC 2015


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.


More information about the LLVMLinux mailing list