Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost: context lacking asm implementation for MinGW ARM/ARM64 #9045

Closed
jeremyd2019 opened this issue Feb 4, 2021 · 8 comments
Closed

boost: context lacking asm implementation for MinGW ARM/ARM64 #9045

jeremyd2019 opened this issue Feb 4, 2021 · 8 comments

Comments

@jeremyd2019
Copy link
Member

This is pretty expected, but entering here to record it. It seems that context is still lacking an arm64 implementation for Windows, even with MSVC.

@jeremyd2019
Copy link
Member Author

@olk
Copy link

olk commented Jun 27, 2021

I don't use Windows especially not on ARM - you are welcome to provide a patch,

@jeremyd2019 jeremyd2019 transferred this issue from msys2/CLANG-packages Jul 3, 2021
@olk
Copy link

olk commented Jul 8, 2021 via email

jeremyd2019 added a commit that referenced this issue Feb 14, 2022
Disable boost context as there is no Windows arm64 implementation
(#9045).  Also disable coroutine and fiber as they depend on context.
@dennisameling
Copy link
Contributor

It seems that context is still lacking an arm64 implementation for Windows, even with MSVC.

FYI the MSVC version is available since a month or two: boostorg/context#201

@mstorsjo
Copy link
Contributor

I was pointed here... I'm not familiar with the libraries here or how to test them, but it looks like it shouldn't be too hard to make it build.

For mingw arm64 cases, it uses GAS style assembly, and there are very few ABI differences to generic AAPCS on other platforms. In many cases, ELF GAS work as is, or with very few modifications. There seems to be a few ELF specific assembly directives in those files; if they are wrapped with #ifdef __ELF__, I think it should work just fine. Looking at https://github.com/boostorg/context/blob/697299ea554c04ae8a5cfb1b5cc3ec9caf61724d/src/asm/jump_arm64_aapcs_elf_gas.S, the .type, .size and .section directives aren't needed/supported for COFF targets, so by wrapping them it should build.

That is, whatever ASM files are picked for the MSVC case, *_pe_armasm.asm, use the corresponding *_elf_gas.S files instead, and add ifdefs to them. But before doing that, it's kinda important to check that there aren't any functional differences in the assembly itself between the _elf_gas.S and _pe_armasm files; check with diff that the only differences are in the directives wrapping it, not the instructions themselves.

If there are differences, you may need to take the *_pe_armasm.asm files, rename them to *_pe_gas.S and replace the outer structure with that of the *_elf_gas.S files (minus unsupported directives).

I won't have time to try this myself, but I'm happy to provide input if someone tries.

@MehdiChinoune MehdiChinoune changed the title boost: context lacking asm implementation for MingGW ARM/ARM64 boost: context lacking asm implementation for MinGW ARM/ARM64 Oct 8, 2024
@MehdiChinoune
Copy link
Collaborator

Fixed upstream by boostorg/context@e878e8ed with patch to build with CMake da4f4c37

@jeremyd2019
Copy link
Member Author

Fixed upstream by boostorg/context@e878e8ed with patch to build with CMake da4f4c37

Maybe make a PR upstream, perhaps boostorg/context#275 could benefit from this too?

@MehdiChinoune
Copy link
Collaborator

Maybe make a PR upstream, perhaps boostorg/context#275 could benefit from this too?

boostorg/context#276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants