tags 671569 patch thanks Dear Maintainer,
The following patch fixes the issue. The problem is that qmake
doesn't respect *FLAGS variables (and QMAKE_LFLAGS !=
QMAKE_LDFLAGS ..) ... The patch also enables verbose builds to
detect missing flags.
diff -Nru transmission-2.51/debian/rules transmission-2.51/debian/rules
--- transmission-2.51/debian/rules 2012-05-09 16:37:42.000000000 +0200
+++ transmission-2.51/debian/rules 2012-05-11 13:15:23.000000000 +0200
@@ -1,5 +1,8 @@
#!/usr/bin/make -f
+# Enable verbose builds to detect missing (hardening) flags.
+export V=1
+
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND =
-Wl,--as-needed,--no-undefined,--no-add-needed
@@ -14,7 +17,12 @@
$(shell dpkg-buildflags --export=configure)
# qt client has a separate build-system
dh_auto_configure -Dqt \
- -- $(shell dpkg-buildflags --export=configure)
+ -- QMAKE_CFLAGS_RELEASE="$(shell dpkg-buildflags --get CFLAGS)
$(shell dpkg-buildflags --get CPPFLAGS)" \
+ QMAKE_CFLAGS_DEBUG="$(shell dpkg-buildflags --get CFLAGS)
$(shell dpkg-buildflags --get CPPFLAGS)" \
+ QMAKE_CXXFLAGS_RELEASE="$(shell dpkg-buildflags --get
CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)" \
+ QMAKE_CXXFLAGS_DEBUG="$(shell dpkg-buildflags --get CFLAGS)
$(shell dpkg-buildflags --get CPPFLAGS)" \
+ QMAKE_LFLAGS_RELEASE="$(shell dpkg-buildflags --get
LDFLAGS)" \
+ QMAKE_LFLAGS_DEBUG="$(shell dpkg-buildflags --get LDFLAGS)"
override_dh_auto_build:
dh_auto_build
To check if all flags were correctly enabled you can use
`hardening-check` from the hardening-includes package and check
the build log (for example with blhc [4]) (hardening-check
doesn't catch everything):
$ hardening-check /usr/bin/transmission-qt /usr/bin/transmission-gtk ...
/usr/bin/transmission-qt:
Position Independent Executable: yes
Stack protected: yes
Fortify Source functions: yes (some protected functions found)
Read-only relocations: yes
Immediate binding: yes
/usr/bin/transmission-gtk:
Position Independent Executable: yes
Stack protected: yes
Fortify Source functions: yes (some protected functions found)
Read-only relocations: yes
Immediate binding: yes
...
(Position Independent Executable and Immediate binding is not
enabled by default.)
Use find -type f \( -executable -o -name \*.so\* \) -exec
hardening-check {} + on the build result to check all files.
Regards,
Simon
[1]: https://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags
[2]: https://wiki.debian.org/HardeningWalkthrough
[3]: https://wiki.debian.org/Hardening
[4]: http://ruderich.org/simon/blhc/
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
signature.asc
Description: Digital signature

