From patchwork Fri Dec 12 15:03:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42187 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E896526C99 for ; Fri, 12 Dec 2014 15:04:04 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf1305378wiv.5 for ; Fri, 12 Dec 2014 07:04:04 -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=6bTtrn1OQAQS+0uxujM9+5QyMva6NnOcCd+mriuPe00=; b=AVcMXTMEsEjYOZ4Zc2562cmcpDGb1pW2UTTF5cFv3S3LpqENNYsr0Si4Vo3YIs73rJ tcJCS9FUAjyoJlKIbzscXq3CiNxPkfHkFAEoFRGPTNYj/ijjlWdtbzC+lqD8F+rPJ50Q +VREVz3zxoBXoLEbHEA5pYmXbjcse3NMjOBSDC0DYkQ6mcXC82WmibXe7UZHzPTmh3/y E4gt5Mb1s5dz5sc4GPiAypGk3GoZnLRhPXx1iOD+7skKwV0qB7yVL7cdx6O7jhHRrjKg AHNJBD84XxWfRxM1Y4lYnNmhNuv+yky31bI+XkwkUdj5afAUZpQFpHI/1dLC+KCWGGFv YBwA== X-Gm-Message-State: ALoCoQldZry1jFJhhUXnPXloY/lCqoRKoppvpY8PD/1u8MR8CYT0XURKpb0L/SRyBjq6RTrQwe6w X-Received: by 10.152.8.67 with SMTP id p3mr2659951laa.4.1418396643783; Fri, 12 Dec 2014 07:04:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.132 with SMTP id n4ls251528lae.57.gmail; Fri, 12 Dec 2014 07:04:03 -0800 (PST) X-Received: by 10.152.29.4 with SMTP id f4mr16046585lah.43.1418396643447; Fri, 12 Dec 2014 07:04:03 -0800 (PST) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id f6si1699617lbc.11.2014.12.12.07.04.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:04:03 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so6591271lbj.27 for ; Fri, 12 Dec 2014 07:04:03 -0800 (PST) X-Received: by 10.152.197.5 with SMTP id iq5mr15959629lac.6.1418396643351; Fri, 12 Dec 2014 07:04:03 -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 ru5csp1197lbb; Fri, 12 Dec 2014 07:04:02 -0800 (PST) X-Received: by 10.170.158.130 with SMTP id z124mr7926375ykc.29.1418396641612; Fri, 12 Dec 2014 07:04:01 -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 y69si1665328qgy.79.2014.12.12.07.03.57 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:04:01 -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 1XzRl5-0006D2-4I; Fri, 12 Dec 2014 15:03:55 +0000 Received: from mail-la0-f50.google.com ([209.85.215.50]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1XzRkz-0006Cw-Pc for lng-odp@lists.linaro.org; Fri, 12 Dec 2014 15:03:49 +0000 Received: by mail-la0-f50.google.com with SMTP id pn19so6230952lab.37 for ; Fri, 12 Dec 2014 07:03:43 -0800 (PST) X-Received: by 10.112.168.164 with SMTP id zx4mr7633691lbb.28.1418396623650; Fri, 12 Dec 2014 07:03:43 -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 pz3sm459799lbb.27.2014.12.12.07.03.42 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Dec 2014 07:03:42 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Fri, 12 Dec 2014 18:03:37 +0300 Message-Id: <1418396617-25844-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] [PATCH] 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.217.182 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..29387ee 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 MAX 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 ##########################################################################