0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From 183eb37e25d903ccd68cc2d8f8a37e75872c03d2 Mon Sep 17 00:00:00 2001
  2. From: Nick Clifton <nickc@redhat.com>
  3. Date: Tue, 6 Sep 2016 17:35:35 +0100
  4. Subject: [PATCH 1/2] Do not pass host compiler sanitization flags on to linker
  5. testsuite.
  6. * Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but
  7. without any sanitization options.
  8. (CXXFLAGS_FOR_TARGET): Define as a copy of CXXFLAGS but without
  9. any sanitization options.
  10. (check-DEJAGNU): Pass CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET
  11. as CFLAGS and CXXFLAGS respectively.
  12. ---
  13. ld/Makefile.am | 8 ++++++--
  14. ld/Makefile.in | 8 ++++++--
  15. 2 files changed, 12 insertions(+), 4 deletions(-)
  16. --- a/ld/Makefile.am
  17. +++ b/ld/Makefile.am
  18. @@ -136,6 +136,10 @@ CXX_FOR_TARGET = ` \
  19. fi; \
  20. fi`
  21. +# Strip out sanitization options as we want to test building binaries without any extra paraphernalia
  22. +CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
  23. +CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
  24. +
  25. transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
  26. bin_PROGRAMS = ld-new
  27. info_TEXINFOS = ld.texinfo
  28. @@ -2075,8 +2079,8 @@ check-DEJAGNU: site.exp
  29. runtest=$(RUNTEST); \
  30. if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
  31. $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
  32. - CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
  33. - CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
  34. + CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
  35. + CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
  36. CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
  37. OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
  38. LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
  39. --- a/ld/Makefile.in
  40. +++ b/ld/Makefile.in
  41. @@ -507,6 +507,10 @@ CXX_FOR_TARGET = ` \
  42. fi; \
  43. fi`
  44. +
  45. +# Strip out sanitization options as they require special host libraries.
  46. +CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
  47. +CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
  48. info_TEXINFOS = ld.texinfo
  49. ld_TEXINFOS = configdoc.texi
  50. noinst_TEXINFOS = ldint.texinfo
  51. @@ -3644,8 +3648,8 @@ check-DEJAGNU: site.exp
  52. runtest=$(RUNTEST); \
  53. if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
  54. $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
  55. - CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
  56. - CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
  57. + CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
  58. + CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
  59. CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
  60. OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
  61. LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \