libatomic on ARM

Sebastian Huber sebastian.huber@embedded-brains.de
Tue Apr 19 08:52:00 GMT 2016


Hello,

I tried to build the libatomic for RTEMS on ARM and I got this error:

make[2]: Entering directory 
`/build/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/thumb/armv6-m/libatomic'
/bin/sh ./libtool --tag=CC   --mode=compile 
/build/git-build/b-gcc-git-arm-rtems4.12/./gcc/xgcc 
-B/build/git-build/b-gcc-git-arm-rtems4.12/./gcc/ -nostdinc 
-B/build/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/thumb/armv6-m/newlib/ 
-isystem 
/build/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/thumb/armv6-m/newlib/targ-include 
-isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include 
-B/opt/rtems-4.12/arm-rtems4.12/bin/ 
-B/opt/rtems-4.12/arm-rtems4.12/lib/ -isystem 
/opt/rtems-4.12/arm-rtems4.12/include -isystem 
/opt/rtems-4.12/arm-rtems4.12/sys-include  -mthumb -march=armv6-m 
-DHAVE_CONFIG_H 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic/config/arm 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic/config/rtems 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic -I.    -Wall -Werror  
-g -O2 -fno-sync-libcalls  -fno-sync-libcalls  -MT exch_1_.lo -MD -MP 
-MF .deps/exch_1_.lo.Ppo -DN=1  -c -o exch_1_.lo 
/home/EB/sebastian_h/archive/gcc-git/libatomic/config/arm/exch_n.c
libtool: compile: /build/git-build/b-gcc-git-arm-rtems4.12/./gcc/xgcc 
-B/build/git-build/b-gcc-git-arm-rtems4.12/./gcc/ -nostdinc 
-B/build/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/thumb/armv6-m/newlib/ 
-isystem 
/build/git-build/b-gcc-git-arm-rtems4.12/arm-rtems4.12/thumb/armv6-m/newlib/targ-include 
-isystem /home/EB/sebastian_h/archive/gcc-git/newlib/libc/include 
-B/opt/rtems-4.12/arm-rtems4.12/bin/ 
-B/opt/rtems-4.12/arm-rtems4.12/lib/ -isystem 
/opt/rtems-4.12/arm-rtems4.12/include -isystem 
/opt/rtems-4.12/arm-rtems4.12/sys-include -mthumb -march=armv6-m 
-DHAVE_CONFIG_H 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic/config/arm 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic/config/rtems 
-I/home/EB/sebastian_h/archive/gcc-git/libatomic -I. -Wall -Werror -g 
-O2 -fno-sync-libcalls -fno-sync-libcalls -MT exch_1_.lo -MD -MP -MF 
.deps/exch_1_.lo.Ppo -DN=1 -c 
/home/EB/sebastian_h/archive/gcc-git/libatomic/config/arm/exch_n.c -o 
exch_1_.o
/tmp/ccrU82YJ.s: Assembler messages:
/tmp/ccrU82YJ.s:58: Error: selected processor does not support `uadd8 
r3,r3,r3' in Thumb mode
/tmp/ccrU82YJ.s:59: Error: selected processor does not support `ldrex 
r2,[r0]' in Thumb mode
/tmp/ccrU82YJ.s:60: Error: selected processor does not support `sel 
r3,r1,r2' in Thumb mode
/tmp/ccrU82YJ.s:61: Error: selected processor does not support `strex 
r5,r3,[r0]' in Thumb mode

In "libatomic/config/arm/arm-config.h" we have:

#if __ARM_ARCH__ >= 7 || defined(__ARM_ARCH_6K__) || 
defined(__ARM_ARCH_6ZK__)
# define HAVE_STREX    1
# define HAVE_STREXBHD    1
#elif __ARM_ARCH__ == 6
# define HAVE_STREX    1
#endif

Is there a particular reason why this file uses __ARM_ARCH_* and not 
directly __ARM_FEATURE_LDREX?

The following patch would fix the build problem:

diff --git a/libatomic/config/arm/arm-config.h 
b/libatomic/config/arm/arm-config.h
index 19331e3..79f422f 100644
--- a/libatomic/config/arm/arm-config.h
+++ b/libatomic/config/arm/arm-config.h
@@ -68,7 +68,7 @@
  #if __ARM_ARCH__ >= 7 || defined(__ARM_ARCH_6K__) || 
defined(__ARM_ARCH_6ZK__)
  # define HAVE_STREX    1
  # define HAVE_STREXBHD 1
-#elif __ARM_ARCH__ == 6
+#elif __ARM_ARCH__ == 6 && !defined(__ARM_ARCH_6M__)
  # define HAVE_STREX    1
  #endif


-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the Gcc mailing list