blob: 0ba8c45284c1bf4a667e7b9c3c282cf2c8e9cb1e (
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
|
https://bugs.gentoo.org/931972
https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git/commit/?id=027b2d37a8cd56973d117107acc25a64cfe0a92f
From b7028334f2dfbb0b11cf1fa34ecb89d5287c367b Mon Sep 17 00:00:00 2001
From: Gwendal Grignou <gwendal@chromium.org>
Date: Wed, 15 May 2024 14:30:59 -0700
Subject: [PATCH] Makefile: Do not call gcc directly
When mdadm is compiled with clang, direct gcc will fail.
Make sure to use $(CC) variable instead.
Note that Clang does not support --help=warnings --
-print-diagnostic-options should be used instead.
So with Clang, the compilation will go through, but the
extra warning flags will never be added.
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index adac7905..ec8c4226 100644
--- a/Makefile
+++ b/Makefile
@@ -56,21 +56,21 @@ CWFLAGS += -Wp -O3
endif
ifeq ($(origin FALLTHROUGH), undefined)
- FALLTHROUGH := $(shell gcc -Q --help=warnings 2>&1 | grep "implicit-fallthrough" | wc -l)
+ FALLTHROUGH := $(shell $(CC) $(CFLAGS) -Q --help=warnings 2>&1 | grep "implicit-fallthrough" | wc -l)
ifneq "$(FALLTHROUGH)" "0"
CWFLAGS += -Wimplicit-fallthrough=0
endif
endif
ifeq ($(origin FORMATOVERFLOW), undefined)
- FORMATOVERFLOW := $(shell gcc -Q --help=warnings 2>&1 | grep "format-overflow" | wc -l)
+ FORMATOVERFLOW := $(shell $(CC) $(CFLAGS) -Q --help=warnings 2>&1 | grep "format-overflow" | wc -l)
ifneq "$(FORMATOVERFLOW)" "0"
CWFLAGS += -Wformat-overflow
endif
endif
ifeq ($(origin STRINGOPOVERFLOW), undefined)
- STRINGOPOVERFLOW := $(shell gcc -Q --help=warnings 2>&1 | grep "stringop-overflow" | wc -l)
+ STRINGOPOVERFLOW := $(shell $(CC) $(CFLAGS) -Q --help=warnings 2>&1 | grep "stringop-overflow" | wc -l)
ifneq "$(STRINGOPOVERFLOW)" "0"
CWFLAGS += -Wstringop-overflow
endif
--
2.45.0.215.g3402c0e53f-goog
|