Skip to content

Commit

Permalink
Allow getHostCPUFeatures to fail on ARM platforms (#2917)
Browse files Browse the repository at this point in the history
LLVM does not yet support getting CPU features on FreeBSD/aarch64 (or armv6/7), the situation is probably similar on other non-Linux OSes.
In the case it fails, let's just assume NEON (it's mandatory on aarch64 and very likely present on armv7).
  • Loading branch information
valpackett authored and jemc committed Nov 2, 2018
1 parent 87fa189 commit 81ba52c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libponyc/codegen/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ char* LLVMGetHostCPUFeatures()
{
StringMap<bool> features;
bool got_features = sys::getHostCPUFeatures(features);
#ifdef PLATFORM_IS_ARM
// LLVM might not have CPU features support on e.g. FreeBSD/aarch64
if (!got_features) {
features["neon"] = true;
}
#else
pony_assert(got_features);
#endif
(void)got_features;

// Calculate the size of buffer that will be needed to return all features.
Expand Down

0 comments on commit 81ba52c

Please sign in to comment.