hardening_ldflags.patch 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  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. Index: vblade/makefile
  7. ===================================================================
  8. --- vblade.orig/makefile
  9. +++ vblade/makefile
  10. @@ -13,19 +13,19 @@ CFLAGS += -Wall -g -O2
  11. CC = gcc
  12. vblade: $O
  13. - ${CC} -o vblade $O
  14. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o vblade $O
  15. aoe.o : aoe.c config.h dat.h fns.h makefile
  16. - ${CC} ${CFLAGS} -c $<
  17. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -c $<
  18. ${PLATFORM}.o : ${PLATFORM}.c config.h dat.h fns.h makefile
  19. - ${CC} ${CFLAGS} -c $<
  20. + ${CC} ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -c $<
  21. ata.o : ata.c config.h dat.h fns.h makefile
  22. - ${CC} ${CFLAGS} -c $<
  23. + ${CC} $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
  24. bpf.o : bpf.c
  25. - ${CC} ${CFLAGS} -c $<
  26. + ${CC} $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -c $<
  27. config.h : config/config.h.in makefile
  28. @if ${CC} ${CFLAGS} config/u64.c > /dev/null 2>&1; then \