SDL_atomic.h garbage following instruction error

When I try to compile for Armv7 my compiler stops with the following
error message:

/tmp/ccQp8wLF.s: Assembler messages:
/tmp/ccQp8wLF.s:725: Error: garbage following instruction – dmb ish' /tmp/ccQp8wLF.s:794: Error: garbage following instruction --dmb ish’
/tmp/ccQp8wLF.s:1023: Error: garbage following instruction – dmb ish' /tmp/ccQp8wLF.s:1137: Error: garbage following instruction --dmb ish’

At the moment, I work around this by removing “dmb ish” from the inline
assembler. My compiler version info is:

Target: arm-cortexa8-linux-gnueabi
Configured with:
/usr/local/src/arm/kernel-work/tool-chain/cross-gcc/configure
–target=arm-cortexa8-linux-gnueabi
–prefix=/usr/local/arm/cross-gcc-4.4.1-armv7a-soft/i686-pc-linux-gnu
–enable-shared --enable-threads --enable-languages=c,c++ --disable-nls
–disable-multilib --enable-serial-configure --with-float=soft
–with-fpu=vfp --enable-__cxa_atexit
–with-sysroot=/usr/local/arm/cross-gcc-4.4.1-armv7a-soft/i686-pc-linux-gnu/arm-cortexa8-linux-gnueabi/sys-root
–with-slibdir=/usr/local/arm/cross-gcc-4.4.1-armv7a-soft/i686-pc-linux-gnu/arm-cortexa8-linux-gnueabi/sys-root/usr/lib
–with-abi=aapcs-linux --with-cpu=cortex-a8 --with-arch=armv7-a -v
Thread model: posix
gcc version 4.4.1 (GCC)

Geoffrey Mellar wrote:

/tmp/ccQp8wLF.s:725: Error: garbage following instruction – `dmb ish’

gcc version 4.4.1 (GCC)

That’s rather an old version of GCC, it looks like it doesn’t support the “ish” modifier for dmb. I’m not sure what compilers SDL claims to support, but I’d be wanting to upgrade regardless.

A relatively easy way to upgrade is probably the Linaro toolchain: https://launchpad.net/linaro-toolchain-binaries/trunk/2013.10 seems to be the latest. You can just download a binary and unpack it somewhere.

At the moment, I work around this by removing “dmb ish” from the inline

I really wouldn’t suggest removing the entire dmb (it’s a barrier to ensure memory consistency between cores), but you’re probably safe if you remove the ish part (it defaults to the most conservative barrier).