Disable neon for armhf if not supported by C/C++ compiler #2672
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi, this minor PR is a workaround for llvm's bug 30842. The issue is that
neon
instructions are enabled by default for armhf even if target CPU doesn't support them. As a result llvm backend may generate code that has unsupported instructions and program can crash with SIGILL.It's not a big issue for ponyc as neon can be disabled with
ponyc --features=-neon
, but it's problematic forlibponyc
unit tests as compilation target is configured automatically and neon can't be disabled easily for such cases. As a result unit tests are failing on tests likeBoxedTupleIsBoxedTuple
where vectorisation is used which isn't great.My current solution is to disable neon by default (setting
--features=
for ponyc explicitly will revert the behavior) if neon instruction set was disabled for C/C++ compiler. I created a new var in Makefilefpu
that corresponds to-mfpu
flag and can be redefined for arm targets, otherwise it doesn't have any effect.I hope it makes sense.