All of lore.kernel.org
 help / color / mirror / Atom feed
* [Linux-v5.17-rc6] Building tools/perf with perl v5.34
@ 2022-03-05  7:52 Sedat Dilek
  2022-03-05  7:57 ` Sedat Dilek
  2022-03-05 20:09 ` Jiri Olsa
  0 siblings, 2 replies; 10+ messages in thread
From: Sedat Dilek @ 2022-03-05  7:52 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-perf-users, linux-kernel

Hi,

I am here on Debian/unstable AMD64 which switched over to perl v5.34
in February 2022.

Unfortunately, my perf does not build with this (lib)perl version:

$ ~/bin/perf -vv
perf version 5.17-rc6
                dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
   dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
        syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
               libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
               libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
              libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
              libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
            libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
             libslang: [ on  ]  # HAVE_SLANG_SUPPORT
            libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
            libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
   libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                 zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                 lzma: [ on  ]  # HAVE_LZMA_SUPPORT
            get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                  bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                  aio: [ on  ]  # HAVE_AIO_SUPPORT
                 zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
              libpfm4: [ OFF ]  # HAVE_LIBPFM

$ grep libperl ../make-log_perf-python3.10-install_bin.txt
9:Makefile.config:788: Missing perl devel files. Disabling perl
scripting support, please install perl-ExtUtils-Embed/libperl-dev
22:...                       libperl: [ OFF ]

Checking for these requirements:

# dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
$3}' | column -t
ii  libperl-dev:amd64  5.34.0-3
ii  libperl5.34:amd64  5.34.0-3
ii  perl               5.34.0-3
ii  perl-base          5.34.0-3
ii  perl-modules-5.34  5.34.0-3

# dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
/usr/share/perl/5.34.0/ExtUtils/Embed.pm

Can you please comment on this?

Thanks.

Regards,
- Sedat -

[1] https://unix.stackexchange.com/questions/167292/what-is-debian-equivalent-of-rpm-package-perl-extutils-embed

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-05  7:52 [Linux-v5.17-rc6] Building tools/perf with perl v5.34 Sedat Dilek
@ 2022-03-05  7:57 ` Sedat Dilek
  2022-03-05  8:26   ` Sedat Dilek
  2022-03-05 20:09 ` Jiri Olsa
  1 sibling, 1 reply; 10+ messages in thread
From: Sedat Dilek @ 2022-03-05  7:57 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-perf-users, linux-kernel

On Sat, Mar 5, 2022 at 8:52 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> Hi,
>
> I am here on Debian/unstable AMD64 which switched over to perl v5.34
> in February 2022.
>
> Unfortunately, my perf does not build with this (lib)perl version:
>
> $ ~/bin/perf -vv
> perf version 5.17-rc6
>                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
>    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
>                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
>         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
>                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
>                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
>               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
>               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
>             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
>              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
>             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
>             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
>    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
>                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
>                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
>             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
>                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
>                   aio: [ on  ]  # HAVE_AIO_SUPPORT
>                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
>               libpfm4: [ OFF ]  # HAVE_LIBPFM
>
> $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> 9:Makefile.config:788: Missing perl devel files. Disabling perl
> scripting support, please install perl-ExtUtils-Embed/libperl-dev
> 22:...                       libperl: [ OFF ]
>
> Checking for these requirements:
>
> # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> $3}' | column -t
> ii  libperl-dev:amd64  5.34.0-3
> ii  libperl5.34:amd64  5.34.0-3
> ii  perl               5.34.0-3
> ii  perl-base          5.34.0-3
> ii  perl-modules-5.34  5.34.0-3
>
> # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> /usr/share/perl/5.34.0/ExtUtils/Embed.pm
>
> Can you please comment on this?
>
> Thanks.
>
> Regards,
> - Sedat -
>
> [1] https://unix.stackexchange.com/questions/167292/what-is-debian-equivalent-of-rpm-package-perl-extutils-embed

My command-line:

cd /path/to/linux.git

$ make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld
HOSTAR=llvm-ar CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm
OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size
READELF=llvm-readelf STRIP=llvm-strip LLVM_IAS=1 -C tools/perf
PYTHON=python3.10 install-bin

I use the -gnu-std-11 patchset plus some own:

$ git log --oneline v5.17-rc6.. | grep 'std=gnu11'
05d8e9b88918 tools: libtraceevent: Use -std=gnu11
ee44279e6b01 tools: libsubcmd: Use -std=gnu11
411fa2d6da5c tools: libapi: Use -std=gnu11
3f0092b7e1b9 tools: perf: Use -std=gnu11
0cf56ddf2b41 tools: libbpf: Use -std=gnu11
96a4222bdd4c Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
6a7cc105b238 Kbuild: move to -std=gnu11

If this matters...

- Sedat -

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-05  7:57 ` Sedat Dilek
@ 2022-03-05  8:26   ` Sedat Dilek
  2022-03-05 11:11     ` Sedat Dilek
  0 siblings, 1 reply; 10+ messages in thread
