[Patch] Make atomics work on FreeBSD+arm

Ed Schouten ed at 80386.nl
Sun May 26 08:39:23 PDT 2013


Hi,

Some time ago there was discussion about the value of
MaxAtomicInlineWidth on ARM, which was not set, causing Clang not to
fall back to the __sync_* intrinsics. It seems that this got fixed for
Linux (r181728 and r181750), even though this issue is also present on
FreeBSD.

On FreeBSD, we can simply set MaxAtomicInlineWidth unconditionally, as
FreeBSD/arm always provides these __sync_* intrinsics:

http://svnweb.freebsd.org/base/head/lib/libcompiler_rt/Makefile?view=markup#l160

The following patch adjusts the code to set MaxAtomicInlineWidth
properly on FreeBSD:

http://80386.nl/pub/clang-freebsd-atomics.txt

For readability sake, a diff that ignores whitespace:

http://80386.nl/pub/clang-freebsd-atomics-nowhitespace.txt

Thanks,
--
Ed Schouten <ed at 80386.nl>



More information about the cfe-commits mailing list