-
Notifications
You must be signed in to change notification settings - Fork 7
[WIP] MacOS Support #50
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
Open
gsquire
wants to merge
4
commits into
microsoft:main
Choose a base branch
from
gsquire:macos
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
@gsquire thanks for starting this work! It's really appreciated! I don't have a mac environment to check. But I'd like to learn from other people helping here. |
This patch adds support for MacOS.
I had some time to work on this today so I wanted to update the thread. I ran one of the test binaries through LLDB and found out that the error I'm seeing is an invalid memory fetch: Process 59306 stopped
* thread #2, name = 'test_will_return_boolean_when_fake_complex_generic_function_mul', stop reason = EXC_BAD_ACCESS (code=2, address=0x1000011d8)
frame #0: 0x000000018f5783f8 libsystem_platform.dylib`_platform_memmove + 424
libsystem_platform.dylib`_platform_memmove:
-> 0x18f5783f8 <+424>: str x6, [x3], #0x8
0x18f5783fc <+428>: subs x2, x2, #0x8
0x18f578400 <+432>: b.hs 0x18f5783f4 ; <+420>
0x18f578404 <+436>: adds x2, x2, #0x8
(lldb) register read
General Purpose Registers:
x0 = 0x00000001000011d8 will_return-824334915c6e7ea9`will_return::complex_generic_multiple_types_func_return_false::h69c6a7f7c5db2f2d at will_return.rs:11
x1 = 0x00000001700064d0
x2 = 0x0000000000000004
x3 = 0x00000001000011d8 will_return-824334915c6e7ea9`will_return::complex_generic_multiple_types_func_return_false::h69c6a7f7c5db2f2d at will_return.rs:11
x4 = 0x000000000000000c
x5 = 0x0000000000000002
x6 = 0xd503201f14073b8a
x7 = 0x0000000000000000
x8 = 0x0000000000000001
x9 = 0x000000000000000c
x10 = 0x000000000000000c
x11 = 0x0000000000000001
x12 = 0x0000000000000000
x13 = 0x0000000000000000
x14 = 0x000000008042a7fb
x15 = 0x0000000080229ffb
x16 = 0x000000018f578250 libsystem_platform.dylib`_platform_memmove
x17 = 0x0000600003920000
x18 = 0x0000000000000000
x19 = 0x0000000170006ce8
x20 = 0x000000003b9aca00
x21 = 0x0000000000000000
x22 = 0x0000000000000000
x23 = 0x000000003b9aca00
x24 = 0x0000000000000001
x25 = 0x000000003b9aca00
x26 = 0x0000000000000000
x27 = 0x00000001000bcf19 will_return-824334915c6e7ea9`__rust_no_alloc_shim_is_unstable
x28 = 0x0000000170006cd0
fp = 0x0000000170006300
lr = 0x000000010003c000 will_return-824334915c6e7ea9`injectorpp::injector_core::common::inject_asm_code::he062c9898b486fba + 156 at common.rs:283:5
sp = 0x00000001700061c0
pc = 0x000000018f5783f8 libsystem_platform.dylib`_platform_memmove + 424
cpsr = 0x20001000
(lldb) memory read $x6
error: memory read failed for 0x201f14073a00 I'm still looking into why this is. |
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 is a work in progress for #43.
I tried to add MacOS support via this patch but have been dealing with what I believe to be hardened runtime restrictions. I'm developing on an M2 chip. I get
SIGBUS
errors when the library tries to copy the generated ASM into the memory-mapped region. I am posting this in hopes that someone with more experience can comment on whether or not I am on the right path at least. Below are some links to documentation I read through.