From: Sedat Dilek @ 2022-03-05  8:26 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-perf-users, linux-kernel

On Sat, Mar 5, 2022 at 8:57 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Sat, Mar 5, 2022 at 8:52 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > Hi,
> >
> > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > in February 2022.
> >
> > Unfortunately, my perf does not build with this (lib)perl version:
> >
> > $ ~/bin/perf -vv
> > perf version 5.17-rc6
> >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> >
> > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > 22:...                       libperl: [ OFF ]
> >
> > Checking for these requirements:
> >
> > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > $3}' | column -t
> > ii  libperl-dev:amd64  5.34.0-3
> > ii  libperl5.34:amd64  5.34.0-3
> > ii  perl               5.34.0-3
> > ii  perl-base          5.34.0-3
> > ii  perl-modules-5.34  5.34.0-3
> >
> > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> >
> > Can you please comment on this?
> >
> > Thanks.
> >
> > Regards,
> > - Sedat -
> >
> > [1] https://unix.stackexchange.com/questions/167292/what-is-debian-equivalent-of-rpm-package-perl-extutils-embed
>
> My command-line:
>
> cd /path/to/linux.git
>
> $ make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld
> HOSTAR=llvm-ar CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm
> OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size
> READELF=llvm-readelf STRIP=llvm-strip LLVM_IAS=1 -C tools/perf
> PYTHON=python3.10 install-bin
>
> I use the -gnu-std-11 patchset plus some own:
>
> $ git log --oneline v5.17-rc6.. | grep 'std=gnu11'
> 05d8e9b88918 tools: libtraceevent: Use -std=gnu11
> ee44279e6b01 tools: libsubcmd: Use -std=gnu11
> 411fa2d6da5c tools: libapi: Use -std=gnu11
> 3f0092b7e1b9 tools: perf: Use -std=gnu11
> 0cf56ddf2b41 tools: libbpf: Use -std=gnu11
> 96a4222bdd4c Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
> 6a7cc105b238 Kbuild: move to -std=gnu11
>
> If this matters...
>

[ tools/perf/Makefile.config ]

ifdef NO_LIBPERL
  CFLAGS += -DNO_LIBPERL
else
  PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
  PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
  PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
  PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
  PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
  PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects,
$(PERL_EMBED_CCOPTS))
  PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
  FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)

  ifneq ($(feature-libperl), 1)
    CFLAGS += -DNO_LIBPERL
    NO_LIBPERL := 1
    msg := $(warning Missing perl devel files. Disabling perl
scripting support, please install perl-ExtUtils-Embed/libperl-dev);
  else
    LDFLAGS += $(PERL_EMBED_LDFLAGS)
    EXTLIBS += $(PERL_EMBED_LIBADD)
    CFLAGS += -DHAVE_LIBPERL_SUPPORT
    $(call detected,CONFIG_LIBPERL)
  endif
endif

$ perl -MExtUtils::Embed -e ldopts
-Wl,-E  -fstack-protector-strong -L/usr/local/lib
-L/usr/lib/x86_64-linux-gnu/perl/5.34/CORE -lperl -ldl -lm -lpthread
-lc -lcrypt

$ perl -MExtUtils::Embed -e ccopts
-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe
-I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/x86_64-linux-gnu/perl/5.34/CORE

- Sedat -

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-05  8:26   ` Sedat Dilek
@ 2022-03-05 11:11     ` Sedat Dilek
  0 siblings, 0 replies; 10+ messages in thread
From: Sedat Dilek @ 2022-03-05 11:11 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-perf-users, linux-kernel

