[LLVMdev] clean CMake build failing (Mac OS X 10.8)
Marshall Clow
mclow.lists at gmail.com
Mon Jul 30 13:08:17 PDT 2012
On Jul 30, 2012, at 10:03 AM, Marshall Clow <mclow.lists at gmail.com> wrote:
> Over the weekend I upgraded my system to Mac OS X 10.8, and now a clean cmake build fails.
>
> The error message:
>> Building C object runtime/libprofile/CMakeFiles/profile_rt-static.dir/CommonProfiling.c.o
>> cc1: error: unrecognized command line option "-Wcovered-switch-default"
>
>
> The configuration:
>> Mac OS X 10.8
>> CMake 2.8.8
>> LLVM tot
>> Apple clang version 4.0 (tags/Apple/clang-421.0.57) (based on LLVM 3.1svn)
>
>
> Running cmake to generate the make files gives the following output:
>> -- The C compiler identification is GNU 4.2.1
>> -- The CXX compiler identification is Clang 4.0.0
>>
>
> Diagnosis:
> cmake is passing "-Wcovered-switch-default" to the c compiler.
> It also thinks that the c compiler should be gcc, rather than clang.
> gcc does not support that switch, and fails.
>
> Possible solutions:
> * use clang to compile the C code (note that /usr/bin/cc is clang on this system; why it's picking gcc, I don't know)
> * Don't pass "-Wcovered-switch-default" to the C compiler.
A workaround - force use of clang for C compilations:
CC=/usr/bin/cc cmake $LLVM/llvm
-- Marshall
Marshall Clow Idio Software <mailto:mclow.lists at gmail.com>
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
-- Yu Suzuki
More information about the llvm-dev
mailing list