arch/arc: always needs -matomic with atomic extensions
authorYann E. MORIN <yann.morin.1998@free.fr>
Thu, 18 Jul 2019 20:52:49 +0000 (22:52 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 18 Jul 2019 20:54:36 +0000 (22:54 +0200)
As reported by Alexey in:
    https://patchwork.ozlabs.org/patch/1087480/
    https://patchwork.ozlabs.org/patch/1087471/

when BR2_ARC_ATOMIC_EXT is enabled, -matomic needs to always be passed
to the compiler to allow atomic instructions to be used. So instead of
passing them through the command-line CFLAGS, we enforce them in the
toolchain wrapper directly.

Reported-by: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
arch/arch.mk.arc [new file with mode: 0644]
package/Makefile.in

diff --git a/arch/arch.mk.arc b/arch/arch.mk.arc
new file mode 100644 (file)
index 0000000..5fcffb7
--- /dev/null
@@ -0,0 +1,4 @@
+# -matomic is always required when the ARC core has the atomic extensions
+ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
+ARCH_TOOLCHAIN_WRAPPER_OPTS = -matomic
+endif
index f05b9cc3aadf8ae7fee74b02f3f81ac466e6305c..0a7899c852e95f018d1334211226926b1cbde2be 100644 (file)
@@ -112,10 +112,6 @@ ifeq ($(BR2_xtensa),y)
 TARGET_ABI += -mlongcalls -mauto-litpools
 endif
 
-ifeq ($(BR2_arc)$(BR2_ARC_ATOMIC_EXT),yy)
-TARGET_ABI += -matomic
-endif
-
 STAGING_SUBDIR = $(GNU_TARGET_NAME)/sysroot
 STAGING_DIR    = $(HOST_DIR)/$(STAGING_SUBDIR)