Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4579164ybb; Tue, 14 Apr 2020 10:00:23 -0700 (PDT) X-Google-Smtp-Source: APiQypL7rv07iV/Y3WgqJJZwZAV2okb4zyt6dZQUF/4iESkPWAJus0ybKvzFb0zDUExhnFsImQtt X-Received: by 2002:a17:906:7f13:: with SMTP id d19mr1076865ejr.57.1586883623452; Tue, 14 Apr 2020 10:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586883623; cv=none; d=google.com; s=arc-20160816; b=D8zPyxRn+bxl+0aS2BzNvJ5CVL4lCM0PRLvQqVn5Q6yCoEm/GwF5D5f1pnq1+lA6IX EmmCf+nYfaZD0E1//aquS/yzbhTsdxjPDhSo/XDPbmRkk7ZK23Gytp/a1QPd8VvtLDOk 4ziAQuNeG77MK102sKNlZCMTgRIGTlRxrT/n6sA5GCsxk9nqP3LIAnnqifGVq5WqhqR2 o/sXZvsXz4ndEws94rr0LV06/dInNS1Ke2A6ky82M4iZQ+lyAg1ix9N8BKhD60o2aEKu h808yHuwXGWw6P/IV8McL9RnFbW5/vM1ApsltUwj90V8aKB5da93tdnoJKXX7+BtspmD wKew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uAXdBOzp0eXtKXMmpapqk+b6OipVFifShe/BlKnAM3g=; b=l+LcaoOu/Iir2zE9pSAm5ww43mX3otMT1PUJT6XlN+fIzQKdlxgh4vGWU7JXr9szYA UwxUFEES8fHtVOBKOMLT2mrafSdZwJpwjgHYMXH0/0KP+KvnHjBZLxBZyiyIJa4U400c OwEanjCajmwjrNqWkomZqAAH6XbPUuPembkDdZGKMbgLDS6IoMvnmsYxn6mPoi3Yo65w ztalhEqOSXXNiqbP+nN9NDh8xVLwOAuM+GLp8P1zF+DDi+SmCcjxRx2ElJ7YQnIelAD4 eI0cBzPiV98w9E0PSj1N6Kt9HvBkCNT19GUo9abh5tc9IBuAWMtOfFS5ZaEcciSDF6jK 8X3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Jr/WHtig"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si9723652edh.59.2020.04.14.09.59.58; Tue, 14 Apr 2020 10:00:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Jr/WHtig"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440206AbgDNQwv (ORCPT + 99 others); Tue, 14 Apr 2020 12:52:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:55224 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440380AbgDNQtT (ORCPT ); Tue, 14 Apr 2020 12:49:19 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 942EE21D93; Tue, 14 Apr 2020 16:49:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586882946; bh=xeWLJ5bbYzC5ofnPbd+yDJyUexrL+I58u1pgHQo6oLk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jr/WHtigLKQ2M4yeId7djpC0RlVTYb3LKJd+UlGAdgtmIBkA6JqJU6xZBnWM68ApB ZRPncgx2wyEFCxG7J7lOYYDqQjnXWwM0dRAQKwuKOYuIONS3kcaFVrCcM9xAV5U6vV zu0uB/6IVVl988v0e/pybeekMRNKgxYYIpXmQDKQ= From: Arnaldo Carvalho de Melo To: Ingo Molnar , Thomas Gleixner Cc: Jiri Olsa , Namhyung Kim , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter Subject: [PATCH 02/15] perf python: Check if clang supports -fno-semantic-interposition Date: Tue, 14 Apr 2020 13:48:41 -0300 Message-Id: <20200414164854.26026-3-acme@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200414164854.26026-1-acme@kernel.org> References: <20200414164854.26026-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo The set of C compiler options used by distros to build python bindings may include options that are unknown to clang, we check for a variety of such options, add -fno-semantic-interposition to that mix: This fixes the build on, among others, Manjaro Linux: GEN /tmp/build/perf/python/perf.so clang-9: error: unknown argument: '-fno-semantic-interposition' error: command 'clang' failed with exit status 1 make: Leaving directory '/git/perf/tools/perf' [perfbuilder@602aed1c266d ~]$ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-pkgversion='Arch Linux 9.3.0-1' --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --enable-shared --enable-threads=posix --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp --enable-cet=auto gdc_include_dir=/usr/include/dlang/gdc Thread model: posix gcc version 9.3.0 (Arch Linux 9.3.0-1) [perfbuilder@602aed1c266d ~]$ Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py index 347b2c0789e4..c5e3e9a68162 100644 --- a/tools/perf/util/setup.py +++ b/tools/perf/util/setup.py @@ -21,6 +21,8 @@ if cc_is_clang: vars[var] = sub("-fstack-clash-protection", "", vars[var]) if not clang_has_option("-fstack-protector-strong"): vars[var] = sub("-fstack-protector-strong", "", vars[var]) + if not clang_has_option("-fno-semantic-interposition"): + vars[var] = sub("-fno-semantic-interposition", "", vars[var]) from distutils.core import setup, Extension -- 2.21.1