0001-Makefile-add-DISABLE_WERROR.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From 5f26eaf8d7be760fafe11ef4a6e0f907e7e8c3f0 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Mon, 10 Jan 2022 23:17:45 +0100
  4. Subject: [PATCH] Makefile: add DISABLE_WERROR
  5. Allow the user to disable -Werror to avoid the following build failure
  6. with gcc 4.8 raised since version 0.6.0 and
  7. https://github.com/intel/tinycbor/commit/e2a4ed135c4d9101c4df83f2dd033cd249b6ef07:
  8. /home/buildroot/autobuild/instance-1/output-1/host/bin/arm-none-linux-gnueabi-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I./src -std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -g0 -D_FORTIFY_SOURCE=1 -Werror=incompatible-pointer-types -Werror=implicit-function-declaration -Werror=int-conversion -fPIC -c -o src/cborerrorstrings.pic.o src/cborerrorstrings.c
  9. cc1: error: -Werror=incompatible-pointer-types: no option -Wincompatible-pointer-types
  10. cc1: error: -Werror=int-conversion: no option -Wint-conversion
  11. Fixes:
  12. - http://autobuild.buildroot.org/results/a9f/a9fe64c42bb96f9e7b4af3050464f6570c1c00fa
  13. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  14. [Retrieved from:
  15. https://github.com/intel/tinycbor/commit/5f26eaf8d7be760fafe11ef4a6e0f907e7e8c3f0]
  16. ---
  17. Makefile | 7 ++++++-
  18. 1 file changed, 6 insertions(+), 1 deletion(-)
  19. diff --git a/Makefile b/Makefile
  20. index 6492ea16..3cde2b3d 100644
  21. --- a/Makefile
  22. +++ b/Makefile
  23. @@ -236,10 +236,15 @@ tag: distcheck
  24. .SECONDARY:
  25. cflags := $(CPPFLAGS) -I$(SRCDIR)src
  26. -cflags += -std=gnu99 $(CFLAGS) \
  27. +cflags += -std=gnu99 $(CFLAGS)
  28. +
  29. +ifneq ($(DISABLE_WERROR),1)
  30. +cflags += \
  31. -Werror=incompatible-pointer-types \
  32. -Werror=implicit-function-declaration \
  33. -Werror=int-conversion
  34. +endif
  35. +
  36. %.o: %.c
  37. @test -d $(@D) || $(MKDIR) $(@D)
  38. $(CC) $(cflags) $($(basename $(notdir $@))_CCFLAGS) -c -o $@ $<