Description of problem: a same project with any modification build fine on fedora 20 and cmake 2.8 and fail with cmake 3 on fedora 21 I do not understand why on fedora 21 cmake give a malformated commad line (see -Wall =format-security below) On fedora 21 /usr/lib64/ccache/c++ -DDMDV2 -DHAVE_SC_ARG_MAX -DIN_LLVM -DLDC_INSTALL_PREFIX=\"/usr\" -DLDC_LLVM_VER=304 -DLLVM_INTRINSIC_TD_PATH=\"/usr/include\" -DOPAQUE_VTBLS -D__LITTLE_ENDIAN__ -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -g -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/. -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/dmd2 -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/dmd2/root -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/build/dmd2 -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src -I/usr/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall =format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -fno-rtti -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-non-virtual-dtor -Wno-pedantic -DLDC_POSIX -o CMakeFiles/gen_gccbuiltins.dir/utils/gen_gccbuiltins.cpp.o -c /builddir/build/BUILD/ldc-0.15.0-alpha1-src/utils/gen_gccbuiltins.cpp ----> c++: error: =format-security: No such file or directory On fedora 20 /usr/bin/c++ -DDMDV2 -DHAVE_SC_ARG_MAX -DIN_LLVM -DLDC_INSTALL_PREFIX=\"/usr\" -DLDC_LLVM_VER=304 -DLLVM_INTRINSIC_TD_PATH=\"/usr/include\" -DOPAQUE_VTBLS -D__LITTLE_ENDIAN__ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -g -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/. -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/dmd2 -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/dmd2/root -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/build/dmd2 -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src -I/usr/include -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -fno-rtti -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-non-virtual-dtor -Wno-pedantic -DLDC_POSIX -o CMakeFiles/gen_gccbuiltins.dir/utils/gen_gccbuiltins.cpp.o -c /home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/utils/gen_gccbuiltins.cpp ----> build ok
To ease to read it: On fedora 21 /usr/lib64/ccache/c++ -DDMDV2 -DHAVE_SC_ARG_MAX -DIN_LLVM \ -DLDC_INSTALL_PREFIX=\"/usr\" -DLDC_LLVM_VER=304 \ -DLLVM_INTRINSIC_TD_PATH=\"/usr/include\" -DOPAQUE_VTBLS \ -D__LITTLE_ENDIAN__ -O2 -g -pipe -Wall -Werror=format-security \ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \ --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic \ -g -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/. \ -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/dmd2 \ -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/dmd2/root \ -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src/build/dmd2 \ -I/builddir/build/BUILD/ldc-0.15.0-alpha1-src -I/usr/include -DNDEBUG \ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS \ -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall =format-security \ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \ --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic \ -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC \ -Woverloaded-virtual -Wcast-qual -fno-rtti -Wall -Wextra -Wno-unused-parameter \ -Wno-missing-field-initializers -Wno-non-virtual-dtor -Wno-pedantic -DLDC_POSIX \ -o CMakeFiles/gen_gccbuiltins.dir/utils/gen_gccbuiltins.cpp.o \ -c /builddir/build/BUILD/ldc-0.15.0-alpha1-src/utils/gen_gccbuiltins.cpp ----> c++: error: =format-security: No such file or directory On fedora 20 /usr/bin/c++ -DDMDV2 -DHAVE_SC_ARG_MAX -DIN_LLVM \ -DLDC_INSTALL_PREFIX=\"/usr\" -DLDC_LLVM_VER=304 \ -DLLVM_INTRINSIC_TD_PATH=\"/usr/include\" -DOPAQUE_VTBLS \ -D__LITTLE_ENDIAN__ -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 \ -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 \ -grecord-gcc-switches -m64 -mtune=generic \ -g -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/. \ -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/dmd2 \ -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/dmd2/root \ -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/build/dmd2 \ -I/home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src -I/usr/include -DNDEBUG \ -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS \ -D__STDC_LIMIT_MACROS -O2 -g -pipe -Wall \ -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong \ --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic \ -fomit-frame-pointer -std=c++11 -fvisibility-inlines-hidden -fno-exceptions -fPIC \ -Woverloaded-virtual -Wcast-qual -fno-rtti -Wall -Wextra -Wno-unused-parameter \ -Wno-missing-field-initializers -Wno-non-virtual-dtor -Wno-pedantic -DLDC_POSIX \ -o CMakeFiles/gen_gccbuiltins.dir/utils/gen_gccbuiltins.cpp.o \ -c /home/jmercier/rpmbuild/BUILD/ldc-0.15.0-alpha1-src/utils/gen_gccbuiltins.cpp ----> build ok
just to add some information the problem occur even if I use cmake instead of %cmake. I do not understand why these parameter are badly and hardcoded into cmake's fedora -O2 -g -pipe -Wall =format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions …
What software is this? I suspect an issue with the specific project and how it manipulates CFLAGS/CXXFLAGS, as this is the first report of any issue like this. You can also see the option properly formatted earlier in the compile line, and most of the compile options are duplicated. The options are not hard coded into Fedora. %cmake sets CFLAGS/CXXFLAGS just as the %configure macro does: %cmake \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ ...
Notice that the argument originally goes like -Werror=format-security, which is of course valid. Is there perhaps a piece of code somewhere that goes something like s/-Werror//? (And explicitly not s/-Werror//g, as clearly just one occurrence has been removed.)
That is the ldc project I opened too a report at https://github.com/ldc-developers/ldc/issues/773 And they said that the problem should come from cmake provided by fedora. I have try to run cmake instead of macro %cmake and same problem. The %cmake set CXXFLAGS -Werror=format-security so I do not understand why I still the problem while I use directly cmake.
$ grep Werror ldc-0.15.0-alpha1-src/CMakeLists.txt: CMakeLists.txt:# LLVM_CXXFLAGS may contain -Werror which causes compile errors with dmd source CMakeLists.txt:string(REPLACE "-Werror" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS}) they're wrong.
Thank you Rex.
Upstream dev here. Thanks to Petr and Rex for tracking this down, I've pushed a fix to our Git master (I suppose it will only naturally bubble down to Fedora with our next release?). And just so that we don't look like total idiots, let me clarify that "And they said that the problem should come from cmake provided by fedora" is quite the misinterpretation of my request for additional environment info. The issue is indeed not a straightforward CMake 3.0 compatibility issue in our build scripts, which was what it was originally reported as on our side. Instead, it was triggered by the non-standard g++ flags you guys pass to the LLVM build. From there, they unfortunately leak into llvm-config --cxxflags where they were picked up by our CMakeLists.txt and mangled by the buggy string replacement.
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
derelict-3-33.20150730git10a517b.fc23 gtkd-3.1.4-52.fc23 dustmite-1-25.20150515git3498068.fc23 ldc-0.16.0.alpha3-76.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16259
derelict-3-33.20150730git10a517b.fc23, dustmite-1-25.20150515git3498068.fc23, gtkd-3.1.4-52.fc23, ldc-0.16.0.alpha3-76.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with $ su -c 'dnf --enablerepo=updates-testing update dustmite gtkd derelict ldc' You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16259
derelict-3-33.20150730git10a517b.fc23, dustmite-1-25.20150515git3498068.fc23, gtkd-3.1.4-52.fc23, ldc-0.16.0.alpha3-76.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.