0001-Do-not-use-Werror-as-it-fails-with-newer-clang-11.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 6b33adfa438e35b6a37cfb0364274370ef4f9fc1 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Wed, 23 Dec 2020 18:00:59 +0000
  4. Subject: [PATCH] Do not use -Werror as it fails with newer clang 11+
  5. Upstream-Status: Pending
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. ---
  8. GNUmakefile | 1 -
  9. 1 file changed, 1 deletion(-)
  10. --- a/GNUmakefile
  11. +++ b/GNUmakefile
  12. @@ -91,12 +91,13 @@ comma := ,
  13. # If supported by COMPILER_gcc, add given flags to CFLAGS_gcc.
  14. # Example usage:
  15. # $(eval $(call CHECK_CFLAGS_gcc,-fasynchronous-unwind-tables))
  16. -define CHECK_CFLAGS_gcc
  17. -CFLAGS_gcc += $$(if $$(shell if $$(COMPILER_gcc) $(1) -x c -o compile-check.gcc-o -c - < /dev/null > /dev/null 2>&1; then echo yes; else :; fi; rm -f compile-check.gcc-o > /dev/null 2>&1),$(1))
  18. -endef
  19. COMPILER_gcc = gcc
  20. LINKER_gcc = gcc
  21. +ifneq ($(COMPILER_gcc),no)
  22. +define CHECK_CFLAGS_gcc
  23. +CFLAGS_gcc += $$(if $$(shell if $$(COMPILER_gcc) $(1) -x c -o compile-check.gcc-o -c - < /dev/null > /dev/null 2>&1; then echo yes; else :; fi; rm -f compile-check.gcc-o > /dev/null 2>&1),$(1))
  24. +endef
  25. CPPFLAGS_gcc =
  26. CFLAGS_gcc =
  27. CFLAGS_gcc += -std=gnu99 -pedantic
  28. @@ -113,30 +114,24 @@ CFLAGS_gcc += -save-temps=obj
  29. LDFLAGS_gcc =
  30. LIBS_gcc =
  31. -ifneq ($(call pathsearch,$(COMPILER_gcc)),)
  32. -ifneq ($(COMPILER_gcc)),no)
  33. COMPILERS += gcc
  34. endif
  35. -endif
  36. COMPILER_clang = clang
  37. LINKER_clang = clang
  38. +
  39. +ifneq ($(COMPILER_clang),no)
  40. CPPFLAGS_clang =
  41. CFLAGS_clang += -Wall -Wextra
  42. CFLAGS_clang += -Weverything
  43. CFLAGS_clang += -Wno-padded
  44. CFLAGS_clang += -std=gnu99 -pedantic
  45. -CFLAGS_clang += -Werror
  46. -CFLAGS_clang += -fsanitize=undefined
  47. CFLAGS_clang += -O -g
  48. LDFLAGS_clang =
  49. LIBS_clang =
  50. -ifneq ($(call pathsearch,$(COMPILER_clang)),)
  51. -ifneq ($(COMPILER_clang),no)
  52. COMPILERS += clang
  53. endif
  54. -endif
  55. ########################################################################