On Sat, Mar 5, 2022 at 9:26 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Sat, Mar 5, 2022 at 8:57 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > On Sat, Mar 5, 2022 at 8:52 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> > >
> > > Hi,
> > >
> > > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > > in February 2022.
> > >
> > > Unfortunately, my perf does not build with this (lib)perl version:
> > >
> > > $ ~/bin/perf -vv
> > > perf version 5.17-rc6
> > >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> > >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> > >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> > >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> > >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> > >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> > >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> > >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> > >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> > >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> > >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> > >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> > >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> > >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> > >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> > >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> > >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> > >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> > >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> > >
> > > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > > 22:...                       libperl: [ OFF ]
> > >
> > > Checking for these requirements:
> > >
> > > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > > $3}' | column -t
> > > ii  libperl-dev:amd64  5.34.0-3
> > > ii  libperl5.34:amd64  5.34.0-3
> > > ii  perl               5.34.0-3
> > > ii  perl-base          5.34.0-3
> > > ii  perl-modules-5.34  5.34.0-3
> > >
> > > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> > >
> > > Can you please comment on this?
> > >
> > > Thanks.
> > >
> > > Regards,
> > > - Sedat -
> > >
> > > [1] https://unix.stackexchange.com/questions/167292/what-is-debian-equivalent-of-rpm-package-perl-extutils-embed
> >
> > My command-line:
> >
> > cd /path/to/linux.git
> >
> > $ make V=1 -j4 HOSTCC=clang HOSTCXX=clang++ HOSTLD=ld.lld
> > HOSTAR=llvm-ar CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm
> > OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump OBJSIZE=llvm-size
> > READELF=llvm-readelf STRIP=llvm-strip LLVM_IAS=1 -C tools/perf
> > PYTHON=python3.10 install-bin
> >
> > I use the -gnu-std-11 patchset plus some own:
> >
> > $ git log --oneline v5.17-rc6.. | grep 'std=gnu11'
> > 05d8e9b88918 tools: libtraceevent: Use -std=gnu11
> > ee44279e6b01 tools: libsubcmd: Use -std=gnu11
> > 411fa2d6da5c tools: libapi: Use -std=gnu11
> > 3f0092b7e1b9 tools: perf: Use -std=gnu11
> > 0cf56ddf2b41 tools: libbpf: Use -std=gnu11
> > 96a4222bdd4c Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
> > 6a7cc105b238 Kbuild: move to -std=gnu11
> >
> > If this matters...
> >
>
> [ tools/perf/Makefile.config ]
>
> ifdef NO_LIBPERL
>   CFLAGS += -DNO_LIBPERL
> else
>   PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
>   PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
>   PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
>   PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null)
>   PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS))
>   PERL_EMBED_CCOPTS := $(filter-out -flto=auto -ffat-lto-objects,
> $(PERL_EMBED_CCOPTS))
>   PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS))
>   FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
>
>   ifneq ($(feature-libperl), 1)
>     CFLAGS += -DNO_LIBPERL
>     NO_LIBPERL := 1
>     msg := $(warning Missing perl devel files. Disabling perl
> scripting support, please install perl-ExtUtils-Embed/libperl-dev);
>   else
>     LDFLAGS += $(PERL_EMBED_LDFLAGS)
>     EXTLIBS += $(PERL_EMBED_LIBADD)
>     CFLAGS += -DHAVE_LIBPERL_SUPPORT
>     $(call detected,CONFIG_LIBPERL)
>   endif
> endif
>
> $ perl -MExtUtils::Embed -e ldopts
> -Wl,-E  -fstack-protector-strong -L/usr/local/lib
> -L/usr/lib/x86_64-linux-gnu/perl/5.34/CORE -lperl -ldl -lm -lpthread
> -lc -lcrypt
>
> $ perl -MExtUtils::Embed -e ccopts
> -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe
> -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> -I/usr/lib/x86_64-linux-gnu/perl/5.34/CORE
>

Looks like an issue when using LLVM/Clang - distro or selfmade does not matter.
With GCC I can see libperl enabled.

