From patchwork Fri Aug 9 23:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Seiderer X-Patchwork-Id: 11088117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1CA313AC for ; Fri, 9 Aug 2019 23:28:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F196205FD for ; Fri, 9 Aug 2019 23:28:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 839CE212D8; Fri, 9 Aug 2019 23:28:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EEEBA205FD for ; Fri, 9 Aug 2019 23:28:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 84D7A6EF33; Fri, 9 Aug 2019 23:28:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id F30D56EF2F for ; Fri, 9 Aug 2019 23:28:23 +0000 (UTC) X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([188.99.127.234]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M3MAG-1iE2Cq0n8C-00r3nu for ; Sat, 10 Aug 2019 01:28:20 +0200 From: Peter Seiderer To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v2] meson.build: fix intel atomics detection Date: Sat, 10 Aug 2019 01:28:18 +0200 Message-Id: <20190809232819.22493-1-ps.report@gmx.net> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:19bv2Z1SzHazKKrSdQLq9O5SD6yK3okn8g9Gx0N5FxwZEUWvgas OeuLm3Rd/dPLAft1l0czBCiWBmoiDlsUxgdKLEz4A9VkV84ehVDRxSgI0aWepEakHmYD8Jp vya8rZYyvV3SzZvuk4ynBOljZaU9JVUGGkuOLHXkG5OKFCqSau/pozLq9nk4iwMMAzd/TOr jQpqRkh98UaRfT1jk0lsQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:VnCGO3YYiP0=:Le00RrwveIhrfo00RVSlFO f8tm0qaWlTooAySX3a7BRnaT0uSu2znqQsPTE5ryK8sgbKTvwQmsBcFSR1jRsZDV2IK6u2Mho n00w2gUjfVoOZlVfBzaIiw5ebEPS40GSCcQNV+hekB3ufGFn7fcrrlJxhN0aZmB7SN1zWvW3V Y7/6o8rrgGGnCmOcUV+bS5bLUCW3vdhMS8/tkac9JVQva3y2jzsLTbfyM3Sk+gj0MdWdHQ8QB vykN+s9llA2F8dsdUMNsRBr6xw/Ymj2mSFo3XZWrCm36kzNS6bDXRuyGiCmg7z3E8uxqcuWL8 MZmjLDO2duyKdEdGxWD0WK+/DmwpE19biM6wyLCZv+vuak9+Xj6w07Ico8dJAFJAavjtPidvt ut1qJhUSKpb4UGmTW8KUbMybroyvaNaJElgwRUmkelqdsyF8TN/4CeNjvHBh6TGpBQSLebhuq KFL+/nTxqVTIrQDhm0G7H5J3+8JFQOtqM/+MKh3AJ/cryNcXB3gSAg2cOvrVXpunmQZqHeTAH h+AZjB6+lFhehi7Kk1shx9d7RNc+iz1MgSjM1qh+xB6Wg19B3IewXGynCf4BBzsF/7EK99B+4 RovhJCU98BUXQIo2+k/XDGApngkiNAPZxtwxYbjHNxbe9mN+aBRtX+GRvYZPM537v0lVmAasK dOfMXiM0shIzxAcE6VDvvoz1guH1ONvllOB5Tq1nrlk30bt2+DFRF83F5aBjXtx3bIzFYfxGI oFeQ5iyNTRbLUrP99NeTYNKP886mQRUE1JGqRAxEvC3LjDx+2aJ8KbMOkA/SNWZAux4mEsoby bgqc/t4QF3OUN1+28UlbqDhiR8v5MdRXeBTvcO2561jBt3FkwmYawuwOeXVnMJGh2QM86b0Gz XN1PPMdFZ9Ig+tk7OP+tdeXztx+aVuHzHo1YLMSrzdlsdfWXNTFTgmmr+MGd/NtAcMIz6OMXq XOyw6aGKKilMMmp1UNxnvvUwga1XKxIEZNQxCUBaMvqlcYGa3w2SlP7bgIdGO1e5Ulaa+UYPo hvh/mdI+J2CkIWvzy/0H62iCURqXi+4yILjH9BaNiMukBWsaWd0MZGVwaOizFjCAzFyxEv2LL JLQ1IxR4ATw/zfqovCnQU7mAItx0zwUragiFb/YafxTARy9yORstg3a8A== X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1565393300; bh=PzSrYOZzN22g4TdjgEyhxj+qlFWLojhioLITmWvVGyE=; h=X-UI-Sender-Class:From:To:Subject:Date; b=WGo0XnKB32VbwDGsjaxZFOV3QSGufdc/Z2vZkn6/SS7d9rWdaCohX5Slz7FGY1pOi tuNWu9uq6HMMYFqg8lNU9kHaF++ct8LWWVU6/VvqbbbvHRFR33VXYq44eRRoNOnct1 vKBFmkuUGWMx2fqXK9T1iXxYio4dgbhZ6uyRKZRY= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the stronger compiler.link() test (instead of the weaker compiler.compile()) to fix the intel atomics detection. Fixes false positive in case of sparc compile (buildroot toolchain). Signed-off-by: Peter Seiderer --- Changes v1 -> v2: - no changes, resend (old submission [1]) [1] https://lists.freedesktop.org/archives/dri-devel/2018-July/183885.html --- meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.22.0 diff --git a/meson.build b/meson.build index e292554..087780b 100644 --- a/meson.build +++ b/meson.build @@ -49,9 +49,10 @@ intel_atomics = false lib_atomics = false dep_atomic_ops = dependency('atomic_ops', required : false) -if cc.compiles(''' +if cc.links(''' int atomic_add(int *i) { return __sync_add_and_fetch (i, 1); } int atomic_cmpxchg(int *i, int j, int k) { return __sync_val_compare_and_swap (i, j, k); } + int main() { } ''', name : 'Intel Atomics') intel_atomics = true