Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3331822imu; Sun, 11 Nov 2018 12:33:09 -0800 (PST) X-Google-Smtp-Source: AJdET5fDtIqFmt4jSc+kufxAC/ZlqZQ3PkWVOXx9p3OjiMIaTFf1Y+Q8aFPUTR0yyeO4rfjnkfLE X-Received: by 2002:a17:902:846:: with SMTP id 64-v6mr13544072plk.70.1541968389376; Sun, 11 Nov 2018 12:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541968389; cv=none; d=google.com; s=arc-20160816; b=iJ5/gdz22Blt8O15EDuEzwWSOIJqyMafYSneaqGb+wqqteJVz4Gft+RMbGJfo6a93v oIbrAmpEx2zaueSbmRtq2EECrebNEIuucrgwpRtJCf5cdAVWx+23I1eqXTXhIYdMPng6 WmUStOqjss/1fNFuXIg4O422vEg7rEUpUDPWPPJEc6rAmsO/vC7D+y6xKyvVWNszLvCb VgdSz81LoSXekiiezrjRm0ooeX05MmlTgZOtAqVUvG0wONH8u4ZPLftIDgC5WqBkH9tp dKyvVNwk3kYklpAcdfhXCXp84bnIDD6CZ8CGpFAz0yjDkWRRWnTH5kI+dOpwh5J1nk6Y GzfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=hB3scNZuz4yoomp4njyli0q5I2n1DKnoTIp53ll179s=; b=gB4GdaqV1XxokAOtpqhDHRDjm1ZeiA4UAsP6A4KtS63YgPZmNOJEeL/ZuM2qeo+y9o rbfyov+oDIDMBTUO46OkB2m7s04QSD9gRVXLSHdmsZc+T2yxnXeZ6gXk0L7fWYBuU9JE FFfSfHiEdk4vVuf0ipUadzAdOFWmrSRnt/IldeEBpobQKKn6PMAlwT3+svA+k9yZhG2y IhGKwJrxNo/CJCjRVCRMPcS43SI4xMFQU7bAcB8UwvZ/I/DA9p0qF8fJrDG8fVJo5cUf uqDq7yVvnVytPJqjljGgJ0e+m00m+k4BjY6wHBunuMyNF9Yce6Jet/3j6VTA8dbJZhTL R+Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59-v6si4287864plb.75.2018.11.11.12.32.54; Sun, 11 Nov 2018 12:33:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730470AbeKLGWB (ORCPT + 99 others); Mon, 12 Nov 2018 01:22:01 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:50198 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730292AbeKLFsR (ORCPT ); Mon, 12 Nov 2018 00:48:17 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsd-0000oG-Td; Sun, 11 Nov 2018 19:58:47 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsb-0001ty-1X; Sun, 11 Nov 2018 19:58:45 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Namhyung Kim" , "Peter Zijlstra" , "Jiri Olsa" , "David Ahern" , "Arnaldo Carvalho de Melo" , "Alexander Shishkin" , "Josh Poimboeuf" , "Sergey Senozhatsky" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 366/366] perf tools: Fix python extension build for gcc 8 In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jiri Olsa commit b7a313d84e853049062011d78cb04b6decd12f5c upstream. The gcc 8 compiler won't compile the python extension code with the following errors (one example): python.c:830:15: error: cast between incompatible function types from \ ‘PyObject * (*)(struct pyrf_evsel *, PyObject *, PyObject *)’ \ uct _object * (*)(struct pyrf_evsel *, struct _object *, struct _object *)’} to \ ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _objeuct \ _object *)’} [-Werror=cast-function-type] .ml_meth = (PyCFunction)pyrf_evsel__open, The problem with the PyMethodDef::ml_meth callback is that its type is determined based on the PyMethodDef::ml_flags value, which we set as METH_VARARGS | METH_KEYWORDS. That indicates that the callback is expecting an extra PyObject* arg, and is actually PyCFunctionWithKeywords type, but the base PyMethodDef::ml_meth type stays PyCFunction. Previous gccs did not find this, gcc8 now does. Fixing this by silencing this warning for python.c build. Commiter notes: Do not do that for CC=clang, as it breaks the build in some clang versions, like the ones in fedora up to fedora27: fedora:25:error: unknown warning option '-Wno-cast-function-type'; did you mean '-Wno-bad-function-cast'? [-Werror,-Wunknown-warning-option] fedora:26:error: unknown warning option '-Wno-cast-function-type'; did you mean '-Wno-bad-function-cast'? [-Werror,-Wunknown-warning-option] fedora:27:error: unknown warning option '-Wno-cast-function-type'; did you mean '-Wno-bad-function-cast'? [-Werror,-Wunknown-warning-option] # those have: clang version 3.9.1 (tags/RELEASE_391/final) The one in rawhide accepts that: clang version 6.0.0 (tags/RELEASE_600/final) Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: David Ahern Cc: Josh Poimboeuf Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Sergey Senozhatsky Link: http://lkml.kernel.org/r/20180319082902.4518-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Ben Hutchings --- tools/perf/util/setup.py | 2 ++ 1 file changed, 2 insertions(+) --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -21,6 +21,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 += ['-Wno-cast-function-type' ] build_lib = getenv('PYTHON_EXTBUILD_LIB') build_tmp = getenv('PYTHON_EXTBUILD_TMP')