- Sedat -

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-05  7:52 [Linux-v5.17-rc6] Building tools/perf with perl v5.34 Sedat Dilek
  2022-03-05  7:57 ` Sedat Dilek
@ 2022-03-05 20:09 ` Jiri Olsa
  2022-03-06  2:28   ` Sedat Dilek
  1 sibling, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2022-03-05 20:09 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel

On Sat, Mar 05, 2022 at 08:52:18AM +0100, Sedat Dilek wrote:
> Hi,
> 
> I am here on Debian/unstable AMD64 which switched over to perl v5.34
> in February 2022.
> 
> Unfortunately, my perf does not build with this (lib)perl version:
> 
> $ ~/bin/perf -vv
> perf version 5.17-rc6
>                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
>    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
>                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
>         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
>                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
>                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
>               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
>               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
>             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
>              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
>             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
>             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
>    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
>                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
>                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
>             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
>                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
>                   aio: [ on  ]  # HAVE_AIO_SUPPORT
>                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
>               libpfm4: [ OFF ]  # HAVE_LIBPFM
> 
> $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> 9:Makefile.config:788: Missing perl devel files. Disabling perl
> scripting support, please install perl-ExtUtils-Embed/libperl-dev
> 22:...                       libperl: [ OFF ]
> 
> Checking for these requirements:
> 
> # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> $3}' | column -t
> ii  libperl-dev:amd64  5.34.0-3
> ii  libperl5.34:amd64  5.34.0-3
> ii  perl               5.34.0-3
> ii  perl-base          5.34.0-3
> ii  perl-modules-5.34  5.34.0-3
> 
> # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> 
> Can you please comment on this?

hi,
is there something in tools/build/feature/test-libperl.make.output ?

jirka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-05 20:09 ` Jiri Olsa
@ 2022-03-06  2:28   ` Sedat Dilek
  2022-03-06  3:18     ` Sedat Dilek
  2022-03-06 15:42     ` Jiri Olsa
  0 siblings, 2 replies; 10+ messages in thread
From: Sedat Dilek @ 2022-03-06  2:28 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3008 bytes --]

On Sat, Mar 5, 2022 at 9:09 PM Jiri Olsa <olsajiri@gmail.com> wrote:
>
> On Sat, Mar 05, 2022 at 08:52:18AM +0100, Sedat Dilek wrote:
> > Hi,
> >
> > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > in February 2022.
> >
> > Unfortunately, my perf does not build with this (lib)perl version:
> >
> > $ ~/bin/perf -vv
> > perf version 5.17-rc6
> >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> >
> > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > 22:...                       libperl: [ OFF ]
> >
> > Checking for these requirements:
> >
> > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > $3}' | column -t
> > ii  libperl-dev:amd64  5.34.0-3
> > ii  libperl5.34:amd64  5.34.0-3
> > ii  perl               5.34.0-3
> > ii  perl-base          5.34.0-3
> > ii  perl-modules-5.34  5.34.0-3
> >
> > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> >
> > Can you please comment on this?
>
> hi,
> is there something in tools/build/feature/test-libperl.make.output ?
>

Hey jirka!

Indeed there is such a file.

$ LC_ALL=C ll tools/build/feature/test-libperl.make.output
-rw-r--r-- 1 dileks dileks 24K Mar  6 03:22
tools/build/feature/test-libperl.make.output

Reproducer:

make distclean
make -C tools/perf clean

MAKE="make"
MAKE_OPTS="HOSTCC=clang-13 HOSTCXX=clang++-13 HOSTLD=ld.lld-13
HOSTAR=llvm-ar-13 CC=clang-13 LD=ld.lld-13 AR=llvm-ar-13 NM=llvm-nm-13
OBJCOPY=llvm-objcopy-13 OBJDUMP=llvm-objdump-13 OBJSIZE=llvm-size-13
READELF=llvm-readelf-13 STRIP=llvm-strip-13 LLVM_IAS=1"

LC_ALL=C $MAKE V=1 $MAKE_OPTS -C tools/perf PYTHON=python3 install-bin

- Sedat -

[-- Attachment #2: test-libperl.make.output --]
[-- Type: application/octet-stream, Size: 24131 bytes --]

In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:150:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:150:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:150:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:150:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:151:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[1],0xaa6f908d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:151:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[1],0xaa6f908d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:151:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[1],0xaa6f908d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:151:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[1],0xaa6f908d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:152:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[2],0xcdf6b72d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:152:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[2],0xcdf6b72d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:152:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[2],0xcdf6b72d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:152:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[2],0xcdf6b72d);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:156:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 1/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:37: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                    ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:156:5: note: '{' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 1/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:48: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:156:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 1/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:124:32: note: expanded from macro 'ZAPHOD32_MIX'
    v2 = ROTR32(v2, 7) ^ v0;   \
                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:156:5: note: ')' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 1/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:125:3: note: expanded from macro 'ZAPHOD32_MIX'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:157:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 2/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:37: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                    ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:157:5: note: '{' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 2/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:48: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:157:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 2/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:124:32: note: expanded from macro 'ZAPHOD32_MIX'
    v2 = ROTR32(v2, 7) ^ v0;   \
                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:157:5: note: ')' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 2/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:125:3: note: expanded from macro 'ZAPHOD32_MIX'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:158:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 3/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:37: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                    ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:158:5: note: '{' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 3/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:48: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:158:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 3/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:124:32: note: expanded from macro 'ZAPHOD32_MIX'
    v2 = ROTR32(v2, 7) ^ v0;   \
                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:158:5: note: ')' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 3/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:125:3: note: expanded from macro 'ZAPHOD32_MIX'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:159:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 4/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:37: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                    ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:159:5: note: '{' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 4/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:116:48: note: expanded from macro 'ZAPHOD32_MIX'
#define ZAPHOD32_MIX(v0,v1,v2,text) STMT_START {                              \
                                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:159:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 4/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:124:32: note: expanded from macro 'ZAPHOD32_MIX'
    v2 = ROTR32(v2, 7) ^ v0;   \
                               ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:159:5: note: ')' token is here
    ZAPHOD32_MIX(state[0],state[1],state[2],"ZAPHOD32 SEED-STATE A 4/4");
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:125:3: note: expanded from macro 'ZAPHOD32_MIX'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:162:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0xc95d22a9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:162:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0xc95d22a9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:162:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0xc95d22a9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:162:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0xc95d22a9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:163:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[1],0x8497242b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:163:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[1],0x8497242b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:163:5: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[1],0x8497242b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:163:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[1],0x8497242b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:738:21: note: expanded from macro 'STMT_END'
#   define STMT_END     )
                        ^
In file included from test-libperl.c:3:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:4085:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv.h:659:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/hv_func.h:34:
In file included from /usr/lib/x86_64-linux-gnu/perl/5.34/CORE/sbox32_hash.h:4:
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:164:5: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[2],0x9c5cc4e9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:164:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[2],0x9c5cc4e9);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/lib/x86_64-linux-gnu/perl/5.34/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-06  2:28   ` Sedat Dilek
@ 2022-03-06  3:18     ` Sedat Dilek
  2022-03-06 15:42     ` Jiri Olsa
  1 sibling, 0 replies; 10+ messages in thread
