[Mono-dev] gc_test_and_set + arm architectures
kumpera at gmail.com
Wed Jul 27 17:56:00 EDT 2011
On Wed, Jul 27, 2011 at 10:59 AM, Brian Luczkiewicz <brian at sooloos.com>wrote:
> This code (duplicated below, from gc_locks.h) is a little bit troublesome.
> I'm not sure what the best way to resolve is, but I figured I'd raise the
> issue anyways.
> On most architectures, building for an old CPU then running on a newer one
> is safe. For example, running code compiled for i386 on a modern intel cpu
> generally turns out ok.
> With mono+arm this is not the case. If I use gcc to build for arm with no
> -march/etc flags, gcc builds for armv5. If I run this mono on an SMP armv7a
> machine, I get deadlocks and terribleness, because test+set is broken. The
> comments seems to suggest that someone anticipated this issue, but never
> followed up.
> Any ideas how we can make this experience better? If it's truly not
> possible to write a single code path that is suitable for both CPUs when
> building for armv5, maybe code built for armv5 should force mono into a
> single cpu or assert at boot if run on an SMP arm machine.
Support SMP on armv5 binaries would require some very nasty hacks to enable
runtime detection of v6+ and use the correct and safe paths (in about a
dozen places). I not sure if such approach is manageable.
So, I believe forcing armv5 binaries to be bound to a single cpu is
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list