From: Florian Fainelli <f.fainelli@gmail.com>
To: Jiri Olsa <jolsa@redhat.com>, Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-kernel@vger.kernel.org,
bcm-kernel-feedback-list@broadcom.com,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Namhyung Kim <namhyung@kernel.org>,
Alexey Budankov <alexey.budankov@linux.intel.com>,
Quentin Monnet <quentin.monnet@netronome.com>,
Stanislav Fomichev <sdf@google.com>,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: Re: [PATCH] perf: Don't hardcode host include path for libslang
Date: Mon, 17 Jun 2019 10:37:29 -0700 [thread overview]
Message-ID: <6ac811c5-477f-eb8a-ff5f-1f95b009714e@gmail.com> (raw)
In-Reply-To: <20190616094605.GB2500@krava>
On 6/16/19 2:46 AM, Jiri Olsa wrote:
> On Fri, Jun 14, 2019 at 11:39:47AM -0700, Florian Fainelli wrote:
>> Hardcoding /usr/include/slang is fundamentally incompatible with cross
>> compilation and will lead to the inability for a cross-compiled
>> environment to properly detect whether slang is available or not.
>>
>> If /usr/include/slang is necessary that is a distribution specific
>> knowledge that could be solved with either a standard pkg-config .pc
>> file (which slang has) or simply overriding CFLAGS accordingly, but the
>> default perf Makefile should be clean of all of that.
>
> fedora 30 is ok with this, I guess acme's distro test will
> tell us about the rest ;-)
If this patch somehow breaks a particular distribution (I could test on
everything), the following might be more acceptable:
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 4b8244ee65ce..eefeaa9aa208 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -71,6 +71,7 @@ CC ?= $(CROSS_COMPILE)gcc
CXX ?= $(CROSS_COMPILE)g++
PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config
LLVM_CONFIG ?= llvm-config
+LIBSLANG_CFLAGS ?= -I/usr/include/slang
all: $(FILES)
@@ -181,7 +182,7 @@ $(OUTPUT)test-libaudit.bin:
$(BUILD) -laudit
$(OUTPUT)test-libslang.bin:
- $(BUILD) -I/usr/include/slang -lslang
+ $(BUILD) $(LIBSLANG_CFLAGS) -lslang
$(OUTPUT)test-libcrypto.bin:
$(BUILD) -lcrypto
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 85fbcd265351..df3022b213b3 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -636,12 +636,13 @@ ifdef NO_NEWT
endif
ifndef NO_SLANG
+ LIBSLANG_CFLAGS?=-I/usr/include/slang
ifneq ($(feature-libslang), 1)
msg := $(warning slang not found, disables TUI support. Please
install slang-devel, libslang-dev or libslang2-dev);
NO_SLANG := 1
else
# Fedora has /usr/include/slang/slang.h, but ubuntu
/usr/include/slang.h
- CFLAGS += -I/usr/include/slang
+ CFLAGS += $(LIBSLANG_CFLAGS)
CFLAGS += -DHAVE_SLANG_SUPPORT
EXTLIBS += -lslang
$(call detected,CONFIG_SLANG)
>
> jirka
>
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> tools/build/feature/Makefile | 2 +-
>> tools/perf/Makefile.config | 1 -
>> 2 files changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
>> index 4b8244ee65ce..f9432d21eff9 100644
>> --- a/tools/build/feature/Makefile
>> +++ b/tools/build/feature/Makefile
>> @@ -181,7 +181,7 @@ $(OUTPUT)test-libaudit.bin:
>> $(BUILD) -laudit
>>
>> $(OUTPUT)test-libslang.bin:
>> - $(BUILD) -I/usr/include/slang -lslang
>> + $(BUILD) -lslang
>>
>> $(OUTPUT)test-libcrypto.bin:
>> $(BUILD) -lcrypto
>> diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
>> index 85fbcd265351..b11134fdf59f 100644
>> --- a/tools/perf/Makefile.config
>> +++ b/tools/perf/Makefile.config
>> @@ -641,7 +641,6 @@ ifndef NO_SLANG
>> NO_SLANG := 1
>> else
>> # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h
>> - CFLAGS += -I/usr/include/slang
>> CFLAGS += -DHAVE_SLANG_SUPPORT
>> EXTLIBS += -lslang
>> $(call detected,CONFIG_SLANG)
>> --
>> 2.17.1
>>
--
Florian
next prev parent reply other threads:[~2019-06-17 17:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-14 18:39 [PATCH] perf: Don't hardcode host include path for libslang Florian Fainelli
2019-06-16 9:46 ` Jiri Olsa
2019-06-17 17:37 ` Florian Fainelli [this message]
2019-06-17 18:11 ` Arnaldo Carvalho de Melo
2019-06-17 18:16 ` Florian Fainelli
2019-06-22 6:49 ` [tip:perf/core] perf tools: " tip-bot for Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ac811c5-477f-eb8a-ff5f-1f95b009714e@gmail.com \
--to=f.fainelli@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=alexey.budankov@linux.intel.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=jakub.kicinski@netronome.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=quentin.monnet@netronome.com \
--cc=sdf@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).