blob: 91477a44cb2aa109375800ca7e4b8d80f3e4e1cf [file] [log] [blame]
Patrick Williamsb58112e2024-03-07 11:16:36 -06001From f1b74f21875d6d9f0a5ac3d67df40a28b167052a Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Mon, 26 Nov 2018 09:19:17 +0800
4Subject: [PATCH 04/12] RH: use rpm optflags if present
5
6Use the passed in optflags when compiling as an RPM, and keep the
7default flags as close as possible to the current fedora flags, while
8still being generic.
9
10Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
11
12Upstream-Status: Pending
13
14[OP: Rebase to 0.9.3]
15Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
16
17Rebase to 0.9.8
18Signed-off-by: Changqing Li <changqing.li@windriver.com>
19---
20 Makefile.inc | 12 ++++++++++--
21 1 file changed, 10 insertions(+), 2 deletions(-)
22
23diff --git a/Makefile.inc b/Makefile.inc
24index de89b21f..6ac632ff 100644
25--- a/Makefile.inc
26+++ b/Makefile.inc
27@@ -95,7 +95,15 @@ SYSTEMD_LIBDEPS := $(if $(SYSTEMD),$(if $(shell test $(SYSTEMD) -gt 209 && echo
28 MODPROBE_UNIT := $(shell test "0$(SYSTEMD)" -lt 245 2>/dev/null || \
29 echo "modprobe@dm_multipath.service")
30
31-OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
32+ifndef RPM_OPT_FLAGS
33+ OPTFLAGS := -O2 -g $(STACKPROT) --param=ssp-buffer-size=4
34+else
35+ OPTFLAGS = $(RPM_OPT_FLAGS)
36+endif
37+OPTFLAGS += -Wextra -Wstrict-prototypes -Wformat=0 -Werror=implicit-int \
38+ -Werror=implicit-function-declaration -Wno-sign-compare \
39+ -Wno-unused-parameter -Werror=cast-qual \
40+ -Werror=discarded-qualifiers
41 WARNFLAGS := -Werror -Wall -Wextra -Wformat=2 $(WFORMATOVERFLOW) -Werror=implicit-int \
42 -Werror=implicit-function-declaration -Werror=format-security \
43 $(WNOCLOBBERED) -Werror=cast-qual $(ERROR_DISCARDED_QUALIFIERS) $(W_URCU_TYPE_LIMITS)
44@@ -105,7 +113,7 @@ CPPFLAGS := $(FORTIFY_OPT) $(CPPFLAGS) $(D_URCU_VERSION) \
45 -DRUNTIME_DIR=\"$(runtimedir)\" -DCONFIG_DIR=\"$(configdir)\" \
46 -DDEFAULT_CONFIGFILE=\"$(configfile)\" -DSTATE_DIR=\"$(statedir)\" \
47 -DEXTRAVERSION=\"$(EXTRAVERSION)\" -MMD -MP
48-CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) $(WARNFLAGS) -pipe
49+CFLAGS := -std=gnu99 $(CFLAGS) $(OPTFLAGS) -pipe
50 BIN_CFLAGS := -fPIE -DPIE
51 LIB_CFLAGS := -fPIC
52 SHARED_FLAGS := -shared
53--
542.25.1
55