* [RFC PATCH] perf: add SLANG_INC for slang.h @ 2012-08-24 3:10 Liang Li 2012-09-05 20:54 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 6+ messages in thread From: Liang Li @ 2012-08-24 3:10 UTC (permalink / raw) To: a.p.zijlstra, paulus, mingo, acme; +Cc: linux-kernel, richard.purdie CFLAGS was previously hard coded to contain "-I/usr/include/slang" to work with hosts that have "/usr/include/slang/slang.h" as well as hosts that have "/usr/include/slang.h". This path can cause compile warnings like: cc1: warning: '/usr/include/slang' doesn't exists. or cc1: warning: include location "/usr/include/slang" is unsafe for cross-compilation [-Wpoison-system-directories] Then in some cases warnings become errors if WERROR is enabled hence build errors. To fix this issue, we can use -idirafter to downgrade the priority of the default hard coded path. We can also make the slang include directory a variable, to allow the user to specify SLANG_INC and set their own include location. And add a '=' prefix to indicate better compatibility with sysroot/cross compile cases. Signed-off-by: Liang Li <liang.li@windriver.com> --- tools/perf/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/Makefile b/tools/perf/Makefile index b7a7a87..e403c36 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile @@ -496,8 +496,10 @@ else msg := $(warning newt not found, disables TUI support. Please install newt-devel or libnewt-dev); BASIC_CFLAGS += -DNO_NEWT_SUPPORT else - # Fedora has /usr/include/slang/slang.h, but ubuntu /usr/include/slang.h - BASIC_CFLAGS += -I/usr/include/slang + # Some releases like Fedora has /usr/include/slang/slang.h other than /usr/include/slang.h + SLANG_INC ?= -idirafter =/usr/include/slang + BASIC_CFLAGS += $(SLANG_INC) + EXTLIBS += -lnewt -lslang LIB_OBJS += $(OUTPUT)ui/setup.o LIB_OBJS += $(OUTPUT)ui/browser.o -- 1.7.11.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] perf: add SLANG_INC for slang.h 2012-08-24 3:10 [RFC PATCH] perf: add SLANG_INC for slang.h Liang Li @ 2012-09-05 20:54 ` Arnaldo Carvalho de Melo 2012-09-05 21:23 ` Richard Purdie 0 siblings, 1 reply; 6+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 20:54 UTC (permalink / raw) To: Liang Li; +Cc: a.p.zijlstra, paulus, mingo, linux-kernel, richard.purdie Em Fri, Aug 24, 2012 at 11:10:39AM +0800, Liang Li escreveu: > CFLAGS was previously hard coded to contain "-I/usr/include/slang" to > work with hosts that have "/usr/include/slang/slang.h" as well as hosts > that have "/usr/include/slang.h". This path can cause compile warnings > like: > > cc1: warning: '/usr/include/slang' doesn't exists. > > or > > cc1: warning: include location "/usr/include/slang" is unsafe for > cross-compilation [-Wpoison-system-directories] > > Then in some cases warnings become errors if WERROR is enabled hence > build errors. > > To fix this issue, we can use -idirafter to downgrade the priority of the > default hard coded path. We can also make the slang include directory > a variable, to allow the user to specify SLANG_INC and set their own > include location. And add a '=' prefix to indicate better > compatibility with sysroot/cross compile cases. CC /home/acme/git/build/perf/builtin-diff.o In file included from util/../ui/keysyms.h:4, from util/hist.h:142, from builtin-diff.c:11: util/../ui/libslang.h:12:19: error: slang.h: No such file or directory util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined In file included from util/../ui/keysyms.h:4, from util/hist.h:142, from util/evsel.h:10, from util/evlist.h:8, from builtin-annotate.c:20: util/../ui/libslang.h:12:19: error: slang.h: No such file or directory util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined builtin-annotate.c: In function ‘hists__find_annotations’: builtin-annotate.c:122: error: ‘SL_KEY_RIGHT’ undeclared (first use in this function) builtin-annotate.c:122: error: (Each undeclared identifier is reported only once builtin-annotate.c:122: error: for each function it appears in.) builtin-annotate.c:134: error: ‘SL_KEY_LEFT’ undeclared (first use in this function) make: *** [/home/acme/git/build/perf/builtin-annotate.o] Error 1 make: *** Waiting for unfinished jobs.... make: *** [/home/acme/git/build/perf/builtin-diff.o] Error 1 make: Leaving directory `/home/git/linux/tools/perf' [acme@sandy linux]$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.3 (Santiago) [acme@sandy linux]$ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] perf: add SLANG_INC for slang.h 2012-09-05 20:54 ` Arnaldo Carvalho de Melo @ 2012-09-05 21:23 ` Richard Purdie 2012-09-05 22:41 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 6+ messages in thread From: Richard Purdie @ 2012-09-05 21:23 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Liang Li, a.p.zijlstra, paulus, mingo, linux-kernel On Wed, 2012-09-05 at 13:54 -0700, Arnaldo Carvalho de Melo wrote: > Em Fri, Aug 24, 2012 at 11:10:39AM +0800, Liang Li escreveu: > > CFLAGS was previously hard coded to contain "-I/usr/include/slang" to > > work with hosts that have "/usr/include/slang/slang.h" as well as hosts > > that have "/usr/include/slang.h". This path can cause compile warnings > > like: > > > > cc1: warning: '/usr/include/slang' doesn't exists. > > > > or > > > > cc1: warning: include location "/usr/include/slang" is unsafe for > > cross-compilation [-Wpoison-system-directories] > > > > Then in some cases warnings become errors if WERROR is enabled hence > > build errors. > > > > To fix this issue, we can use -idirafter to downgrade the priority of the > > default hard coded path. We can also make the slang include directory > > a variable, to allow the user to specify SLANG_INC and set their own > > include location. And add a '=' prefix to indicate better > > compatibility with sysroot/cross compile cases. > > CC /home/acme/git/build/perf/builtin-diff.o > In file included from util/../ui/keysyms.h:4, > from util/hist.h:142, > from builtin-diff.c:11: > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > In file included from util/../ui/keysyms.h:4, > from util/hist.h:142, > from util/evsel.h:10, > from util/evlist.h:8, > from builtin-annotate.c:20: > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > builtin-annotate.c: In function ‘hists__find_annotations’: > builtin-annotate.c:122: error: ‘SL_KEY_RIGHT’ undeclared (first use in > this function) > builtin-annotate.c:122: error: (Each undeclared identifier is reported > only once > builtin-annotate.c:122: error: for each function it appears in.) > builtin-annotate.c:134: error: ‘SL_KEY_LEFT’ undeclared (first use in > this function) > make: *** [/home/acme/git/build/perf/builtin-annotate.o] Error 1 > make: *** Waiting for unfinished jobs.... > make: *** [/home/acme/git/build/perf/builtin-diff.o] Error 1 > make: Leaving directory `/home/git/linux/tools/perf' > [acme@sandy linux]$ cat /etc/redhat-release > Red Hat Enterprise Linux Server release 6.3 (Santiago) > [acme@sandy linux]$ Does: SLANG_INC ?= -I=/usr/include/slang work any better? Its hard to tell from the above error which bit of the syntax is failing. Which gcc version is it? Cheers, Richard ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] perf: add SLANG_INC for slang.h 2012-09-05 21:23 ` Richard Purdie @ 2012-09-05 22:41 ` Arnaldo Carvalho de Melo 2012-09-06 2:11 ` Liang Li 0 siblings, 1 reply; 6+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-05 22:41 UTC (permalink / raw) To: Richard Purdie; +Cc: Liang Li, a.p.zijlstra, paulus, mingo, linux-kernel Em Wed, Sep 05, 2012 at 10:23:03PM +0100, Richard Purdie escreveu: > On Wed, 2012-09-05 at 13:54 -0700, Arnaldo Carvalho de Melo wrote: > > Em Fri, Aug 24, 2012 at 11:10:39AM +0800, Liang Li escreveu: > > > CFLAGS was previously hard coded to contain "-I/usr/include/slang" to > > > work with hosts that have "/usr/include/slang/slang.h" as well as hosts > > > that have "/usr/include/slang.h". This path can cause compile warnings > > > like: > > > > > > cc1: warning: '/usr/include/slang' doesn't exists. > > > > > > or > > > > > > cc1: warning: include location "/usr/include/slang" is unsafe for > > > cross-compilation [-Wpoison-system-directories] > > > > > > Then in some cases warnings become errors if WERROR is enabled hence > > > build errors. > > > > > > To fix this issue, we can use -idirafter to downgrade the priority of the > > > default hard coded path. We can also make the slang include directory > > > a variable, to allow the user to specify SLANG_INC and set their own > > > include location. And add a '=' prefix to indicate better > > > compatibility with sysroot/cross compile cases. > > > > CC /home/acme/git/build/perf/builtin-diff.o > > In file included from util/../ui/keysyms.h:4, > > from util/hist.h:142, > > from builtin-diff.c:11: > > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > > In file included from util/../ui/keysyms.h:4, > > from util/hist.h:142, > > from util/evsel.h:10, > > from util/evlist.h:8, > > from builtin-annotate.c:20: > > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > > builtin-annotate.c: In function ‘hists__find_annotations’: > > builtin-annotate.c:122: error: ‘SL_KEY_RIGHT’ undeclared (first use in > > this function) > > builtin-annotate.c:122: error: (Each undeclared identifier is reported > > only once > > builtin-annotate.c:122: error: for each function it appears in.) > > builtin-annotate.c:134: error: ‘SL_KEY_LEFT’ undeclared (first use in > > this function) > > make: *** [/home/acme/git/build/perf/builtin-annotate.o] Error 1 > > make: *** Waiting for unfinished jobs.... > > make: *** [/home/acme/git/build/perf/builtin-diff.o] Error 1 > > make: Leaving directory `/home/git/linux/tools/perf' > > [acme@sandy linux]$ cat /etc/redhat-release > > Red Hat Enterprise Linux Server release 6.3 (Santiago) > > [acme@sandy linux]$ > > Does: > > SLANG_INC ?= -I=/usr/include/slang > > work any better? Its hard to tell from the above error which bit of the I'll try later > syntax is failing. Which gcc version is it? [acme@sandy linux]$ gcc -v Using built-in specs. Target: x86_64-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux Thread model: posix gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) [acme@sandy linux]$ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] perf: add SLANG_INC for slang.h 2012-09-05 22:41 ` Arnaldo Carvalho de Melo @ 2012-09-06 2:11 ` Liang Li 2012-09-06 13:55 ` Arnaldo Carvalho de Melo 0 siblings, 1 reply; 6+ messages in thread From: Liang Li @ 2012-09-06 2:11 UTC (permalink / raw) To: Arnaldo Carvalho de Melo Cc: Richard Purdie, a.p.zijlstra, paulus, mingo, linux-kernel On 2012-09-06 06:41, Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote: > Em Wed, Sep 05, 2012 at 10:23:03PM +0100, Richard Purdie escreveu: > > On Wed, 2012-09-05 at 13:54 -0700, Arnaldo Carvalho de Melo wrote: > > > Em Fri, Aug 24, 2012 at 11:10:39AM +0800, Liang Li escreveu: > > > > CFLAGS was previously hard coded to contain "-I/usr/include/slang" to > > > > work with hosts that have "/usr/include/slang/slang.h" as well as hosts > > > > that have "/usr/include/slang.h". This path can cause compile warnings > > > > like: > > > > > > > > cc1: warning: '/usr/include/slang' doesn't exists. > > > > > > > > or > > > > > > > > cc1: warning: include location "/usr/include/slang" is unsafe for > > > > cross-compilation [-Wpoison-system-directories] > > > > > > > > Then in some cases warnings become errors if WERROR is enabled hence > > > > build errors. > > > > > > > > To fix this issue, we can use -idirafter to downgrade the priority of the > > > > default hard coded path. We can also make the slang include directory > > > > a variable, to allow the user to specify SLANG_INC and set their own > > > > include location. And add a '=' prefix to indicate better > > > > compatibility with sysroot/cross compile cases. > > > > > > CC /home/acme/git/build/perf/builtin-diff.o > > > In file included from util/../ui/keysyms.h:4, > > > from util/hist.h:142, > > > from builtin-diff.c:11: > > > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > > > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > > > In file included from util/../ui/keysyms.h:4, > > > from util/hist.h:142, > > > from util/evsel.h:10, > > > from util/evlist.h:8, > > > from builtin-annotate.c:20: > > > util/../ui/libslang.h:12:19: error: slang.h: No such file or directory > > > util/../ui/libslang.h:14:5: error: "SLANG_VERSION" is not defined > > > builtin-annotate.c: In function ‘hists__find_annotations’: > > > builtin-annotate.c:122: error: ‘SL_KEY_RIGHT’ undeclared (first use in > > > this function) > > > builtin-annotate.c:122: error: (Each undeclared identifier is reported > > > only once > > > builtin-annotate.c:122: error: for each function it appears in.) > > > builtin-annotate.c:134: error: ‘SL_KEY_LEFT’ undeclared (first use in > > > this function) > > > make: *** [/home/acme/git/build/perf/builtin-annotate.o] Error 1 > > > make: *** Waiting for unfinished jobs.... > > > make: *** [/home/acme/git/build/perf/builtin-diff.o] Error 1 > > > make: Leaving directory `/home/git/linux/tools/perf' > > > [acme@sandy linux]$ cat /etc/redhat-release > > > Red Hat Enterprise Linux Server release 6.3 (Santiago) > > > [acme@sandy linux]$ > > > > Does: > > > > SLANG_INC ?= -I=/usr/include/slang > > > > work any better? Its hard to tell from the above error which bit of the > > I'll try later > > > syntax is failing. Which gcc version is it? > > [acme@sandy linux]$ gcc -v > Using built-in specs. > Target: x86_64-redhat-linux > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > --infodir=/usr/share/info > --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap > --enable-shared --enable-threads=posix --enable-checking=release > --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions > --enable-gnu-unique-object > --enable-languages=c,c++,objc,obj-c++,java,fortran,ada > --enable-java-awt=gtk --disable-dssi > --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre > --enable-libgcj-multifile --enable-java-maintainer-mode > --with-ecj-jar=/usr/share/java/eclipse-ecj.jar > --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic > --with-arch_32=i686 --build=x86_64-redhat-linux > Thread model: posix > gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) > [acme@sandy linux]$ Seems like there is no slang.h installed. Could you please check: $ find /usr/include/ -name slang.h On my FC17: $ find /usr/include/ -name slang.h /usr/include/slang/slang.h /usr/include/slang.h $ rpm -qf /usr/include/slang.h slang-devel-2.2.4-3.fc17.x86_64 $ rpm -qf /usr/include/slang/slang.h slang-devel-2.2.4-3.fc17.x86_64 --- And does 'export SLANG_INC=<to location of the slang.h>' works any better? :) Cheers, Liang Li ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [RFC PATCH] perf: add SLANG_INC for slang.h 2012-09-06 2:11 ` Liang Li @ 2012-09-06 13:55 ` Arnaldo Carvalho de Melo 0 siblings, 0 replies; 6+ messages in thread From: Arnaldo Carvalho de Melo @ 2012-09-06 13:55 UTC (permalink / raw) To: Liang Li; +Cc: Richard Purdie, a.p.zijlstra, paulus, mingo, linux-kernel Em Thu, Sep 06, 2012 at 10:11:22AM +0800, Liang Li escreveu: > On 2012-09-06 06:41, Arnaldo Carvalho de Melo <acme@ghostprotocols.net> wrote: > > > Does: > > > > > > SLANG_INC ?= -I=/usr/include/slang > > > > > > work any better? Its hard to tell from the above error which bit of the > > > > I'll try later > > > > > syntax is failing. Which gcc version is it? > > > > [acme@sandy linux]$ gcc -v > > Using built-in specs. > > Target: x86_64-redhat-linux > > Configured with: ../configure --prefix=/usr --mandir=/usr/share/man > > --infodir=/usr/share/info > > --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap > > --enable-shared --enable-threads=posix --enable-checking=release > > --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions > > --enable-gnu-unique-object > > --enable-languages=c,c++,objc,obj-c++,java,fortran,ada > > --enable-java-awt=gtk --disable-dssi > > --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre > > --enable-libgcj-multifile --enable-java-maintainer-mode > > --with-ecj-jar=/usr/share/java/eclipse-ecj.jar > > --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic > > --with-arch_32=i686 --build=x86_64-redhat-linux > > Thread model: posix > > gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) > > [acme@sandy linux]$ > > Seems like there is no slang.h installed. Could you please check: > > $ find /usr/include/ -name slang.h > > On my FC17: > > $ find /usr/include/ -name slang.h > /usr/include/slang/slang.h > /usr/include/slang.h > $ rpm -qf /usr/include/slang.h > slang-devel-2.2.4-3.fc17.x86_64 > $ rpm -qf /usr/include/slang/slang.h > slang-devel-2.2.4-3.fc17.x86_64 [root@sandy ~]# find /usr/include/ -name slang.h /usr/include/slang/slang.h [root@sandy ~]# [root@sandy ~]# rpm -qf /usr/include/slang/slang.h slang-devel-2.2.1-1.el6.x86_64 > --- > > And does 'export SLANG_INC=<to location of the slang.h>' works any > better? :) Lemme process the other patches first, will try. - arnaldo ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-09-06 13:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-08-24 3:10 [RFC PATCH] perf: add SLANG_INC for slang.h Liang Li 2012-09-05 20:54 ` Arnaldo Carvalho de Melo 2012-09-05 21:23 ` Richard Purdie 2012-09-05 22:41 ` Arnaldo Carvalho de Melo 2012-09-06 2:11 ` Liang Li 2012-09-06 13:55 ` Arnaldo Carvalho de Melo
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.