[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b093fc67-a251-fad3-e6f6-19c5d85253dc@kernel.org>
Date: Tue, 19 Oct 2021 10:06:36 +0200
From: Daniel Bristot de Oliveira <bristot@...nel.org>
To: "Ahmed S. Darwish" <a.darwish@...utronix.de>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>,
Tom Zanussi <zanussi@...nel.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Juri Lelli <juri.lelli@...hat.com>,
Clark Williams <williams@...hat.com>,
John Kacur <jkacur@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
linux-rt-users@...r.kernel.org, linux-trace-devel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3 06/19] rtla: Real-Time Linux Analysis tool
On 10/18/21 21:30, Ahmed S. Darwish wrote:
> On Mon, Oct 18, 2021, Daniel Bristot de Oliveira wrote:
>> --- /dev/null
>> +++ b/tools/tracing/rtla/Makefile
>> @@ -0,0 +1,59 @@
>> +CC := gcc
>
> Some $(CROSS_COMPILE) for the poor souls who will integrate this into
> embedded distributions?
>
>> +
>> +TRACEFS_HEADERS := $$(pkg-config --cflags libtracefs)
>> +
>
> ditto. This uses the host's pkg-config unconditionally.
mind trying this (on top of the current one)?
Thanks!
diff --git a/tools/tracing/rtla/Makefile b/tools/tracing/rtla/Makefile
index 9a914391e507..8c2b7f8c7f20 100644
--- a/tools/tracing/rtla/Makefile
+++ b/tools/tracing/rtla/Makefile
@@ -1,14 +1,30 @@
NAME := rtla
VERSION := 0.1
+# Makefiles suck: This macro sets a default value of $(2) for the
+# variable named by $(1), unless the variable has been set by
+# environment or command line. This is necessary for CC and AR
+# because make sets default values, so the simpler ?= approach
+# won't work as expected.
+define allow-override
+ $(if $(or $(findstring environment,$(origin $(1))),\
+ $(findstring command line,$(origin $(1)))),,\
+ $(eval $(1) = $(2)))
+endef
+
+# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
+$(call allow-override,CC,$(CROSS_COMPILE)gcc)
+$(call allow-override,AR,$(CROSS_COMPILE)ar)
+$(call allow-override,PKG_CONFIG,pkg-config)
+$(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
+$(call allow-override,LDCONFIG,ldconfig)
+
INSTALL = install
-CC := gcc
FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
- -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-MOPTS := -m64 -mtune=generic
+ -fasynchronous-unwind-tables -fstack-clash-protection
WOPTS := -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
-TRACEFS_HEADERS := $$(pkg-config --cflags libtracefs)
+TRACEFS_HEADERS := $$($(PKG_CONFIG) --cflags libtracefs)
CFLAGS := -O -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(MOPTS) $(WOPTS) $(TRACEFS_HEADERS)
LDFLAGS := -ggdb
Powered by blists - more mailing lists