summaryrefslogtreecommitdiff
path: root/config/module/flashprog/default/patches/0003-force-WARNERROR-no.patch
blob: 634cc5af986583bffa7f0eed1d840aaaad4a0bdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
From 5f79b0def288d97534ebb4b477152d13b00cedb5 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Mon, 21 Sep 2026 11:59:02 +0100
Subject: [PATCH 1/1] force WARNERROR=no

the variable itself is kept, in case upstream
adds anything else that uses it in the future.

Signed-off-by: Leah Rowe <leah@libreboot.org>
---
 Makefile                           | 9 ++-------
 Makefile.include                   | 4 ++--
 README.md                          | 4 +---
 meson.build                        | 2 +-
 util/ich_descriptors_tool/Makefile | 9 ++-------
 5 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index e514e300..05cee5ff 100644
--- a/Makefile
+++ b/Makefile
@@ -57,13 +57,8 @@ override CPPFLAGS := $(CPPFLAGS)
 override CFLAGS   := $(CFLAGS)
 override LDFLAGS  := $(LDFLAGS)
 
-# If your compiler spits out excessive warnings, run make WARNERROR=no
-# You shouldn't have to change this flag.
-WARNERROR ?= yes
-
-ifeq ($(WARNERROR), yes)
-override CFLAGS += -Werror
-endif
+# lbmk forces removal of werror
+WARNERROR = no
 
 ifdef LIBS_BASE
 PKG_CONFIG_LIBDIR ?= $(LIBS_BASE)/lib/pkgconfig
diff --git a/Makefile.include b/Makefile.include
index 1bca4f3a..18c1e55b 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -46,11 +46,11 @@ $(strip $(call debug_shell, $(CC) -E $1 | tail -n 1 | tr -d '"'))
 endef
 
 define c_compile_test # $1: files to compile, $2: cflags
-$(call debug_shell, $(CC) -c -Wall -Werror $2 $1 -o /dev/null && echo yes || echo no)
+$(call debug_shell, $(CC) -c -Wall $2 $1 -o /dev/null && echo yes || echo no)
 endef
 
 define c_link_test # $1: file to compile and link, $2: cflags, $3: ldflags
-$(call debug_shell, $(CC) -Wall -Werror $2 $1 $3 -o /dev/null && echo yes || echo no)
+$(call debug_shell, $(CC) -Wall $2 $1 $3 -o /dev/null && echo yes || echo no)
 endef
 
 define find_dependency
diff --git a/README.md b/README.md
index 2051810c..f6a11a14 100644
--- a/README.md
+++ b/README.md
@@ -180,9 +180,7 @@ Processor architecture dependent features:
 
 Compiler quirks:
 
-If you are using clang and if you want to enable only one driver, you may hit an
-overzealous compiler warning from clang. Compile with "make WARNERROR=no" to
-force it to continue and enjoy.
+Libreboot modifies flashprog to always set WARNERROR=no
 
 Installation
 ------------
diff --git a/meson.build b/meson.build
index 39ae0c47..dc665c46 100644
--- a/meson.build
+++ b/meson.build
@@ -5,7 +5,7 @@ project('flashprogutils', 'c',
   default_options : [
     'warning_level=2',
     'c_std=c99',
-    'werror=true',
+    'werror=false',
     'optimization=s',
     'debug=false',
   ],
diff --git a/util/ich_descriptors_tool/Makefile b/util/ich_descriptors_tool/Makefile
index 14e6d2fe..7f6e9479 100644
--- a/util/ich_descriptors_tool/Makefile
+++ b/util/ich_descriptors_tool/Makefile
@@ -12,9 +12,8 @@ DEPPATH = .dep
 OBJATH = .obj
 SHAREDSRC = ich_descriptors.c
 SHAREDSRCDIR = ../..
-# If your compiler spits out excessive warnings, run make WARNERROR=no
-# You shouldn't have to change this flag.
-WARNERROR ?= yes
+# libreboot forces WARNERROR=no
+WARNERROR = no
 
 SRC = $(wildcard *.c)
 
@@ -45,10 +44,6 @@ EXEC_SUFFIX := .exe
 FLASHPROG_CFLAGS += -D__USE_MINGW_ANSI_STDIO=1
 endif
 
-ifeq ($(WARNERROR), yes)
-CFLAGS += -Werror
-endif
-
 
 FLASHPROG_CFLAGS += -MMD -MP -MF $(DEPPATH)/$(@F).d
 # enables functions that populate the descriptor structs from plain binary dumps
-- 
2.47.3