From patchwork Tue Dec 23 09:13: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: 42559 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFC592188F for ; Tue, 23 Dec 2014 09:14:01 +0000 (UTC) Received: by mail-wi0-f197.google.com with SMTP id l15sf3854764wiw.0 for ; Tue, 23 Dec 2014 01:14:01 -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=u4svGRc31u9S8wAxOGwzfCXZ4FFywJvePpk1mfXSJCg=; b=TbaqjrXLniUE7IOGNiGg6LbKHOwhuJYVvXYoi+QlM/OZcCBQMBPjQstwtZjpb/VpOi kH39OzY2+gg8CDkNL7IIkxVKOhRxBGErnDVo5Hvuzoqr8rfcO/AkjlayDbVzJzWnubbQ MS9/tONcD1BizXGoDUR6oPzk/QQsmSbjoFjs66FRKegENWOZveCMOloZAOphsYcsAmRN 3tIZye9vGQmjWRh+7kbmD8wdD3ZnJNnA+PQYJ2SZ9/8QRycvbq4XR4RKUBKVJXKIdiqH eOvwLNgIY2HDtryQwOW7FOSMTyxIf3JHnFAIuzOmSn7eiSa6S3SGYoeGO20lQ+ECH4BG TJ4g== X-Gm-Message-State: ALoCoQmb0I34XcWJDEmT7PbIYkISCiI5sykaiN53xmzyd3O3GNhrpKuGANxoA8H7XNv0AblZVPQn X-Received: by 10.112.159.199 with SMTP id xe7mr6002lbb.21.1419326040983; Tue, 23 Dec 2014 01:14:00 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.6 with SMTP id ee6ls1670842lad.7.gmail; Tue, 23 Dec 2014 01:14:00 -0800 (PST) X-Received: by 10.112.156.132 with SMTP id we4mr2127516lbb.59.1419326040822; Tue, 23 Dec 2014 01:14:00 -0800 (PST) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id c9si20862616lae.124.2014.12.23.01.14.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 01:14:00 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by mail-la0-f45.google.com with SMTP id gq15so5155794lab.4 for ; Tue, 23 Dec 2014 01:14:00 -0800 (PST) X-Received: by 10.152.37.7 with SMTP id u7mr26541507laj.74.1419326040321; Tue, 23 Dec 2014 01:14:00 -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 ru5csp1269681lbb; Tue, 23 Dec 2014 01:13:59 -0800 (PST) X-Received: by 10.140.85.203 with SMTP id n69mr41512030qgd.78.1419326038900; Tue, 23 Dec 2014 01:13:58 -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 v37si8741327qgd.45.2014.12.23.01.13.57 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 23 Dec 2014 01:13:58 -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 1Y3LXP-0003sM-9d; Tue, 23 Dec 2014 09:13:55 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y3LXJ-0003r5-1K for lng-odp@lists.linaro.org; Tue, 23 Dec 2014 09:13:49 +0000 Received: by mail-la0-f42.google.com with SMTP id gd6so5256732lab.29 for ; Tue, 23 Dec 2014 01:13:42 -0800 (PST) X-Received: by 10.152.206.41 with SMTP id ll9mr15795108lac.62.1419326022896; Tue, 23 Dec 2014 01:13:42 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id xe10sm5685774lbb.37.2014.12.23.01.13.41 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Dec 2014 01:13:41 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 23 Dec 2014 12:13:32 +0300 Message-Id: <1419326012-10666-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] [PATCHv3] 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.45 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 --- v3: make atomic checks platfrom specific configure.ac | 4 +++- platform/linux-generic/m4/configure.m4 | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/m4/configure.m4 diff --git a/configure.ac b/configure.ac index 377e8be..f55beca 100644 --- a/configure.ac +++ b/configure.ac @@ -47,7 +47,9 @@ AC_ARG_WITH([platform], [AS_HELP_STRING([--with-platform=prefix], [Select platform to be used, default linux-generic])], [], - [with_platform=linux-generic]) + [with_platform=linux-generic + m4_include([./platform/linux-generic/m4/configure.m4]) + ]) AC_SUBST([with_platform]) diff --git a/platform/linux-generic/m4/configure.m4 b/platform/linux-generic/m4/configure.m4 new file mode 100644 index 0000000..bfb1fb0 --- /dev/null +++ b/platform/linux-generic/m4/configure.m4 @@ -0,0 +1,18 @@ +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [[#include + int main() { + 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)