linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Thiago Macieira <thiago.macieira@intel.com>,
	Wang Nan <wangnan0@huawei.com>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH AUTOSEL 4.18 06/27] perf python: Use -Wno-redundant-decls to build with PYTHON=python3
Date: Mon, 22 Oct 2018 06:19:03 -0400	[thread overview]
Message-ID: <20181022101924.40531-6-sashal@kernel.org> (raw)
In-Reply-To: <20181022101924.40531-1-sashal@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

[ Upstream commit 05a2f54679861deb188750ba2a70187000b2c71f ]

When building in ClearLinux using 'make PYTHON=python3' with gcc 8.2.1
it fails with:

    GEN      /tmp/build/perf/python/perf.so
  In file included from /usr/include/python3.7m/Python.h:126,
                   from /git/linux/tools/perf/util/python.c:2:
  /usr/include/python3.7m/import.h:58:24: error: redundant redeclaration of ‘_PyImport_AddModuleObject’ [-Werror=redundant-decls]
   PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *, PyObject *);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/python3.7m/import.h:47:24: note: previous declaration of ‘_PyImport_AddModuleObject’ was here
   PyAPI_FUNC(PyObject *) _PyImport_AddModuleObject(PyObject *name,
                          ^~~~~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors
  error: command 'gcc' failed with exit status 1

And indeed there is a redundant declaration in that Python.h file, one
with parameter names and the other without, so just add
-Wno-error=redundant-decls to the python setup instructions.

Now perf builds with gcc in ClearLinux with the following Dockerfile:

  # docker.io/acmel/linux-perf-tools-build-clearlinux:latest
  FROM docker.io/clearlinux:latest
  MAINTAINER Arnaldo Carvalho de Melo <acme@kernel.org>
  RUN swupd update && \
      swupd bundle-add sysadmin-basic-dev
  RUN mkdir -m 777 -p /git /tmp/build/perf /tmp/build/objtool /tmp/build/linux && \
      groupadd -r perfbuilder && \
      useradd -m -r -g perfbuilder perfbuilder && \
      chown -R perfbuilder.perfbuilder /tmp/build/ /git/
  USER perfbuilder
  COPY rx_and_build.sh /
  ENV EXTRA_MAKE_ARGS=PYTHON=python3
  ENTRYPOINT ["/rx_and_build.sh"]

Now to figure out why the build fails with clang, that is present in the
above container as detected by the rx_and_build.sh script:

  clang version 6.0.1 (tags/RELEASE_601/final)
  Target: x86_64-unknown-linux-gnu
  Thread model: posix
  InstalledDir: /usr/sbin
  make: Entering directory '/git/linux/tools/perf'
    BUILD:   Doing 'make -j4' parallel build
    HOSTCC   /tmp/build/perf/fixdep.o
    HOSTLD   /tmp/build/perf/fixdep-in.o
    LINK     /tmp/build/perf/fixdep

  Auto-detecting system features:
  ...                         dwarf: [ OFF ]
  ...            dwarf_getlocations: [ OFF ]
  ...                         glibc: [ OFF ]
  ...                          gtk2: [ OFF ]
  ...                      libaudit: [ OFF ]
  ...                        libbfd: [ OFF ]
  ...                        libelf: [ OFF ]
  ...                       libnuma: [ OFF ]
  ...        numa_num_possible_cpus: [ OFF ]
  ...                       libperl: [ OFF ]
  ...                     libpython: [ OFF ]
  ...                      libslang: [ OFF ]
  ...                     libcrypto: [ OFF ]
  ...                     libunwind: [ OFF ]
  ...            libdw-dwarf-unwind: [ OFF ]
  ...                          zlib: [ OFF ]
  ...                          lzma: [ OFF ]
  ...                     get_cpuid: [ OFF ]
  ...                           bpf: [ OFF ]

  Makefile.config:331: *** No gnu/libc-version.h found, please install glibc-dev[el].  Stop.
  make[1]: *** [Makefile.perf:206: sub-make] Error 2
  make: *** [Makefile:70: all] Error 2
  make: Leaving directory '/git/linux/tools/perf'

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thiago Macieira <thiago.macieira@intel.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-c3khb9ac86s00qxzjrueomme@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/perf/util/setup.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 001be4f9d3b9..a5f9e236cc71 100644
--- a/tools/perf/util/setup.py
+++ b/tools/perf/util/setup.py
@@ -27,7 +27,7 @@ class install_lib(_install_lib):
 
 cflags = getenv('CFLAGS', '').split()
 # switch off several checks (need to be at the end of cflags list)
-cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter' ]
+cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
 if cc != "clang":
     cflags += ['-Wno-cast-function-type' ]
 
-- 
2.17.1


  parent reply	other threads:[~2018-10-22 10:19 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-22 10:18 [PATCH AUTOSEL 4.18 01/27] ARM: dts: imx53-qsb: disable 1.2GHz OPP Sasha Levin
2018-10-22 10:18 ` [PATCH AUTOSEL 4.18 02/27] s390/hibernate: fix error handling when suspend cpu != resume cpu Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 03/27] perf report: Don't try to map ip to invalid map Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 04/27] Input: i8042 - enable keyboard wakeups by default when s2idle is used Sasha Levin
2018-10-22 16:58   ` Dmitry Torokhov
2018-10-23 15:48     ` Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 05/27] Input: mousedev - add a schedule point in mousedev_write() Sasha Levin
2018-10-22 10:19 ` Sasha Levin [this message]
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 07/27] perf record: Use unmapped IP for inline callchain cursors Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 08/27] Input: evdev - add a schedule point in evdev_write() Sasha Levin
2018-10-22 17:02   ` Dmitry Torokhov
2018-10-23 15:49     ` Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 09/27] Input: uinput - add a schedule point in uinput_inject_events() Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 10/27] rxrpc: Don't check RXRPC_CALL_TX_LAST after calling rxrpc_rotate_tx_window() Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 11/27] rxrpc: Carry call state out of locked section in rxrpc_rotate_tx_window() Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 12/27] rxrpc: Only take the rwind and mtu values from latest ACK Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 13/27] rxrpc: Fix connection-level abort handling Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 14/27] KVM: x86: support CONFIG_KVM_AMD=y with CONFIG_CRYPTO_DEV_CCP_DD=m Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 15/27] net: ena: fix warning in rmmod caused by double iounmap Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 16/27] net: ena: fix rare bug when failed restart/resume is followed by driver removal Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 17/27] net: ena: fix NULL dereference due to untimely napi initialization Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 18/27] libertas: call into generic suspend code before turning off power Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 19/27] gpio: Assign gpio_irq_chip::parents to non-stack pointer Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 20/27] IB/mlx5: Unmap DMA addr from HCA before IOMMU Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 21/27] rds: RDS (tcp) hangs on sendto() to unresponding address Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 22/27] selftests: rtnetlink.sh explicitly requires bash Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 23/27] selftests: udpgso_bench.sh " Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 24/27] vmlinux.lds.h: Fix incomplete .text.exit discards Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 25/27] vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 26/27] afs: Fix cell proc list Sasha Levin
2018-10-22 10:19 ` [PATCH AUTOSEL 4.18 27/27] fs/fat/fatent.c: add cond_resched() to fat_count_free_clusters() Sasha Levin

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=20181022101924.40531-6-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=dsahern@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thiago.macieira@intel.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).