From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 01/17] toolchain: add BR2_TOOLCHAIN_HAS_SYNC_x hidden booleans
Date: Thu, 28 Jan 2016 23:31:59 +0100 [thread overview]
Message-ID: <20160128223159.GE7523@free.fr> (raw)
In-Reply-To: <1453934861-26364-2-git-send-email-thomas.petazzoni@free-electrons.com>
Thomas, All,
On 2016-01-27 23:47 +0100, Thomas Petazzoni spake thusly:
> Currently, Buildroot provides one BR2_ARCH_HAS_ATOMICS boolean option
> to indicate whether the architecture supports atomic operations or
> not. However, the reality of atomic operations support is much more
> complicated and requires more than one option to be expressed
> properly.
>
> There are in fact two types of atomic built-ins provided by gcc:
>
> (1) The __sync_*() family of functions, which have been in gcc for a
> long time (probably gcc 4.1). They are available in variants
> operating on 1-byte, 2-byte, 4-byte and 8-byte integers. Some
> architectures implement a number of variants, certain do not
s/certain/some/
> implement any, certain architectures implement all of them.
s/certain architectures/some/ (indeed, no need to repeat 'architecture'
here, it's implicit here.)
[--SNIP--]
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
With the above fixed:
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Regards,
Yann E. MORIN.
> ---
> toolchain/toolchain-common.in | 65 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
>
> diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
> index 014a23d..27ce33b 100644
> --- a/toolchain/toolchain-common.in
> +++ b/toolchain/toolchain-common.in
> @@ -313,3 +313,68 @@ config BR2_TOOLCHAIN_GCC_AT_LEAST
> default "4.5" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_5
> default "4.4" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_4
> default "4.3" if BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
> +
> +config BR2_TOOLCHAIN_HAS_SYNC_1
> + bool
> + default y
> + depends on !BR2_x86_i386
> + depends on !BR2_bfin
> + depends on !BR2_microblaze
> + depends on !BR2_sparc
> + depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
> +
> +config BR2_TOOLCHAIN_HAS_SYNC_2
> + bool
> + default y if BR2_TOOLCHAIN_HAS_SYNC_1
> +
> +config BR2_TOOLCHAIN_HAS_SYNC_4
> + bool
> + default y
> + depends on !BR2_sparc
> + depends on !BR2_x86_i386
> + depends on !(BR2_arc && !BR2_ARC_ATOMIC_EXT)
> +
> +# The availability of __sync for 8-byte types on ARM is somewhat
> +# complicated:
> +#
> +# - It appeared in gcc starting with gcc 4.7.
> +#
> +# - On ARMv7, there is no problem, it can be directly implemented in
> +# userspace.
> +#
> +# - On < ARMv7, it requires help from the kernel. Unfortunately, the
> +# libgcc code implementing 8-byte __sync with the help from the
> +# kernel calls __write() when a failure occurs, which is a function
> +# internal to glibc, not available in uClibc and musl. This means
> +# that the 8-byte __sync operations are not available on < ARMv7
> +# with uClibc and musl. This problem was fixed as part of gcc
> +# PR68059, which was backported to the gcc 5 branch, but isn't yet
> +# part of any gcc 5.x release.
> +#
> +config BR2_TOOLCHAIN_ARM_HAS_SYNC_8
> + bool
> + default y
> + depends on BR2_arm || BR2_armeb
> + depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
> + depends on BR2_TOOLCHAIN_USES_GLIBC || BR2_ARM_CPU_ARMV7A
> +
> +# 8-byte intrinsics available on most x86 CPUs, except a few old ones
> +config BR2_TOOLCHAIN_X86_HAS_SYNC_8
> + bool
> + default y
> + depends on BR2_i386
> + depends on !BR2_x86_i386
> + depends on !BR2_x86_i486
> + depends on !BR2_x86_c3
> + depends on !BR2_x86_winchip_c6
> + depends on !BR2_x86_winchip2
> +
> +# 8-byte intrinsics available:
> +# - On all 64 bits architecture
> +# - On a certain combinations of ARM platforms
> +# - On certain x86 32 bits CPUs
> +config BR2_TOOLCHAIN_HAS_SYNC_8
> + bool
> + default y if BR2_ARCH_IS_64
> + default y if BR2_TOOLCHAIN_ARM_HAS_SYNC_8
> + default y if BR2_TOOLCHAIN_X86_HAS_SYNC_8
> --
> 2.6.4
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2016-01-28 22:31 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 22:47 [Buildroot] [PATCH v2 00/17] Rework atomic handling Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 01/17] toolchain: add BR2_TOOLCHAIN_HAS_SYNC_x hidden booleans Thomas Petazzoni
2016-01-28 22:31 ` Yann E. MORIN [this message]
2016-01-27 22:47 ` [Buildroot] [PATCH v2 02/17] docs/manual: document usage of BR2_TOOLCHAIN_HAS_SYNC_x Thomas Petazzoni
2016-01-28 22:01 ` Yann E. MORIN
2016-01-27 22:47 ` [Buildroot] [PATCH v2 03/17] json-c: needs __sync_val_compare_and_swap_4 Thomas Petazzoni
2016-01-28 22:03 ` Yann E. MORIN
2016-01-27 22:47 ` [Buildroot] [PATCH v2 04/17] pulseaudio: remove BR2_ARCH_HAS_ATOMICS dependency Thomas Petazzoni
2016-01-28 22:05 ` Yann E. MORIN
2016-01-27 22:47 ` [Buildroot] [PATCH v2 05/17] apache, apr: fix atomic handling Thomas Petazzoni
2016-01-28 22:08 ` Yann E. MORIN
2016-01-27 22:47 ` [Buildroot] [PATCH v2 06/17] jack2: use the proper BR2_TOOLCHAIN_HAS_SYNC_x symbol Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 07/17] libtorrent: use the proper BR2_TOOLCHAIN_HAS_SYNC_x symbols Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 08/17] gauche: disable on SPARC(64), remove atomics dependency Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 09/17] cairo, harfbuzz: rework atomic dependencies Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 10/17] squid: rework atomic handling Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 11/17] thrift: remove BR2_ARCH_HAS_ATOMICS dependency Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 12/17] msgpack: rework " Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 13/17] arch: remove BR2_ARCH_HAS_ATOMICS option Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 14/17] glog: fix atomic built-in problem Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 15/17] openal: add missing BR2_TOOLCHAIN_HAS_SYNC_4 dependency Thomas Petazzoni
2016-01-29 18:34 ` André Hentschel
2016-01-29 23:06 ` Thomas Petazzoni
2016-01-30 11:30 ` André Hentschel
2016-02-03 14:38 ` Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 16/17] freerdp: " Thomas Petazzoni
2016-01-27 22:47 ` [Buildroot] [PATCH v2 17/17] neard: " Thomas Petazzoni
2016-02-01 13:47 ` [Buildroot] [PATCH v2 00/17] Rework atomic handling Jan Viktorin
2016-02-01 15:19 ` Thomas Petazzoni
2016-02-01 15:38 ` Jan Viktorin
2016-02-01 15:46 ` 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=20160128223159.GE7523@free.fr \
--to=yann.morin.1998@free.fr \
--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