FS#47113 - [cmake] "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set" when using -flto
Attached to Project:
Arch Linux
Opened by Earnestly (Earnest) - Wednesday, 18 November 2015, 17:14 GMT
Last edited by Felix Yan (felixonmars) - Friday, 20 November 2015, 09:44 GMT
Opened by Earnestly (Earnest) - Wednesday, 18 November 2015, 17:14 GMT
Last edited by Felix Yan (felixonmars) - Friday, 20 November 2015, 09:44 GMT
|
Details
Since upgrading to cmake 3.4.0-1 every single cmake project
I package returns this error message:
-- The C compiler identification is GNU 5.2.0 CMake Error at /usr/share/cmake-3.4/Modules/Compiler/GNU-C.cmake:28 (message): CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for GNU (/usr/bin/cc) version 5.2.0 Call Stack (most recent call first): /usr/share/cmake-3.4/Modules/CMakeCInformation.cmake:33 (include) CMakeLists.txt:2 (PROJECT) -- Configuring incomplete, errors occurred! This appears to be a recent change and I've not been successful in trying to diagnose the issue myself. I believe this commit introduced it: https://cmake.org/pipermail/cmake-commits/2015-September/024954.html A (potentially related) regression was discussed here: https://cmake.org/pipermail/cmake-developers/2015-September/026496.html |
This task depends upon
Closed by Felix Yan (felixonmars)
Friday, 20 November 2015, 09:44 GMT
Reason for closing: Fixed
Additional comments about closing: 3.4.0-2
Friday, 20 November 2015, 09:44 GMT
Reason for closing: Fixed
Additional comments about closing: 3.4.0-2
I'll have to try and investigate, perhaps asking #cmake on freenode as well. I don't know cmake to understand this and was hoping the maintainer would know where to look.
I tested with antimicro, is $srcdir/antimicro-2.20.2/build/CMakeFiles/CMakeOutput.log being saved? It could give you more info.
# CLANG
ln -s /bin/ld.gold bin/ld
ln -s /bin/clang bin/cc
ln -s /bin/clang++ bin/c++
ln -s /bin/llvm-ar bin/ar
ln -s /bin/llvm-nm bin/nm
ln -s /bin/true bin/ranlib
(Setting a bin directory for LTO).
For now, my temporary fix is to add those arguments to every cmake call
-DCMAKE_C_STANDARD_COMPUTED_DEFAULT=GNU -DCMAKE_CXX_STANDARD_COMPUTED_DEFAULT=GNU
My system is x86_64, latest updated Arch.
The output, even the cache output, is unfortunately completely useless.
The output ends almost exactly as the output posted, the only possible notable thing about this is that cmake (as usual) detects /usr/bin/cc, which is (as usual) a symlink to gcc (and making this a hardlink doesn't help, in case there was some symlink issues).
However, for the sake of it, here is the cmake output file from my wlc PKGBUILD: https://ptpb.pw/hViv
Edit: I have found the cause. It was actually having -flto in the CFLAGS. See http://public.kitware.com/pipermail/cmake-developers/2015-November/026993.html
The link above also contains a patch https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=716a09b9 which is apparently going to be included in 3.4.1's release.
http://pkgbuild.com/~fyan/staging/cmake-3.4.0-2-x86_64.pkg.tar.xz
It works for all my cmake based packages