[cfe-dev] svn update then make gives cc1 error: unrecognized command line option '-Wcovered-switch-default'

Larry Evans cppljevans at suddenlink.net
Sat Oct 6 02:59:43 PDT 2012


On 10/05/12 21:37, Larry Evans wrote:
> On 10/05/12 20:48, Eli Friedman wrote:
>> On Fri, Oct 5, 2012 at 6:38 PM, Larry Evans <cppljevans at suddenlink.net> wrote:
>>> On 10/05/12 20:31, Eli Friedman wrote:
>>>> On Fri, Oct 5, 2012 at 5:58 PM, Larry Evans <cppljevans at suddenlink.net> wrote:
>>>>> On 10/05/12 19:35, Eli Friedman wrote:
>>>>>> On Fri, Oct 5, 2012 at 5:25 PM, Larry Evans <cppljevans at suddenlink.net> wrote:
>>>>>>> On 10/05/12 13:32, Larry Evans wrote:
>>>>>>>   I just ran svn update:
>>>>>>>
>>>>>>>   ~/download/llvm/svn/llvm $ svn update
>>>>>>>   ~/download/llvm/svn/llvm/tools/clang $ svn update
>>>>>>>   ~/download/llvm/svn/llvm/tools $ svn co
>>>>>>>   http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
>>>>>>>   ~/download/llvm/svn/llvm/projects/compiler-rt $ svn update
>>>>>>>
>>>>>>>   However, make resulted in:
>>>>>>>
>>>>>>>   .
>>>>>>>   .
>>>>>>>   .
>>>>>>>   llvm[1]: Compiling regexec.c for Debug+Asserts build
>>>>>>>   cc1: error: unrecognized command line option "-Wcovered-switch-default"
>>>>>>>   /bin/rm: cannot remove
>>>>>>>
>>>>>>> `/home/evansl/download/llvm/svn/build/lib/Support/Debug+Asserts/regexec.d.tmp':
>>>>>>>   No such file or directory
>>>>>>>   make[1]: ***
>>>>>>>   [/home/evansl/download/llvm/svn/build/lib/Support/Debug+Asserts/regexec.o]
>>>>>>>   Error 1
>>>>>>>   make[1]: Leaving directory
>>>>>>>   `/home/evansl/download/llvm/svn/build/lib/Support'
>>>>>>>   make: *** [all] Error 1
>>>>>>>   ~/download/llvm/svn/build $
>>>>>>>
>>>>>>>   How can this be corrected?
>>>>>>>
>>>>>>>   My system is:
>>>>>>>
>>>>>>>   uname -a
>>>>>>>   Linux evansl-desktop 2.6.32-41-generic #90-Ubuntu SMP Tue May 22
>>>>>>>   11:29:51 UTC 2012 x86_64 GNU/Linux
>>>>>>>
>>>>>>>   TIA.
>>>>>>>
>>>>>>>   -regards,
>>>>>>>   Larry
>>>>>>> SOLVED:
>>>>>>>
>>>>>>> Changed Makefile.config to remove the COVERED_SWITCH_DEFAULT macro,
>>>>>>> and now it's working:
>>>>>>>
>>>>>>>   ~/download/llvm/svn/build $ cat Makefile.config|grep switch
>>>>>>>   # -Wcovered-switch-default
>>>>>>>   #COVERED_SWITCH_DEFAULT = -Wcovered-switch-default
>>>>>>>   ~/download/llvm/svn/build $ make
>>>>>>>   llvm[0]: Constructing LLVMBuild project information.
>>>>>>>   make[1]: Entering directory
>>>>>>> `/home/evansl/download/llvm/svn/build/lib/Support'
>>>>>>>   llvm[1]: Compiling regexec.c for Debug+Asserts build
>>>>>>>   llvm[1]: Compiling system_error.cpp for Debug+Asserts build
>>>>>>>   llvm[1]: Building Debug+Asserts Archive Library libLLVMSupport.a
>>>>>>
>>>>>> Err, this is a guess, but it's possible you're setting the C++
>>>>>> compiler to clang++, but not setting the C compiler to clang.
>>>>>>
>>>>>> -Eli
>>>>>
>>>>> Thanks Eli.
>>>>>
>>>>> I've not set anything directly.  I did do the configure step:
>>>>>
>>>>> ~/download/llvm/svn/llvm $ cd ..
>>>>> ~/download/llvm/svn $ cd build
>>>>> ~/download/llvm/svn/build $ ls ../llvn/configure
>>>>> ../llvn/configure: No such file or directory
>>>>> ~/download/llvm/svn/build $ ls ../llvm/configure
>>>>> ../llvm/configure
>>>>> ~/download/llvm/svn/build $ ../llvm/configure
>>>>> checking for clang... no
>>>>> checking for llvm-gcc... no
>>>>> checking for gcc... gcc
>>>>> .
>>>>> .
>>>>> .
>>>>>
>>>>> and maybe that did what you say.  Hmmm.  This is not the
>>>>> 1st time I've built clang; so, maybe something's left over
>>>>> from the last build.
>>>>>
>>>>> Where would I check to see which compiler is being used?
>>>>
>>>> You can look in config.log for lines starting with CC= and CXX= .
>>>>
>>>> -Eli
>>> Thanks,  config.log contains:
>>>
>>> CC='gcc'
>>>
>>> and:
>>>
>>> CXX='clang++'
>>
>> Okay.  I suppose that's theoretically a combination we should support,
>> but I doubt anyone cares in practice.
>>
>> What's the output of "which clang" and "which clang++"?  Do you have
>> CC or CXX set in your environment?
>>
>> -Eli
> 
> Thanks Eli.
> 
> Here's the info:
> 
> evansl at evansl-desktop:~/bin$ echo $CC
> 
> evansl at evansl-desktop:~/bin$ echo $CXX
> 
> evansl at evansl-desktop:~/bin$ which clang
> evansl at evansl-desktop:~/bin$ which clang++
> /home/evansl/bin/clang++
> evansl at evansl-desktop:~/bin$ ls -l ~/bin/clang++
> lrwxrwxrwx 1 evansl evansl 62 Feb  6  2011 /home/evansl/bin/clang++ ->
> /home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang++
> evansl at evansl-desktop:~/bin$
> 
> Maybe if I made another symlink in ~/bin to
>   home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang
> everything would work as expected.

Finally finished the build, but got link error at maybe last step:

> make[4]: Entering directory `/home/evansl/download/llvm/svn/build/tools/clang/tools/driver'
> llvm[4]: Compiling cc1_main.cpp for Debug+Asserts build
> llvm[4]: Compiling cc1as_main.cpp for Debug+Asserts build
> llvm[4]: Compiling driver.cpp for Debug+Asserts build
> llvm[4]: Linking Debug+Asserts executable clang
> clang: error: unable to execute command: Killed
> clang: error: linker command failed due to signal (use -v to see invocation)
> clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
> clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
> make[4]: *** [/home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang] Error 254
> make[4]: Leaving directory `/home/evansl/download/llvm/svn/build/tools/clang/tools/driver'
> make[3]: *** [all] Error 1
> make[3]: Leaving directory `/home/evansl/download/llvm/svn/build/tools/clang/tools'
> make[2]: *** [all] Error 1
> make[2]: Leaving directory `/home/evansl/download/llvm/svn/build/tools/clang'
> make[1]: *** [clang/.makeall] Error 2
> make[1]: Leaving directory `/home/evansl/download/llvm/svn/build/tools'
> make: *** [all] Error 1
> ~/download/llvm/svn/build $ 

Maybe the problem is I'm using gcc and clang++, or maybe the last step
is replacing the driver.exe using the driver.exe?

Maybe I should start over by 1st rm'ing the symlink in ~/bin that
points to home/evansl/download/llvm/svn/build/Debug+Asserts/bin/clang++
then doing a make clean, then a configure specifying prefix that
points to something other than the build directory?

I'd appreciate any suggestions about the best way to proceed.

TIA.

-regards,
Larry





More information about the cfe-dev mailing list