From: Sedat Dilek @ 2022-03-06  3:18 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel

On Sun, Mar 6, 2022 at 3:28 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Sat, Mar 5, 2022 at 9:09 PM Jiri Olsa <olsajiri@gmail.com> wrote:
> >
> > On Sat, Mar 05, 2022 at 08:52:18AM +0100, Sedat Dilek wrote:
> > > Hi,
> > >
> > > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > > in February 2022.
> > >
> > > Unfortunately, my perf does not build with this (lib)perl version:
> > >
> > > $ ~/bin/perf -vv
> > > perf version 5.17-rc6
> > >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> > >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> > >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> > >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> > >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> > >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> > >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> > >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> > >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> > >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> > >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> > >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> > >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> > >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> > >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> > >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> > >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> > >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> > >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> > >
> > > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > > 22:...                       libperl: [ OFF ]
> > >
> > > Checking for these requirements:
> > >
> > > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > > $3}' | column -t
> > > ii  libperl-dev:amd64  5.34.0-3
> > > ii  libperl5.34:amd64  5.34.0-3
> > > ii  perl               5.34.0-3
> > > ii  perl-base          5.34.0-3
> > > ii  perl-modules-5.34  5.34.0-3
> > >
> > > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> > >
> > > Can you please comment on this?
> >
> > hi,
> > is there something in tools/build/feature/test-libperl.make.output ?
> >
>
> Hey jirka!
>
> Indeed there is such a file.
>
> $ LC_ALL=C ll tools/build/feature/test-libperl.make.output
> -rw-r--r-- 1 dileks dileks 24K Mar  6 03:22
> tools/build/feature/test-libperl.make.output
>
> Reproducer:
>
> make distclean
> make -C tools/perf clean
>
> MAKE="make"
> MAKE_OPTS="HOSTCC=clang-13 HOSTCXX=clang++-13 HOSTLD=ld.lld-13
> HOSTAR=llvm-ar-13 CC=clang-13 LD=ld.lld-13 AR=llvm-ar-13 NM=llvm-nm-13
> OBJCOPY=llvm-objcopy-13 OBJDUMP=llvm-objdump-13 OBJSIZE=llvm-size-13
> READELF=llvm-readelf-13 STRIP=llvm-strip-13 LLVM_IAS=1"
>
> LC_ALL=C $MAKE V=1 $MAKE_OPTS -C tools/perf PYTHON=python3 install-bin
>
> - Sedat -

With this diff:

$ git diff
diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 1480910c792e..ef9b37c5c652 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -81,7 +81,7 @@ PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config

all: $(FILES)

