I'm currently working on building Google's Tensorflow for Android using LLVM STL. When in the build process, there's an error as some Eigen components are utilized, more specifically in EventCount.h, here:
"error: invalid failure memory model for __atomic_compare_exchange".
According to the C++11 standard, the failure state for compare_exchange cannot be memory_order_release, as this would result in an erroneous state. Further, setting only a single memory_order parameter should resolve correctly to memory_order_relaxed on failure, but this isn't done in LLVM for whatever reason, and it's unlikely that the Android NDK version of LLVM will be updated in a timely manner and expose it to all platforms.
The faster solution to allow a correct build would instead be to explicitly define the two result states explicitly instead of implicitly as:
compare_exchange_weak(..., std::memory_order_release, std::memory_order_relaxed)
I tested this on my local build, and it resolves the build error as expected.
The error MAY also be present if building with LLVM for x86 / linux, but I was not in a position to test.
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1350.