public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Petri Gynther <pgynther@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
Date: Fri, 4 Sep 2015 19:48:52 -0300	[thread overview]
Message-ID: <20150904224852.GD3475@kernel.org> (raw)
In-Reply-To: <CAGXr9JE4pcod6WsKQpHOD5jU+U0KmZH+aibyqs1P11Fm5ZvFuA@mail.gmail.com>

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> This commit breaks the perf tool MIPS build because MIPS doesn't have
> CONFIG_PERF_REGS=y in .config-detected:
> 
> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> Author: Stephane Eranian <eranian@google.com>
> Date:   Mon Aug 31 18:41:12 2015 +0200
> 
>     perf record: Add ability to name registers to record

There was a fix for another arch that came after this one.. here it is, already
upstream, can you take a look?

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
Author: Stephane Eranian <eranian@google.com>
Date:   Tue Sep 1 11:30:14 2015 +0200

    perf tools: Fix link time error with sample_reg_masks on non x86
    
    This patch makes perf compile on non x86 platforms by defining a weak
    symbol for sample_reg_masks[] in util/perf_regs.c.
    
    The patch also moves the REG() and REG_END() macros into the
    util/per_regs.h header file. The macros are renamed to
    SMPL_REG/SMPL_REG_END to avoid clashes with other header files.

 
> On Fri, Sep 4, 2015 at 3:19 PM, Petri Gynther <pgynther@google.com> wrote:
> > I see that this patch is now in upstream. However, something else has
> > now broken the perf tool MIPS build:
> >
> > linux/tools$ git describe
> > v4.2-7656-g51e771c
> >
> > linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> > mkdir -p  .
> > make --no-print-directory -C perf O= subdir=
> >   BUILD:   Doing 'make -j12' parallel build
> >
> > Auto-detecting system features:
> > ...                         dwarf: [ OFF ]
> > ...                         glibc: [ on  ]
> > ...                          gtk2: [ OFF ]
> > ...                      libaudit: [ OFF ]
> > ...                        libbfd: [ OFF ]
> > ...                        libelf: [ OFF ]
> > ...                       libnuma: [ OFF ]
> > ...                       libperl: [ OFF ]
> > ...                     libpython: [ OFF ]
> > ...                      libslang: [ OFF ]
> > ...                     libunwind: [ OFF ]
> > ...            libdw-dwarf-unwind: [ OFF ]
> > ...                          zlib: [ OFF ]
> > ...                          lzma: [ OFF ]
> >
> > ...
> >
> >   AR       libperf.a
> >   LINK     perf
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f5b4): undefined reference to `sample_reg_masks'
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f604): undefined reference to `sample_reg_masks'
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f708): undefined reference to `sample_reg_masks'
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [perf] Error 1
> > make[1]: *** [all] Error 2
> > make: *** [perf] Error 2
> >
> > On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
> >> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> >> ...
> >> config/Makefile:256: *** No gnu/libc-version.h found, please install
> >> glibc-dev[el].  Stop.
> >> make[1]: *** [all] Error 2
> >> make: *** [perf] Error 2
> >>
> >> ...
> >> In file included from builtin-sched.c:13:0:
> >> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
> >>  [-Werror=redundant-decls]
> >>  extern int sched_getcpu(void) __THROW;
> >>
> >> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
> >>  note: previous declaration of ‘sched_getcpu’ was here
> >>  extern int sched_getcpu (void) __THROW;
> >>
> >> uclibc info:
> >> sysroot/usr/include/bits/uClibc_config.h
> >> __UCLIBC_MAJOR__ 0
> >> __UCLIBC_MINOR__ 9
> >> __UCLIBC_SUBLEVEL__ 33
> >>
> >> sysroot/usr/include/features.h
> >> __UCLIBC__ 1
> >> __GLIBC__ 2
> >> __GLIBC_MINOR__ 2
> >>
> >> Signed-off-by: Petri Gynther <pgynther@google.com>
> >> ---
> >>  tools/build/feature/test-glibc.c | 11 +++++++++++
> >>  tools/perf/util/cloexec.h        |  2 +-
> >>  2 files changed, 12 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
> >> index b082034..9367f75 100644
> >> --- a/tools/build/feature/test-glibc.c
> >> +++ b/tools/build/feature/test-glibc.c
> >> @@ -1,8 +1,19 @@
> >> +#include <stdlib.h>
> >> +
> >> +#if !defined(__UCLIBC__)
> >>  #include <gnu/libc-version.h>
> >> +#else
> >> +#define XSTR(s) STR(s)
> >> +#define STR(s) #s
> >> +#endif
> >>
> >>  int main(void)
> >>  {
> >> +#if !defined(__UCLIBC__)
> >>         const char *version = gnu_get_libc_version();
> >> +#else
> >> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
> >> +#endif
> >>
> >>         return (long)version;
> >>  }
> >> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
> >> index 68888c2..3bee677 100644
> >> --- a/tools/perf/util/cloexec.h
> >> +++ b/tools/perf/util/cloexec.h
> >> @@ -4,7 +4,7 @@
> >>  unsigned long perf_event_open_cloexec_flag(void);
> >>
> >>  #ifdef __GLIBC_PREREQ
> >> -#if !__GLIBC_PREREQ(2, 6)
> >> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
> >>  extern int sched_getcpu(void) __THROW;
> >>  #endif
> >>  #endif
> >> --
> >> 2.5.0.rc2.392.g76e840b
> >>

  reply	other threads:[~2015-09-04 22:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  0:38 [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler Petri Gynther
2015-08-06  7:04 ` [tip:perf/core] " tip-bot for Petri Gynther
2015-09-04 22:19 ` [PATCH] " Petri Gynther
2015-09-04 22:45   ` Petri Gynther
2015-09-04 22:48     ` Arnaldo Carvalho de Melo [this message]
2015-09-04 23:01       ` Petri Gynther
2015-09-04 23:04         ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2015-09-21 16:29 Alexey Brodkin
2015-09-21 21:06 ` Aaro Koskinen
2015-10-04 13:53   ` Alexey Brodkin
2015-10-05 21:59     ` Petri Gynther
2015-10-07 18:58       ` Alexey Brodkin
2015-10-14 21:52         ` Petri Gynther

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=20150904224852.GD3475@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pgynther@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