-__BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst
%.bin,%.c,$(@F)) $(LDFLAGS)
+__BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror
-Wno-compound-token-split-by-macro -o $@ $(patsubst %.bin,%.c,$(@F))
$(LDFLAGS)
  BUILD = $(__BUILD) > $(@:.bin=.make.output) 2>&1

__BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst
%.bin,%.cpp,$(@F)) $(LDFLAGS)
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 913bf509bd17..c3e5bcf5264a 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -213,7 +213,7 @@ endif

# Treat warnings as errors unless directed not to
ifneq ($(WERROR),0)
-  CORE_CFLAGS += -Werror
+  CORE_CFLAGS += -Werror -Wno-compound-token-split-by-macro
  CXXFLAGS += -Werror
  HOSTCFLAGS += -Werror
endif

I am able to build with libperl support:

$ ~/bin/perf -vv
perf version 5.17-rc6
                dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
   dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
                glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
        syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
               libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
               libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
              libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
              libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
            libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
             libslang: [ on  ]  # HAVE_SLANG_SUPPORT
            libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
            libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
   libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
                 zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                 lzma: [ on  ]  # HAVE_LZMA_SUPPORT
            get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                  bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                  aio: [ on  ]  # HAVE_AIO_SUPPORT
                 zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
              libpfm4: [ OFF ]  # HAVE_LIBPFM

Dunno if I need  "-Werror -Wno-compound-token-split-by-macro" for any
HOSTCXX/CXX flags.

- Sedat -

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-06  2:28   ` Sedat Dilek
  2022-03-06  3:18     ` Sedat Dilek
@ 2022-03-06 15:42     ` Jiri Olsa
  2022-03-06 16:00       ` Sedat Dilek
  1 sibling, 1 reply; 10+ messages in thread
From: Jiri Olsa @ 2022-03-06 15:42 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel

On Sun, Mar 06, 2022 at 03:28:09AM +0100, Sedat Dilek wrote:
> On Sat, Mar 5, 2022 at 9:09 PM Jiri Olsa <olsajiri@gmail.com> wrote:
> >
> > On Sat, Mar 05, 2022 at 08:52:18AM +0100, Sedat Dilek wrote:
> > > Hi,
> > >
> > > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > > in February 2022.
> > >
> > > Unfortunately, my perf does not build with this (lib)perl version:
> > >
> > > $ ~/bin/perf -vv
> > > perf version 5.17-rc6
> > >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> > >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> > >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> > >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> > >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> > >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> > >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> > >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> > >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> > >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> > >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> > >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> > >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> > >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> > >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> > >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> > >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> > >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> > >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> > >
> > > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > > 22:...                       libperl: [ OFF ]
> > >
> > > Checking for these requirements:
> > >
> > > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > > $3}' | column -t
> > > ii  libperl-dev:amd64  5.34.0-3
> > > ii  libperl5.34:amd64  5.34.0-3
> > > ii  perl               5.34.0-3
> > > ii  perl-base          5.34.0-3
> > > ii  perl-modules-5.34  5.34.0-3
> > >
> > > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> > >
> > > Can you please comment on this?
> >
> > hi,
> > is there something in tools/build/feature/test-libperl.make.output ?
> >
> 
> Hey jirka!
> 
> Indeed there is such a file.
> 
> $ LC_ALL=C ll tools/build/feature/test-libperl.make.output
> -rw-r--r-- 1 dileks dileks 24K Mar  6 03:22
> tools/build/feature/test-libperl.make.output
> 
> Reproducer:
> 
> make distclean
> make -C tools/perf clean
> 
> MAKE="make"
> MAKE_OPTS="HOSTCC=clang-13 HOSTCXX=clang++-13 HOSTLD=ld.lld-13
> HOSTAR=llvm-ar-13 CC=clang-13 LD=ld.lld-13 AR=llvm-ar-13 NM=llvm-nm-13
> OBJCOPY=llvm-objcopy-13 OBJDUMP=llvm-objdump-13 OBJSIZE=llvm-size-13
> READELF=llvm-readelf-13 STRIP=llvm-strip-13 LLVM_IAS=1"
> 
> LC_ALL=C $MAKE V=1 $MAKE_OPTS -C tools/perf PYTHON=python3 install-bin

yea, looks like we can't compile perl devel includes with clang,
we use simple perl test program:

	$ cd tools/build/feature/
	$ cat test-libperl.c 
	// SPDX-License-Identifier: GPL-2.0
	#include <EXTERN.h>
	#include <perl.h>

	int main(void)
	{
		perl_alloc();

		return 0;
	}


