Skip to contentSkip to conversation

tools: Various build flags fixes

PATCH New Jiri Olsa 2 participants 5 messages Jan 3, 2019 – Jan 8, 2019

Subsystems (2)
lore
Share & tools
lore

Jiri Olsa

author
#0 lore raw

v3 cover tools: Various build flags fixes

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.

Any additional reviews would be great.. ;-)

v3 changes:
- 4 more patches accepted, still 2 to go
- rebased on top of Arnaldo's perf/core

v2 changes:
- 4 patches already accepted, still 6 to go
- adding more people to cc

Also available in here:
git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
tools/flags_v3

thanks,
jirka

Cc Hartmut Knaack <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Len Brown <[email protected]>
Cc Markus Mayer <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Len Brown <[email protected]>
Cc Thomas Renninger <[email protected]>
Cc Zhang Rui <[email protected]>

---
Jiri Olsa (2):
tools thermal tmon: Use -O3 instead of -O1 if available tools iio: Override CFLAGS assignments

 tools/iio/Makefile          | 2 +-
 tools/thermal/tmon/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
author
#1 lore raw

PATCH v3 1/2 tools thermal tmon: Use -O3 instead of -O1 if available

Using -O3 instead of -O1 if it's supported by compiler.

Cc Brian Norris <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Markus Mayer <[email protected]>
---
 tools/thermal/tmon/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/thermal/tmon/Makefile +1 -1
index 89a2444c1df2..59e417ec3e13 100644
@@ -6,7 +6,7 @@ VERSION = 1.0
 
 BINDIR=usr/bin
 WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
-override CFLAGS+= -O1 ${WARNFLAGS}
+override CFLAGS+= $(call cc-option,-O3,-O1) ${WARNFLAGS}
 # Add "-fstack-protector" only if toolchain supports it.
 override CFLAGS+= $(call cc-option,-fstack-protector-strong)
 CC?= $(CROSS_COMPILE)gcc
Signature · 1 line
2.17.2
#2 lore raw

[tip:perf/urgent] tools thermal tmon: Use -O3 instead of -O1 if available

tools thermal tmon: Use -O3 instead of -O1 if available
Commit-ID:  302df34c4e64b9e83ee31cbf508b38b62b428bd6
Gitweb:     https://git.kernel.org/tip/302df34c4e64b9e83ee31cbf508b38b62b428bd6
Author:     Jiri Olsa <[email protected]>
AuthorDate: Thu, 3 Jan 2019 17:13:49 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 4 Jan 2019 12:54:49 -0300

tools thermal tmon: Use -O3 instead of -O1 if available

Using -O3 instead of -O1 if it's supported by compiler.

---
 tools/thermal/tmon/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/thermal/tmon/Makefile +1 -1
index 89a2444c1df2..59e417ec3e13 100644
@@ -6,7 +6,7 @@ VERSION = 1.0
 
 BINDIR=usr/bin
 WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
-override CFLAGS+= -O1 ${WARNFLAGS}
+override CFLAGS+= $(call cc-option,-O3,-O1) ${WARNFLAGS}
 # Add "-fstack-protector" only if toolchain supports it.
 override CFLAGS+= $(call cc-option,-fstack-protector-strong)
 CC?= $(CROSS_COMPILE)gcc
author
#3 lore raw

PATCH v3 2/2 tools iio: Override CFLAGS assignments

In reply to Jiri Olsa

So user could specify outside CFLAGS values.

Cc Andy Shevchenko <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Hartmut Knaack <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
---
 tools/iio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/iio/Makefile +1 -1
index 332ed2f6c2c2..e22378dba244 100644
@@ -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 := iio_event_monitor lsiio iio_generic_buffer
 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))
Signature · 1 line
2.17.2
#4 lore raw

[tip:perf/urgent] tools iio: Override CFLAGS assignments

tools iio: Override CFLAGS assignments
Commit-ID:  536cdb684d2d5139708d290b9dc124b1420886c1
Gitweb:     https://git.kernel.org/tip/536cdb684d2d5139708d290b9dc124b1420886c1
Author:     Jiri Olsa <[email protected]>
AuthorDate: Thu, 3 Jan 2019 17:13:50 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 4 Jan 2019 12:54:49 -0300

tools iio: Override CFLAGS assignments

So user could specify outside CFLAGS values.

Cc Alexander Shishkin <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Hartmut Knaack <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Lars-Peter Clausen <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Peter Zijlstra <[email protected]>
---
 tools/iio/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/iio/Makefile +1 -1
index 332ed2f6c2c2..e22378dba244 100644
@@ -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 := iio_event_monitor lsiio iio_generic_buffer
 ALL_PROGRAMS := $(patsubst %,$(OUTPUT)%,$(ALL_TARGETS))