build_hardening-flags.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. Subject: Enable hardened build flags
  2. Author: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  3. Bug-Debian: http://bugs.debian.org/656650
  4. Forwarded: not-needed
  5. Last-Update: 2015-12-04
  6. --- a/Makefile.am
  7. +++ b/Makefile.am
  8. @@ -11,7 +11,7 @@
  9. ## warning with -Wmissing-prototypes).
  10. ## -Wmissing-prototypes removed (eg, Linux 2.2.6 headers
  11. ## aren't up to it).
  12. -CFLAGS = -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
  13. +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) -O2 -fno-builtin -Wall -DSBINDIR='"$(sbindir)"'
  14. #CFLAGS = -O2 -fno-builtin -Wall -ansi -DSBINDIR='"$(sbindir)"'
  15. #CFLAGS = -O2 -fno-builtin -Wall -ansi -pedantic -Wmissing-prototypes -Werror -DSBINDIR='"$(sbindir)"'
  16. --- a/plugins/Makefile
  17. +++ b/plugins/Makefile
  18. @@ -1,7 +1,7 @@
  19. CC = gcc
  20. COPTS = -O2 -g
  21. -CFLAGS = $(COPTS) -I.. -I../../include -fPIC
  22. -LDFLAGS = -shared
  23. +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) $(COPTS) -I.. -I../../include -fPIC
  24. +LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) -shared
  25. LDADD = -lutil
  26. INSTALL = install -o root
  27. prefix = /usr/local