From patchwork Mon Dec 29 14:58:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 42644 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7DF28246A4 for ; Mon, 29 Dec 2014 14:59:28 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf8102595lbv.1 for ; Mon, 29 Dec 2014 06:59:27 -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:in-reply-to :references: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=gVi30CWqzURrERbvT0Mgr+L91efcQK0u6kwhvqivjMw=; b=QCAznwPa+1t/jVfFcfiU+yRknl3THb61ABOWlQGkJIWMw+tHSqZuMRlIYbEA39XnzI /H6DBtqmoUyyoIItw45eN4+suBkBLP35nUxrUr+QGmwQkQxg4ZJjnVG+8ZqOazZ7r9FV JYs6Ue6hvaSnYiVpGJCoqU57RWmASpKFPzQ8F8odxQsVYAuwb9lCRNzStIzrIqhs01e+ oT8LGFn/YLfKUXIE8BBYCF/gzSEa+E5v+gv0vGn6L79zVjaK5+B+JhzxdsMbYZcV0Sc1 evbqycpWKCSxdxUc+NiivAmyRa+35offMlWKHze4FA2apQADzDUVdtG4Z3OSh7ixHpzt pNIg== X-Gm-Message-State: ALoCoQmwRUUKMMvQU+cTQLopd/ivhSsJfcWZWPqmqyqe9hhg7Maj1g8FRG2zhV8KuO7JTOz0u9ID X-Received: by 10.113.5.170 with SMTP id cn10mr13414lbd.21.1419865167117; Mon, 29 Dec 2014 06:59:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.11.163 with SMTP id ej3ls1973586lad.94.gmail; Mon, 29 Dec 2014 06:59:26 -0800 (PST) X-Received: by 10.152.206.108 with SMTP id ln12mr57082359lac.3.1419865166974; Mon, 29 Dec 2014 06:59:26 -0800 (PST) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id 2si39776455lai.59.2014.12.29.06.59.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Dec 2014 06:59:26 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by mail-la0-f48.google.com with SMTP id gf13so11089258lab.7 for ; Mon, 29 Dec 2014 06:59:26 -0800 (PST) X-Received: by 10.112.159.129 with SMTP id xc1mr57061999lbb.24.1419865166838; Mon, 29 Dec 2014 06:59:26 -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 ru5csp2805937lbb; Mon, 29 Dec 2014 06:59:26 -0800 (PST) X-Received: by 10.224.167.134 with SMTP id q6mr44241672qay.72.1419865165224; Mon, 29 Dec 2014 06:59:25 -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 x7si8761654qai.81.2014.12.29.06.59.23 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 29 Dec 2014 06:59:25 -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 1Y5bn0-0007B0-1U; Mon, 29 Dec 2014 14:59:22 +0000 Received: from mail-lb0-f181.google.com ([209.85.217.181]) by ip-10-35-177-41.ec2.internal with esmtp (Exim 4.76) (envelope-from ) id 1Y5bmm-00078L-IS for lng-odp@lists.linaro.org; Mon, 29 Dec 2014 14:59:08 +0000 Received: by mail-lb0-f181.google.com with SMTP id l4so10893832lbv.26 for ; Mon, 29 Dec 2014 06:59:03 -0800 (PST) X-Received: by 10.152.1.201 with SMTP id 9mr57115627lao.36.1419865142731; Mon, 29 Dec 2014 06:59:02 -0800 (PST) Received: from localhost.localdomain ([188.92.105.210]) by mx.google.com with ESMTPSA id f5sm7027533laa.12.2014.12.29.06.59.01 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Dec 2014 06:59:01 -0800 (PST) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 29 Dec 2014 17:58:52 +0300 Message-Id: <1419865132-27981-3-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.8.5.1.163.gd7aced9 In-Reply-To: <1419865132-27981-1-git-send-email-maxim.uvarov@linaro.org> References: <1419865132-27981-1-git-send-email-maxim.uvarov@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCHv4 2/2] 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.48 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 | 4 +++- platform/linux-generic/m4/configure.m4 | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 platform/linux-generic/m4/configure.m4 diff --git a/configure.ac b/configure.ac index f0ce7e0..3436925 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..00f2f89 --- /dev/null +++ b/platform/linux-generic/m4/configure.m4 @@ -0,0 +1,17 @@ +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [[int main() { + int 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 "GCC-style __atomic builtins not supported by the compiler." + echo "Use newer version. For gcc > 4.7.0" + exit -1)