[PATCH 10/10] tools gpio: Override CFLAGS assignments

From: Jiri Olsa
Date: Mon Oct 22 2018 - 10:50:16 EST


On Tue, Oct 16, 2018 at 05:06:05PM +0200, Jiri Olsa wrote:
> hi,
> while hardening some of the tools rpm, we noticed we
> can't pass build flags to some of them.
>
> Sending separate tools fixes for what we found. It's
> mostly override for CFLAGS and adding LDFLAGS to the
> build commands.
>
> thanks,
> jirka
>
>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Cc: Hartmut Knaack <knaack.h@xxxxxx>
> Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
> Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
> Cc: Len Brown <len.brown@xxxxxxxxx>
> Cc: Markus Mayer <mmayer@xxxxxxxxxxxx>
> Cc: Shuah Khan <shuah@xxxxxxxxxx>
> Cc: Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Thomas Renninger <trenn@xxxxxxxx>
> Cc: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx>
> Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
> ---
> Jiri Olsa (10):
> tools lib traceevent: Use LDFLAGS in the build commands
> tools perf: Pass build flags to traceevent build
> tools cpupower debug: Allow to use outside build flags
> tools cpupower: Override CFLAGS assignments
> tools power x86_energy_perf_policy: Override CFLAGS assignments and add LDFLAGS to build command
> tools thermal tmon: Override CFLAGS assignments
> tools thermal tmon: Use -O3 instead of -O1 if available
> tools power turbostat: Override CFLAGS assignments and add LDFLAGS to build command
> tools iio: Override CFLAGS assignments
> tools gpio: Override CFLAGS assignments

the last one did not get post for some reason,
attaching it now

jirka


---
So user could specify outside CFLAGS values.

Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
Cc: Hartmut Knaack <knaack.h@xxxxxx>
Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/gpio/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/gpio/Makefile b/tools/gpio/Makefile
index 240eda014b37..6ecdd1067826 100644
--- a/tools/gpio/Makefile
+++ b/tools/gpio/Makefile
@@ -12,7 +12,7 @@ endif
# (this improves performance and avoids hard-to-debug behaviour);
MAKEFLAGS += -r

-CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include
+override CFLAGS += -O2 -Wall -g -D_GNU_SOURCE -I$(OUTPUT)include

ALL_TARGETS := lsgpio gpio-hammer gpio-event-mon
ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
--
2.17.2