From patchwork Tue Feb 2 19:57:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Hunleth X-Patchwork-Id: 577566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id ED78E140C49 for ; Wed, 3 Feb 2016 06:59:48 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=troodon-software-com.20150623.gappssmtp.com header.i=@troodon-software-com.20150623.gappssmtp.com header.b=nu0FMeqE; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4C9A1A5F6C; Tue, 2 Feb 2016 19:59:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JiH3EmjK_8mQ; Tue, 2 Feb 2016 19:59:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3B0A1A5F5F; Tue, 2 Feb 2016 19:59:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 2ED041C086E for ; Tue, 2 Feb 2016 19:59:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 268E133325 for ; Tue, 2 Feb 2016 19:59:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w+rMnfUT-z4m for ; Tue, 2 Feb 2016 19:59:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by silver.osuosl.org (Postfix) with ESMTPS id E503E2537E for ; Tue, 2 Feb 2016 19:59:04 +0000 (UTC) Received: by mail-qk0-f180.google.com with SMTP id s68so70793378qkh.3 for ; Tue, 02 Feb 2016 11:59:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troodon-software-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=b5UL/7dhrsbSxA8SjyRm5jLKkF7r2FUZb0HWc8cTPr0=; b=nu0FMeqEu8845/FkXeQdSDO4uQKTNMjVBTBspF7P3zWDICU6G5mNAYaxGLgmpB4jY/ p5sjXYUjQRlTfueq+Gu41Eguly55tIbSlo4oIC/tM4OEx65rChJAV/IR6rYv6RQIqL9l dVZjqojt1ZT4WmGutglEUHTZGbfyZYwQgCxsf3p0fnStnsKrSLjcdmXwWxSJNg2C+s1x nQXLizjv+4joNkrZcbb1/6VBifaQni3mBGY/9QkQ7K1VuOK964uZIPlbqSazIuRwmPI9 vYig+k0wNUWFz4qfpc2XFw+rZlE5EXs0L+tIQ5+5ZMBa2nf93+ZQHHCBB1Whev4mp7J5 ogcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=b5UL/7dhrsbSxA8SjyRm5jLKkF7r2FUZb0HWc8cTPr0=; b=S7nfuBxqwnciCrve4kmxJPbj7N/tj0xe5V46wkVRlPOs8FeJDPwlyIa7QDVIvqR2ul AXvpC/lHgGvtkrxfe3WbvTEaf5+IwjeF7qRHp0h2bcsS6iOn8lOoe15u69m4gDwP7B6t Bqs5Pag4o0KUN8vx0mXhul0sEebE+0nWIml00lnP4EsBb9BUzC9Yz1klrOnhm6AzXHDd QXfuaBwLlbqliFjYH6IKbaZRl97s9ek81Zbs5N9HNtIl6uJXCr4jHI2tdEqPCHvRulA2 sDV0JpcsHWyVEEZ8YLJeApAZ6wDxpQJ4+GDY3VQn8m0Jbi2L7OC1IANgy0HPSGO/2IXM eO4Q== X-Gm-Message-State: AG10YOTBRELawP06oE2P7JqgoaOw8lqKPn4ST1fFTZeV0Mt4uHjyXqQKJEHB00X7x3PYKA== X-Received: by 10.55.73.6 with SMTP id w6mr36647900qka.82.1454443144101; Tue, 02 Feb 2016 11:59:04 -0800 (PST) Received: from halfmarathon.home.hunleth.com (pool-100-36-100-112.washdc.fios.verizon.net. [100.36.100.112]) by smtp.gmail.com with ESMTPSA id z66sm1423648qhc.16.2016.02.02.11.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 11:59:03 -0800 (PST) From: Frank Hunleth To: buildroot@buildroot.org Date: Tue, 2 Feb 2016 14:57:44 -0500 Message-Id: <1454443064-14269-19-git-send-email-fhunleth@troodon-software.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454443064-14269-1-git-send-email-fhunleth@troodon-software.com> References: <1454443064-14269-1-git-send-email-fhunleth@troodon-software.com> In-Reply-To: <1453511471-28519-19-git-send-email-fhunleth@troodon-software.com> References: <1453511471-28519-19-git-send-email-fhunleth@troodon-software.com> Subject: [Buildroot] [PATCH v2 18/18] erlang: support choosing atomic ops X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Erlang requires atomic ops support and provides several options for fulfilling this need. Previously in Buildroot only the libatomic_ops option was used, but with Erlang 18, the Erlang developers prefer their own atomic ops implementation is used. This change makes it possible to select between options. Additionally, this fixes an autobuilder failure that occurs when using libatomic_ops on aarch64. Erlang's native atomic ops implementation works on aarch64. Fixes: http://autobuild.buildroot.net/results/0cd/0cd22eb74fa29e5a85bf897762e16ab3daf33962/ Signed-off-by: Frank Hunleth --- Changes v1->v2: - Add BR2_PACKAGE_ERLANG_ARCH_SUPPORTS and related changes (Thanks to Thomas) - Atomic ops selection is a choice now due to the potential for more than two options based on the Erlang documentation. - Line wrapping updates - Added note on Erlang choosing native atomic ops even if libatomic_ops is present. - Removed LIBS=-latomic_ops. The ./configure test for it still worked, and Erlang linked to it without errors. package/erlang/Config.in | 55 ++++++++++++++++++++++++++++++++++++++++++------ package/erlang/erlang.mk | 6 +++++- 2 files changed, 54 insertions(+), 7 deletions(-) diff --git a/package/erlang/Config.in b/package/erlang/Config.in index 0ec01bb..2a3098c 100644 --- a/package/erlang/Config.in +++ b/package/erlang/Config.in @@ -1,14 +1,30 @@ -comment "erlang needs a toolchain w/ dynamic library" - depends on BR2_USE_MMU # fork() - depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS - depends on BR2_STATIC_LIBS +# Erlang requires platform support for atomic operations. See the +# HOWTO/INSTALL.md file for the full description. A summary of the +# options is as follows: +# +# 1. Erlang's atomic operations on 32/64-bit x86, 32/64-bit +# SPARC V9, 32-bit PowerPC, or 32-bit Tile. The INSTALL.md +# omits 32/64-bit ARM support, but those are supported as well. +# 2. The API provided by Windows (N/A for Buildroot) +# 3. Native atomic operations provided by the '__atomic_*' builtins +# with gcc 4.7 or later. +# 4. libatomic_ops +# 5. The availability of __sync_*() operations. Based on +# http://autobuild.buildroot.org/results/209/2090874eee165af3349cf2d597657fc1b4ca1012/build-end.log, +# it needs the 4-byte and 8-byte versions. +# +# Cases 3 and 5 do not appear to work on configurations that are not +# included in 1 and 4 due to compiler errors. +config BR2_PACKAGE_ERLANG_ARCH_SUPPORTS + bool + default y if BR2_i386 || BR2_x86_64 || BR2_powerpc || BR2_sparc_v9 || BR2_arm || BR2_aarch64 # case (1) + default y if BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS # case (4) config BR2_PACKAGE_ERLANG bool "erlang" depends on BR2_USE_MMU # fork() depends on !BR2_STATIC_LIBS - depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS - select BR2_PACKAGE_LIBATOMIC_OPS + depends on BR2_PACKAGE_ERLANG_ARCH_SUPPORTS help Erlang is a programming language used to build massively scalable soft real-time systems with requirements on high availability. @@ -20,6 +36,28 @@ config BR2_PACKAGE_ERLANG if BR2_PACKAGE_ERLANG +choice + prompt "atomic ops" + help + Selects the atomic operations implementation used by the Erlang + VM + +config BR2_PACKAGE_ERLANG_NATIVE_ATOMIC_OPS + bool "native atomic ops" + help + Use Erlang's native atomic ops implementation. If unsure, select + this choice. + +config BR2_PACKAGE_ERLANG_LIBATOMIC_OPS + bool "libatomic_ops" + depends on BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS + depends on !BR2_aarch64 # causes build failures + select BR2_PACKAGE_LIBATOMIC_OPS + help + Use libatomic_ops to provide atomic ops support. + +endchoice + config BR2_PACKAGE_ERLANG_SMP bool "enable SMP support" help @@ -38,3 +76,8 @@ config BR2_PACKAGE_ERLANG_MEGACO enable it. endif # BR2_PACKAGE_ERLANG + +comment "erlang needs a toolchain w/ dynamic library, atomic_ops" + depends on BR2_USE_MMU # fork() + depends on BR2_STATIC_LIBS || !BR2_PACKAGE_ERLANG_ARCH_SUPPORTS + diff --git a/package/erlang/erlang.mk b/package/erlang/erlang.mk index 638d2c2..b1c8e35 100644 --- a/package/erlang/erlang.mk +++ b/package/erlang/erlang.mk @@ -30,8 +30,12 @@ ERLANG_CONF_ENV += erl_xcomp_sysroot=$(STAGING_DIR) ERLANG_CONF_OPTS = --without-javac +# Erlang uses its own native atomic ops implementation if support is +# available. Override this if the user wants libatomic_ops. +ifeq ($(BR2_PACKAGE_ERLANG_LIBATOMIC_OPS),y) ERLANG_DEPENDENCIES += libatomic_ops -ERLANG_CONF_OPTS += --with-libatomic_ops=$(STAGING_DIR)/usr LIBS=-latomic_ops +ERLANG_CONF_OPTS += --with-libatomic_ops=$(STAGING_DIR)/usr +endif # erlang uses openssl for all things crypto. Since the host tools (such as # rebar) uses crypto, we need to build host-erlang with support for openssl.