perf: Don't hardcode host include path for libslang
PATCH 1/1 perf: Don't hardcode host include path for libslang
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.
--- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
tools/build/feature/Makefile +1 -1
@@ -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
tools/perf/Makefile.config +0 -1
@@ -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)
Signature · 1 line
2.17.1
Quoted 8 lines · Florian Fainelli
Hardcoding
/usr/include/slangis 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/slangis 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 perfMakefileshould be clean of all of that.
fedora 30 is ok with this, I guess acme's distro test will tell us about the rest ;-)
jirka
Quoted 35 lines
Signed-off-by Florian Fainelli <[email protected]>--- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)tools/build/feature/Makefile +1
-1@@ -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) -lcryptotools/perf/Makefile.config +0
-1@@ -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)Signature · 1 line
2.17.1
Quoted 5 lines · Jiri Olsa
Quoted 4 lines · Florian Fainelli
Hardcoding
/usr/include/slangis 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.
Quoted 7 lines
Quoted 4 lines
If
/usr/include/slangis 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 perfMakefileshould 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:
tools/build/feature/Makefile +2 -1
@@ -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
tools/perf/Makefile.config +1 -0
@@ -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)Quoted 38 lines
jirka
Quoted 35 lines
Signed-off-by Florian Fainelli <[email protected]>--- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)tools/build/feature/Makefile +1
-1@@ -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) -lcryptotools/perf/Makefile.config +0
-1@@ -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)Signature · 1 line
2.17.1
Signature · 1 line
Florian
Em Sun, Jun 16, 2019 at 11:46:05AM +0200, Jiri Olsa escreveu:
Quoted 5 lines · Florian Fainelli
Quoted 4 lines
Hardcoding
/usr/include/slangis 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.
Quoted 7 lines
Quoted 4 lines
If
/usr/include/slangis 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 perfMakefileshould be clean of all of that.fedora 30 is ok with this, I guess acme's distro test will tell us about the rest ;-)
Seems to be just needless old cruft:
[perfbuilder@7143ebde35eb /]$ cat /etc/redhat-release
Fedora release 20 (Heisenbug)
[perfbuilder@7143ebde35eb /]$
[perfbuilder@7143ebde35eb /]$ ls -la /usr/include/slang.h -rw-r--r--. 1 root root 87562 Apr 11 2011 /usr/include/slang.h [perfbuilder@7143ebde35eb /]$ ls -la /usr/include/slang/slang.h lrwxrwxrwx. 1 root root 10 Jun 17 16:41 /usr/include/slang/slang.h -> ../slang.h [perfbuilder@7143ebde35eb /]$
So I'm removing that comment:
Quoted 1 line
Quoted 1 line
# Fedora has
/usr/include/slang/slang.h, but ubuntu/usr/include/slang.h
And adding a:
Will do a build with all the containers and check that the output for all the ones with the slang devel package installed have slang successfully detected.
Thanks,
- Arnaldo
Quoted 7 lines
jirka
Quoted 5 lines
Signed-off-by Florian Fainelli <[email protected]>--- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 1 -
2> > 2 files changed, 1 insertion(+), 2 deletions(-)
Quoted 29 lines
Quoted 29 lines
tools/build/feature/Makefile +1
-1@@ -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) -lcryptotools/perf/Makefile.config +0
-1@@ -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)Signature · 1 line
2.17.1
Signature · 1 line
- Arnaldo
Quoted 25 lines · Arnaldo Carvalho de Melo
Em Sun, Jun 16, 2019 at 11:46:05AM +0200, Jiri Olsa escreveu:
Quoted 5 lines · Florian Fainelli
Quoted 4 lines
Hardcoding
/usr/include/slangis 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.Quoted 7 lines
Quoted 4 lines
If
/usr/include/slangis 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 perfMakefileshould be clean of all of that.fedora 30 is ok with this, I guess acme's distro test will tell us about the rest ;-)
Seems to be just needless old cruft:
[perfbuilder@7143ebde35eb /]$ cat
/etc/redhat-release
Fedora release 20 (Heisenbug)
[perfbuilder@7143ebde35eb /]$
[perfbuilder@7143ebde35eb /]$ ls -la/usr/include/slang.h-rw-r--r--. 1 root root 87562 Apr 11 2011/usr/include/slang.h[perfbuilder@7143ebde35eb /]$ ls -la/usr/include/slang/slang.hlrwxrwxrwx. 1 root root 10 Jun 17 16:41/usr/include/slang/slang.h->../slang.h[perfbuilder@7143ebde35eb /]$
Quoted 7 lines
So I'm removing that comment:
Quoted 1 line
Quoted 1 line
# Fedora has
/usr/include/slang/slang.h, but ubuntu/usr/include/slang.hAnd adding a:
Fixes ef7b93a11904 ("perf report: Librarize the annotation code and use it in the newt browser")
OK, I was not sure if you would consider that a worthy fix or not, but that works for me.
Quoted 4 lines
Will do a build with all the containers and check that the output for all the ones with the slang devel package installed have slang successfully detected.
Thanks, let me know if that does not work somehow.
Signature · 1 line
Florian
tip-bot for Florian Fainelli
merge bot[tip:perf/core] perf tools: Don't hardcode host include path for libslang
In reply to Florian Fainelliperf tools: Don't hardcode host include path for libslang
Commit-ID: 1955c8cf5e26b1f70d674190ff9984dbfd531ee9 Gitweb: https://git.kernel.org/tip/1955c8cf5e26b1f70d674190ff9984dbfd531ee9 Author: Florian Fainelli <[email protected]> AuthorDate: Fri, 14 Jun 2019 11:39:47 -0700 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 17 Jun 2019 15:57:20 -0300
perf tools: Don't hardcode host include path for libslang
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.
--- tools/build/feature/Makefile | 2 +- tools/perf/Makefile.config | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
tools/build/feature/Makefile +1 -1
@@ -182,7 +182,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
tools/perf/Makefile.config +0 -1
@@ -648,7 +648,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)