From patchwork Fri Dec 12 15:11:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42189 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C515426C99 for ; Fri, 12 Dec 2014 15:11:57 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf5060626lab.1 for ; Fri, 12 Dec 2014 07:11:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:subject :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=oEdu5gI7MvurPogVGoAZIxrTl0YIdvn1usbPW/qJZ+E=; b=cAWoEITUi0gXq03RVYyJQSj8uWjpJzzhYYneC3Xdhba+0/TISE8Jt8E12pudMt53M4 S2VMoqFQfU1uyu5Y8N5Vl9XbZhB7JbM7N/zBGhFqENyfNvD1/fHDvFlYSG+LJqddJdpW DUbirG/UKRboTqONCh8pp+/PXuGxtbSZZK2DL9x45+lHTmT6wqhXoDcmeCUyyd530bZF /Vfx19ef0lPEKxNAhOyZ3Bzo/Hlo6xylT/UlZJ0qEcq0sK/H19DpVoeRqNlMoKWNAe7K wU8MzmiJgYwIiGvVV26f9l2aHQrpkxoBfhnjqHafoW9yOnsNVohT+vD+slqZI4lK4fLQ zImA== X-Gm-Message-State: ALoCoQkIECv2e8WkkBvVmE7olvSLbzLnZMPEiW3zlkujwr/u6KVL8da7dTxslIn7ifJ9PLSIlcXG X-Received: by 10.112.143.136 with SMTP id se8mr38585lbb.18.1418397116679; Fri, 12 Dec 2014 07:11:56 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.71 with SMTP id k7ls417137laf.104.gmail; Fri, 12 Dec 2014 07:11:56 -0800 (PST) X-Received: by 10.112.141.42 with SMTP id rl10mr15903125lbb.98.1418397116330; Fri, 12 Dec 2014 07:11:56 -0800 (PST) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id jd8si1650233lbc.99.2014.12.12.07.11.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:11:55 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id hs14so6141966lab.22 for ; Fri, 12 Dec 2014 07:11:55 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr15774692lbo.32.1418397115878; Fri, 12 Dec 2014 07:11:55 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp3996lbb; Fri, 12 Dec 2014 07:11:54 -0800 (PST) X-Received: by 10.140.20.104 with SMTP id 95mr3934341qgi.47.1418397114180; Fri, 12 Dec 2014 07:11:54 -0800 (PST) Received: from ip-10-35-177-41.ec2.internal (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTPS id z50si1734990qgd.38.2014.12.12.07.11.53 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:11:54 -0800 (PST) Received-SPF: none (google.com: lng-odp-bounces@lists.linaro.org does not designate permitted sender hosts) client-ip=54.225.227.206; Received: from localhost ([127.0.0.1] helo=ip-10-35-177-41.ec2.internal) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzRsl-0006Zo-AZ; Fri, 12 Dec 2014 15:11:51 +0000 Received: from mail-la0-f51.google.com ([209.85.215.51]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzRsf-0006Zi-2L for lng-odp@lists.linaro.org; Fri, 12 Dec 2014 15:11:45 +0000 Received: by mail-la0-f51.google.com with SMTP id ms9so6231730lab.10 for ; Fri, 12 Dec 2014 07:11:39 -0800 (PST) X-Received: by 10.152.87.42 with SMTP id u10mr16162705laz.0.1418397099182; Fri, 12 Dec 2014 07:11:39 -0800 (PST) Received: from localhost.localdomain (ppp91-76-163-205.pppoe.mtu-net.ru. [91.76.163.205]) by mx.google.com with ESMTPSA id zp3sm457141lbb.45.2014.12.12.07.11.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:11:38 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 12 Dec 2014 18:11:32 +0300 Message-Id: <1418397092-26112-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 X-Topics: patch Subject: [lng-odp] [PATCHv2] configure.ac check for atomic operations support X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: lng-odp-bounces@lists.linaro.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Odp atomic operations based on compiler build-ins. Make sure that compiler supports such operation at configure stage. Signed-off-by: Maxim Uvarov --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 8dbad4b..7bd2a47 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,25 @@ AC_TYPE_INT32_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [[#include + int main() { + volatile uint32_t v = 1; + __atomic_fetch_add(&v, 1, __ATOMIC_RELAXED); + __atomic_fetch_sub(&v, 1, __ATOMIC_RELAXED); + __atomic_store_n(&v, 1, __ATOMIC_RELAXED); + __atomic_load_n(&v, __ATOMIC_RELAXED); + return 0; + } + ]])], + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) + echo "Atomic operation are not supported by your compiller." + echo "Use newer version. For gcc > 4.7.3" + exit -1) + ########################################################################## # Determine which platform to build for ##########################################################################