Fix building ARM assembly for Windows for mingw targets#26
Open
mstorsjo wants to merge 1 commit into
Open
Conversation
This code was attempted to be fixed to support building for Windows on ARM with MSVC before - by adding ifdefs for _M_ARM. The MSVC compilers predefine _M_ARM when targeting ARM - but mingw compilers don't define this (they predefine __arm__ instead). However, within ARM specific files, we don't specifically need to check for an _M_ARM at all - we can just check for _WIN32 which is predefined by all compilers targeting Windows. Secondly, add "#ifdef __ELF__" around ".fpu neon" instead of "#ifndef __APPLE__"; the .fpu directive can only be assembled on ELF targets. Thirdly, use a separate codepath for Windows in the synth*_neon_accurate.S files. Windows on ARM is Thumb only, and in Thumb mode, not all instructions are allowed. In this case, we can't align the stack pointer with one single instruction, but need to use a scratch register inbetween. This fixes building for Windows on ARM in mingw environments, such as with llvm-mingw toolchains.
|
The mpg123-devel mailing list has been notified of the existence of this pr. |
Collaborator
|
Merged upstream, thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This code was attempted to be fixed to support building for Windows on ARM with MSVC before - by adding ifdefs for _M_ARM.
The MSVC compilers predefine _M_ARM when targeting ARM - but mingw compilers don't define this (they predefine arm instead).
However, within ARM specific files, we don't specifically need to check for an _M_ARM at all - we can just check for _WIN32 which is predefined by all compilers targeting Windows.
Secondly, add "#ifdef ELF" around ".fpu neon" instead of "#ifndef APPLE"; the .fpu directive can only be assembled on ELF targets.
Thirdly, use a separate codepath for Windows in the synth*_neon_accurate.S files. Windows on ARM is Thumb only, and in Thumb mode, not all instructions are allowed. In this case, we can't align the stack pointer with one single instruction, but need to use a scratch register inbetween.
This fixes building for Windows on ARM in mingw environments, such as with llvm-mingw toolchains.