Bug 1159589 - cmake format-security malformated
Summary: cmake format-security malformated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: ldc
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: MERCIER Jonathan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-01 23:56 UTC by MERCIER Jonathan
Modified: 2015-10-01 16:05 UTC (History)
8 users (show)

Fixed In Version: ldc-0.16.0.alpha3-76.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-01 16:05:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description MERCIER Jonathan 2014-11-01 23:56:05 UTC
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

Comment 1 MERCIER Jonathan 2014-11-02 15:37:22 UTC
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

Comment 2 MERCIER Jonathan 2014-11-02 21:01:20 UTC
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 …

Comment 3 Orion Poplawski 2014-11-02 23:01:55 UTC
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 ; \
...

Comment 4 Petr Machata 2014-11-03 11:21:44 UTC
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.)

Comment 5 MERCIER Jonathan 2014-11-03 15:09:31 UTC
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.

Comment 6 Rex Dieter 2014-11-03 15:15:02 UTC
$ 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.

Comment 7 Orion Poplawski 2014-11-03 15:53:48 UTC
Thank you Rex.

Comment 8 David Nadlinger 2014-11-04 17:20:57 UTC
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.

Comment 9 Fedora Admin XMLRPC Client 2015-02-17 03:17:09 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 10 Fedora Update System 2015-09-20 20:26:53 UTC
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

Comment 11 Fedora Update System 2015-09-21 18:52:20 UTC
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

Comment 12 Fedora Update System 2015-10-01 16:05:09 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.