Your message dated Sat, 2 Jul 2016 14:38:39 -0300 with message-id <[🔎] CA+QPbz3fSW_Fb81CLBLhtxOgn=3GdAmmS--_c9Up_nr7CZw1ig@mail.gmail.com> and subject line Re: Bug#829329: Error combining hardening flags with Qt5 has caused the Debian Bug report #829329, regarding Error combining hardening flags with Qt5 to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) -- 829329: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=829329 Debian Bug Tracking System Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: Error combining hardening flags with Qt5
- From: Nikos Andrikos <nick.andrik@gmail.com>
- Date: Sat, 2 Jul 2016 17:10:27 +0200
- Message-id: <[🔎] CANn5kOvZm+LqjqZypei9gsbhFoxQL2WA7OuNacBrQihBZz=H7g@mail.gmail.com>
Package: libqt5core5a Version: 5.6.1+dfsg-3 Severity: normal I'm trying to enable Qt5 support for the lyx package I maintain. I have already enabled hardening flags, and I get the following error when building the package: g++ -DHAVE_CONFIG_H -I. -I../../../src/support -I../.. -Wall -Wextra -I../../../src/support/.. -DQT_NO_STL -DQT_NO_KEYWORDS -I/usr/include/x86_64 -linux-gnu/qt5/QtConcurrent -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtSvg -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5 -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++11 -fPIC -O2 -Wno-deprecated-declarations -g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -c -o ConsoleApplication.o ../../../src/support/ConsoleApplication.cpp In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qcoreapplication.h:37:0, from /usr/include/x86_64-linux-gnu/qt5/QtCore/QCoreApplication:1, from ../../../src/support/../support/ConsoleApplicationPrivate.h:16, from ../../../src/support/ConsoleApplication.cpp:15: /usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1087:4: error: #error "You must build your code with position independent code if Qt was built with -reduce-relocations. " "Compile your code with -fPIC (-fPIE is not enough)." # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ ^ By default, -fPIC is used for shared libraries and -fPIE for executables such as lyx. The latter takes precedence as it is later in the argument list. I can get away with the problem if I append -fPIC to CXXFLAGS but I think this is not the proper solution, but a workaround. A similar issue was reported also on Bug: #828878 and the fix was the aforementioned workaround. Kind regards, Nick -- =Do- N.AND
--- End Message ---
--- Begin Message ---
- To: 829329@bugs.debian.org, Nikos Andrikos <nick.andrik@gmail.com>, 829329-done@bugs.debian.org
- Subject: Re: Bug#829329: Error combining hardening flags with Qt5
- From: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
- Date: Sat, 2 Jul 2016 14:38:39 -0300
- Message-id: <[🔎] CA+QPbz3fSW_Fb81CLBLhtxOgn=3GdAmmS--_c9Up_nr7CZw1ig@mail.gmail.com>
- In-reply-to: <CA+QPbz13rmQzigwREnz78GJKp6fupneow8jK1oNMYeZG0Ka5bw@mail.gmail.com>
- References: <[🔎] CANn5kOvZm+LqjqZypei9gsbhFoxQL2WA7OuNacBrQihBZz=H7g@mail.gmail.com> <CA+QPbz3DgpKyVMUvMQA2Q4OHgBJqj0tbzdkOGJgE1d9B2304dQ@mail.gmail.com> <CA+QPbz0H8C9GNC1dgKDvx1gB=GGSTVpJfKnpR-ZWHcZM_gMxEw@mail.gmail.com> <CA+QPbz3PsSri-+2L+4VwaE=j4=KGGLDMba_-ByyCh8dg8hwqJQ@mail.gmail.com> <CA+QPbz0n+szJxg3yTMf==+sDgAuFQsCR02_Kb9VJD+68TP4LuA@mail.gmail.com> <CA+QPbz13_u8ZDP8zHCOwTX_RhbWfNrosKgMXkdBheSZ-O0AVyQ@mail.gmail.com> <CA+QPbz13rmQzigwREnz78GJKp6fupneow8jK1oNMYeZG0Ka5bw@mail.gmail.com>
Hi Nikos! This is no qt bug, you need to use just -fPIC, avoiding -fPIE. Please note that there is no security reduction here as -fPIC implies -fPIE.
Happy hacking!
--
Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/
--- End Message ---