From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 18/18] erlang: support choosing atomic ops
Date: Sun, 7 Feb 2016 13:49:32 +0100 [thread overview]
Message-ID: <56B73D5C.9020704@gmail.com> (raw)
In-Reply-To: <1454443064-14269-19-git-send-email-fhunleth@troodon-software.com>
Hi Frank, All,
Le 02/02/2016 20:57, Frank Hunleth a ?crit :
> 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 <fhunleth@troodon-software.com>
> ---
> 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)
Copy past error: BR2_PACKAGE_LIBATOMIC_OPS_ARCH_SUPPORTS doesn't exist but you
probably wanted BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS.
Maybe BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS which is defined in libatomic_ops
package is confusing... Thomas ?
>
> 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.
Well, for now BR2_PACKAGE_ERLANG_NATIVE_ATOMIC_OPS is not used anywhere.
Maybe you can just add BR2_PACKAGE_ERLANG_LIBATOMIC_OPS for now. If Erlang add a
new libatomic options in a further release then you can add a choice in the
packaging.
> +
> +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
Indeed the dependencies comment is missing in erlang but it's not related to
libatomic_ops. It would be great if you add this in a separate patch at the
beginning of this series.
> +
> 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
Maybe the removal of LIBS=-latomic_ops should be part of Erlang bump patch ?
Best regards,
Romain
>
> # 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.
>
next prev parent reply other threads:[~2016-02-07 12:49 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 1:10 [Buildroot] [PATCH 00/18] Erlang 18 and native atomic ops Frank Hunleth
2016-01-23 1:10 ` [Buildroot] [PATCH 01/18] erlang: bump to version 18.2.1 Frank Hunleth
2016-02-01 20:47 ` Romain Naour
2016-01-23 1:10 ` [Buildroot] [PATCH 02/18] pkg-rebar.mk: pass C++ compiler path and options Frank Hunleth
2016-01-23 1:10 ` [Buildroot] [PATCH 03/18] erlang-goldrush: bump to version 0.1.8 Frank Hunleth
2016-01-23 1:10 ` [Buildroot] [PATCH 04/18] erlang-lager: bump to version 2.2.0 Frank Hunleth
2016-01-23 1:10 ` [Buildroot] [PATCH 05/18] erlang-rebar: bump to version 2.6.1 Frank Hunleth
2016-01-23 1:10 ` [Buildroot] [PATCH 06/18] erlang-fast_tls: new package Frank Hunleth
2016-01-23 8:20 ` Thomas Petazzoni
2016-02-01 20:38 ` Romain Naour
2016-01-23 1:11 ` [Buildroot] [PATCH 07/18] erlang-p1-cache-tab: bump to version 1.0.1 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 08/18] erlang-p1-iconv: bump to version 0.9.0 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 09/18] erlang-p1-stringprep: bump to version 1.0.0 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 10/18] erlang-p1_stun: bump to version 0.9.0 Frank Hunleth
2016-01-23 8:21 ` Thomas Petazzoni
2016-01-23 1:11 ` [Buildroot] [PATCH 11/18] erlang-p1-sip: bump to version 1.0.0 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 12/18] erlang-p1-tls: " Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 13/18] erlang-p1-utils: bump to version 1.0.3 Frank Hunleth
2016-02-01 21:04 ` Romain Naour
2016-01-23 1:11 ` [Buildroot] [PATCH 14/18] erlang-p1-xml: bump to version 1.1.1 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 15/18] erlang-p1-yaml: bump to version 1.0.0 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 16/18] erlang-p1-zlib: " Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 17/18] ejabberd: bump to version 16.01 Frank Hunleth
2016-01-23 1:11 ` [Buildroot] [PATCH 18/18] erlang: make libatomic_ops optional Frank Hunleth
2016-01-23 8:25 ` Thomas Petazzoni
2016-01-26 0:43 ` Frank Hunleth
2016-02-01 21:55 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 00/18] Erlang 18 and native atomic ops Frank Hunleth
2016-02-02 19:57 ` [Buildroot] [PATCH v2 01/18] erlang: bump to version 18.2.1 Frank Hunleth
2016-02-06 22:28 ` Romain Naour
2016-02-20 18:22 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 02/18] pkg-rebar.mk: pass C++ compiler path and options Frank Hunleth
2016-02-06 22:34 ` Romain Naour
2016-02-09 1:45 ` Frank Hunleth
2016-02-20 18:23 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 03/18] erlang-goldrush: bump to version 0.1.8 Frank Hunleth
2016-02-06 22:35 ` Romain Naour
2016-02-20 18:23 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 04/18] erlang-lager: bump to version 2.2.0 Frank Hunleth
2016-02-06 22:36 ` Romain Naour
2016-02-20 18:24 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 05/18] erlang-rebar: bump to version 2.6.1 Frank Hunleth
2016-02-06 22:39 ` Romain Naour
2016-02-09 1:58 ` Frank Hunleth
2016-02-20 17:37 ` Thomas Petazzoni
2016-02-20 18:08 ` Yann E. MORIN
2016-02-20 23:05 ` Arnout Vandecappelle
2016-02-20 23:19 ` Yann E. MORIN
2016-02-21 0:02 ` Arnout Vandecappelle
2016-02-21 8:37 ` Peter Korsgaard
2016-02-20 18:24 ` Thomas Petazzoni
2016-02-20 18:31 ` Frank Hunleth
2016-02-20 22:54 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 06/18] erlang-fast_tls: new package Frank Hunleth
2016-02-06 22:42 ` Romain Naour
2016-02-20 18:25 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 07/18] erlang-p1-cache-tab: bump to version 1.0.1 Frank Hunleth
2016-02-06 22:43 ` Romain Naour
2016-02-20 18:26 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 08/18] erlang-p1-iconv: bump to version 0.9.0 Frank Hunleth
2016-02-06 22:45 ` Romain Naour
2016-02-20 18:26 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 09/18] erlang-p1-stringprep: bump to version 1.0.0 Frank Hunleth
2016-02-06 22:47 ` Romain Naour
2016-02-20 22:28 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 10/18] erlang-p1_stun: bump to version 0.9.0 Frank Hunleth
2016-02-06 22:52 ` Romain Naour
2016-02-09 2:23 ` Frank Hunleth
2016-02-20 22:30 ` Thomas Petazzoni
2016-02-20 23:09 ` Frank Hunleth
2016-02-20 23:12 ` Thomas Petazzoni
2016-02-21 22:16 ` Frank Hunleth
2016-02-02 19:57 ` [Buildroot] [PATCH v2 11/18] erlang-p1-sip: bump to version 1.0.0 Frank Hunleth
2016-02-06 22:58 ` Romain Naour
2016-02-20 22:31 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 12/18] erlang-p1-tls: " Frank Hunleth
2016-02-06 23:01 ` Romain Naour
2016-02-20 22:31 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 13/18] erlang-p1-utils: bump to version 1.0.3 Frank Hunleth
2016-02-06 23:02 ` Romain Naour
2016-02-20 22:34 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 14/18] erlang-p1-xml: bump to version 1.1.1 Frank Hunleth
2016-02-06 23:07 ` Romain Naour
2016-02-20 22:35 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 15/18] erlang-p1-yaml: bump to version 1.0.0 Frank Hunleth
2016-02-06 23:10 ` Romain Naour
2016-02-20 22:35 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 16/18] erlang-p1-zlib: " Frank Hunleth
2016-02-06 23:13 ` Romain Naour
2016-02-20 22:52 ` Thomas Petazzoni
2016-02-02 19:57 ` [Buildroot] [PATCH v2 17/18] ejabberd: bump to version 16.01 Frank Hunleth
2016-02-06 23:24 ` Romain Naour
2016-02-02 19:57 ` [Buildroot] [PATCH v2 18/18] erlang: support choosing atomic ops Frank Hunleth
2016-02-07 12:49 ` Romain Naour [this message]
2016-02-07 13:15 ` Thomas Petazzoni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56B73D5C.9020704@gmail.com \
--to=romain.naour@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox