hardening-build.patch 941 B

123456789101112131415161718192021222324252627282930313233
  1. Description: Add LDFLAGS to linking phase to enable hardening.
  2. The Makefile is so simple that it doesn't even contemplate the use of LDFLAGS.
  3. Author: David Martínez Moreno <ender@debian.org>
  4. Forwarded: no
  5. Last-Update: 2015-07-29
  6. --- a/makefile
  7. +++ b/makefile
  8. @@ -13,19 +13,19 @@
  9. CC = gcc
  10. vblade: $O
  11. - ${CC} -o vblade $O
  12. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o vblade $O
  13. aoe.o : aoe.c config.h dat.h fns.h makefile
  14. - ${CC} ${CFLAGS} -c $<
  15. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -c $<
  16. ${PLATFORM}.o : ${PLATFORM}.c config.h dat.h fns.h makefile
  17. - ${CC} ${CFLAGS} -c $<
  18. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -c $<
  19. ata.o : ata.c config.h dat.h fns.h makefile
  20. - ${CC} ${CFLAGS} -c $<
  21. + ${CC} $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
  22. bpf.o : bpf.c
  23. - ${CC} ${CFLAGS} -c $<
  24. + ${CC} $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
  25. config.h : config/config.h.in makefile
  26. @if ${CC} ${CFLAGS} config/u64.c > /dev/null 2>&1; then \