and if I compile it with:

	$ CC=clang make test-libperl.bin
	clang  -MD -Wall -Werror -o test-libperl.bin test-libperl.c  > test-libperl.make.output 2>&1 `perl -MExtUtils::Embed -e ccopts 2>/dev/null` -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm -lcrypt -lutil -lc
	make: *** [Makefile:224: test-libperl.bin] Error 1


I'm getting some other lto related error:

	$ cat test-libperl.make.output 
	clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]


with my clang version:

	$ clang --version
	clang version 13.0.0 (Fedora 13.0.0-3.fc35)
	Target: x86_64-redhat-linux-gnu
	Thread model: posix
	InstalledDir: /usr/bin

so you need to figure out how to compile the test program
above first with clang

jirka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-06 15:42     ` Jiri Olsa
@ 2022-03-06 16:00       ` Sedat Dilek
  2022-03-07 16:35         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 10+ messages in thread
From: Sedat Dilek @ 2022-03-06 16:00 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-perf-users, linux-kernel

On Sun, Mar 6, 2022 at 4:42 PM Jiri Olsa <olsajiri@gmail.com> wrote:
>
> On Sun, Mar 06, 2022 at 03:28:09AM +0100, Sedat Dilek wrote:
> > On Sat, Mar 5, 2022 at 9:09 PM Jiri Olsa <olsajiri@gmail.com> wrote:
> > >
> > > On Sat, Mar 05, 2022 at 08:52:18AM +0100, Sedat Dilek wrote:
> > > > Hi,
> > > >
> > > > I am here on Debian/unstable AMD64 which switched over to perl v5.34
> > > > in February 2022.
> > > >
> > > > Unfortunately, my perf does not build with this (lib)perl version:
> > > >
> > > > $ ~/bin/perf -vv
> > > > perf version 5.17-rc6
> > > >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> > > >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> > > >                 glibc: [ on  ]  # HAVE_GLIBC_SUPPORT
> > > >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> > > >                libbfd: [ on  ]  # HAVE_LIBBFD_SUPPORT
> > > >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> > > >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > > > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > > >               libperl: [ OFF ]  # HAVE_LIBPERL_SUPPORT
> > > >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> > > >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> > > >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> > > >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> > > >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> > > >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> > > >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> > > >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> > > >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> > > >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> > > >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> > > >               libpfm4: [ OFF ]  # HAVE_LIBPFM
> > > >
> > > > $ grep libperl ../make-log_perf-python3.10-install_bin.txt
> > > > 9:Makefile.config:788: Missing perl devel files. Disabling perl
> > > > scripting support, please install perl-ExtUtils-Embed/libperl-dev
> > > > 22:...                       libperl: [ OFF ]
> > > >
> > > > Checking for these requirements:
> > > >
> > > > # dpkg -l | grep perl | grep 5.34 | awk '/^ii/ {print $1 " " $2 " "
> > > > $3}' | column -t
> > > > ii  libperl-dev:amd64  5.34.0-3
> > > > ii  libperl5.34:amd64  5.34.0-3
> > > > ii  perl               5.34.0-3
> > > > ii  perl-base          5.34.0-3
> > > > ii  perl-modules-5.34  5.34.0-3
> > > >
> > > > # dpkg -L perl-modules-5.34 | grep -i ExtUtils | grep -i Embed
> > > > /usr/share/perl/5.34.0/ExtUtils/Embed.pm
> > > >
> > > > Can you please comment on this?
> > >
> > > hi,
> > > is there something in tools/build/feature/test-libperl.make.output ?
> > >
> >
> > Hey jirka!
> >
> > Indeed there is such a file.
> >
> > $ LC_ALL=C ll tools/build/feature/test-libperl.make.output
> > -rw-r--r-- 1 dileks dileks 24K Mar  6 03:22
> > tools/build/feature/test-libperl.make.output
> >
> > Reproducer:
> >
> > make distclean
> > make -C tools/perf clean
> >
> > MAKE="make"
> > MAKE_OPTS="HOSTCC=clang-13 HOSTCXX=clang++-13 HOSTLD=ld.lld-13
> > HOSTAR=llvm-ar-13 CC=clang-13 LD=ld.lld-13 AR=llvm-ar-13 NM=llvm-nm-13
> > OBJCOPY=llvm-objcopy-13 OBJDUMP=llvm-objdump-13 OBJSIZE=llvm-size-13
> > READELF=llvm-readelf-13 STRIP=llvm-strip-13 LLVM_IAS=1"
> >
> > LC_ALL=C $MAKE V=1 $MAKE_OPTS -C tools/perf PYTHON=python3 install-bin
>
> yea, looks like we can't compile perl devel includes with clang,
> we use simple perl test program:
>
>         $ cd tools/build/feature/
>         $ cat test-libperl.c
>         // SPDX-License-Identifier: GPL-2.0
>         #include <EXTERN.h>
>         #include <perl.h>
>
>         int main(void)
>         {
>                 perl_alloc();
>
>                 return 0;
>         }
>
>
> and if I compile it with:
>
>         $ CC=clang make test-libperl.bin
>         clang  -MD -Wall -Werror -o test-libperl.bin test-libperl.c  > test-libperl.make.output 2>&1 `perl -MExtUtils::Embed -e ccopts 2>/dev/null` -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -ldl -lm -lcrypt -lutil -lc
>         make: *** [Makefile:224: test-libperl.bin] Error 1
>
>
> I'm getting some other lto related error:
>
>         $ cat test-libperl.make.output
>         clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
>

