Patrick Williams | b58112e | 2024-03-07 11:16:36 -0600 | [diff] [blame^] | 1 | From f1b74f21875d6d9f0a5ac3d67df40a28b167052a Mon Sep 17 00:00:00 2001 |
| 2 | From: Changqing Li <changqing.li@windriver.com> |
| 3 | Date: Mon, 26 Nov 2018 09:19:17 +0800 |
| 4 | Subject: [PATCH 04/12] RH: use rpm optflags if present |
| 5 | |
| 6 | Use the passed in optflags when compiling as an RPM, and keep the |
| 7 | default flags as close as possible to the current fedora flags, while |
| 8 | still being generic. |
| 9 | |
| 10 | Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> |
| 11 | |
| 12 | Upstream-Status: Pending |
| 13 | |
| 14 | [OP: Rebase to 0.9.3] |
| 15 | Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> |
| 16 | |
| 17 | Rebase to 0.9.8 |
| 18 | Signed-off-by: Changqing Li <changqing.li@windriver.com> |
| 19 | --- |
| 20 | Makefile.inc | 12 ++++++++++-- |
| 21 | 1 file changed, 10 insertions(+), 2 deletions(-) |
| 22 | |
| 23 | diff --git a/Makefile.inc b/Makefile.inc |
| 24 | index 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 | -- |
| 54 | 2.25.1 |
| 55 | |