Andrew Geissler | 72956ed | 2021-01-08 16:11:14 -0600 | [diff] [blame] | 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 | |
| 6 | Upstream-Status: Pending |
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 8 | --- |
| 9 | GNUmakefile | 1 - |
| 10 | 1 file changed, 1 deletion(-) |
| 11 | |
| 12 | --- a/GNUmakefile |
| 13 | +++ b/GNUmakefile |
| 14 | @@ -91,12 +91,13 @@ comma := , |
| 15 | # If supported by COMPILER_gcc, add given flags to CFLAGS_gcc. |
| 16 | # Example usage: |
| 17 | # $(eval $(call CHECK_CFLAGS_gcc,-fasynchronous-unwind-tables)) |
| 18 | -define CHECK_CFLAGS_gcc |
| 19 | -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)) |
| 20 | -endef |
| 21 | |
| 22 | COMPILER_gcc = gcc |
| 23 | LINKER_gcc = gcc |
| 24 | +ifneq ($(COMPILER_gcc),no) |
| 25 | +define CHECK_CFLAGS_gcc |
| 26 | +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)) |
| 27 | +endef |
| 28 | CPPFLAGS_gcc = |
| 29 | CFLAGS_gcc = |
| 30 | CFLAGS_gcc += -std=gnu99 -pedantic |
| 31 | @@ -113,30 +114,24 @@ CFLAGS_gcc += -save-temps=obj |
| 32 | LDFLAGS_gcc = |
| 33 | LIBS_gcc = |
| 34 | |
| 35 | -ifneq ($(call pathsearch,$(COMPILER_gcc)),) |
| 36 | -ifneq ($(COMPILER_gcc)),no) |
| 37 | COMPILERS += gcc |
| 38 | endif |
| 39 | -endif |
| 40 | |
| 41 | COMPILER_clang = clang |
| 42 | LINKER_clang = clang |
| 43 | + |
| 44 | +ifneq ($(COMPILER_clang),no) |
| 45 | CPPFLAGS_clang = |
| 46 | CFLAGS_clang += -Wall -Wextra |
| 47 | CFLAGS_clang += -Weverything |
| 48 | CFLAGS_clang += -Wno-padded |
| 49 | CFLAGS_clang += -std=gnu99 -pedantic |
| 50 | -CFLAGS_clang += -Werror |
| 51 | -CFLAGS_clang += -fsanitize=undefined |
| 52 | CFLAGS_clang += -O -g |
| 53 | LDFLAGS_clang = |
| 54 | LIBS_clang = |
| 55 | |
| 56 | -ifneq ($(call pathsearch,$(COMPILER_clang)),) |
| 57 | -ifneq ($(COMPILER_clang),no) |
| 58 | COMPILERS += clang |
| 59 | endif |
| 60 | -endif |
| 61 | |
| 62 | |
| 63 | ######################################################################## |