Hehe.

I was thinking about syncing the flags for both feature test-perl and
perf/libperl-support.

tools/build/feature/Makefile
tools/perf/Makefile.config

So, I guess FLAGS_PERL_EMBED differs.

For building perf '-ffat-lto-objects'  is filtered-out...

$ git grep ffat-lto-objects tools/perf/
tools/perf/Makefile.config:  PERL_EMBED_CCOPTS := $(filter-out
-flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))

- Sedat -

>
> with my clang version:
>
>         $ clang --version
>         clang version 13.0.0 (Fedora 13.0.0-3.fc35)
>         Target: x86_64-redhat-linux-gnu
>         Thread model: posix
>         InstalledDir: /usr/bin
>
> so you need to figure out how to compile the test program
> above first with clang
>
> jirka

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-v5.17-rc6] Building tools/perf with perl v5.34
  2022-03-06 16:00       ` Sedat Dilek
@ 2022-03-07 16:35         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 10+ messages in thread
From: Arnaldo Carvalho de Melo @ 2022-03-07 16:35 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Jiri Olsa, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim, linux-perf-users,
	linux-kernel

Em Sun, Mar 06, 2022 at 05:00:22PM +0100, Sedat Dilek escreveu:
> On Sun, Mar 6, 2022 at 4:42 PM Jiri Olsa <olsajiri@gmail.com> wrote:
> > I'm getting some other lto related error:
> >
> >         $ cat test-libperl.make.output
> >         clang-13: error: optimization flag '-ffat-lto-objects' is not supported [-Werror,-Wignored-optimization-argument]
> >
 
> I was thinking about syncing the flags for both feature test-perl and
> perf/libperl-support.
 
> tools/build/feature/Makefile
> tools/perf/Makefile.config
 
> So, I guess FLAGS_PERL_EMBED differs.
 
> For building perf '-ffat-lto-objects'  is filtered-out...
 
> $ git grep ffat-lto-objects tools/perf/
> tools/perf/Makefile.config:  PERL_EMBED_CCOPTS := $(filter-out
> -flto=auto -ffat-lto-objects, $(PERL_EMBED_CCOPTS))

Right, with the patch below I can build with clang 13. It would be nice
to have this defined into just one place, but for now, for 5.17 the
minimal fix is preferred, can you send a proper patch, s-o-b, etc?

- Arnaldo

diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
index 1480910c792e2cb3..869073cf84493083 100644
--- a/tools/build/feature/Makefile
+++ b/tools/build/feature/Makefile
@@ -218,6 +218,7 @@ PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null)
 PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS))
 PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS))
 PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null`
+PERL_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PERL_EMBED_CCOPTS))
 FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS)
 
 $(OUTPUT)test-libperl.bin:

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-03-07 16:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-05  7:52 [Linux-v5.17-rc6] Building tools/perf with perl v5.34 Sedat Dilek
2022-03-05  7:57 ` Sedat Dilek
2022-03-05  8:26   ` Sedat Dilek
2022-03-05 11:11     ` Sedat Dilek
2022-03-05 20:09 ` Jiri Olsa
2022-03-06  2:28   ` Sedat Dilek
2022-03-06  3:18     ` Sedat Dilek
2022-03-06 15:42     ` Jiri Olsa
2022-03-06 16:00       ` Sedat Dilek
2022-03-07 16:35         ` 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.