« Return to Thread: [Cooker] How to properly override C(++) lags for Makefiles generated by qmake?

Re: [Cooker] How to properly override C(++) lags for Makefiles generated by qmake?

by Amrein-Marie Christophe :: Rate this Message:

Reply to Author | View in Thread

Le vendredi 10 juillet 2009 à 16:33 +0300, Anssi Hannula a écrit :

> Andrey Borzenkov wrote:
> > On Sunday 05 of July 2009 13:31:05 Amrein-Marie Christophe wrote:
> >> Le dimanche 05 juillet 2009 à 13:23 +0400, Andrey Borzenkov a écrit :
> >>> I'm trying to build aqemu. It fails on printf format error, but
> >>> disabling it in specs is ineffective; Makefile is generated by
> >>> qmake and C(XX)FLAGS are statically set in Makefile.
> >>>
> >>> Unfortunately using make CFLAGS=... does not work either because
> >>> CFLAGS are built from other variables as well:
> >>>
> >>> CXXFLAGS      = -pipe -O2 -g -pipe -Wformat -Werror=format-security
> >>> - Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
> >>> --param=ssp- buffer-size=4 -Wall -W -D_REENTRANT $(DEFINES)
> >>>
> >>> I hope, that it is possible to override template CFLAGS during
> >>> qmake invocation. Is it possible?
> >> Use %{qmake_qt4} to create the Makefiles in your rpm .spec file.
> >
> > This does not work because our qmake templates *unconditionally* add
> > options (have you actually tried it? Passing QMAKE_CXXFLAGS at qmake
> > invocation was the first thing I tried :) )
>
> Look at /usr/lib/qt4/mkspecs/common/g++.conf.
>
> So, pass QMAKE_CXXFLAGS_RELEASE="%optflags" to qmake, it works :)
>
> Probably %qmake_qt4 should also be fixed.
>

What to fix? %qmake_qt4 use "-Werror=format-security" for security
reason. When you compile this package, gcc complains about using
qDebug() incorrectly because of "-Werror=format-security".


Here is qDebug signature in qglobal.h (in Qt4 include directory):
  Q_CORE_EXPORT void qDebug(const char *, ...)"

Here is how aqemu use it in Utils.cpp:
  qDebug(QChar *)


That's it. No need to modify %qmake_qt4. Just need to fix the source
code.

Perhaps I don't understand the wall point here and I'm wrong. If so, I
would like to understand why so I keep reading incoming messages.

 « Return to Thread: [Cooker] How to properly override C(++) lags for Makefiles generated by qmake?