-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Mono] Add osx aot offsets & generate aot compiler packs for x64 and arm64 #55506
Conversation
…make a bit more detail on the target os for the cross configuration
Tagging subscribers to this area: @directhex Issue DetailsSince Xam.mac can toggle between runtimes, it may make sense to provide an AOT option when using mono.
|
@@ -119,7 +119,11 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "") | |||
set(MONO_OFFSETS_FILE "${AOT_OFFSETS_FILE}") | |||
endif() | |||
if(AOT_TARGET_TRIPLE STREQUAL "x86_64-apple-darwin10") | |||
set(TARGET_SYSTEM_NAME "iOS") | |||
if(REAL_TARGET_OS STREQUAL "osx") |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we need it. I was trying to fit within what was there and it felt weird to set the TARGET_SYSTEM_NAME
to iOS when I know it should be Darwin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I am misreading what is happening. We set AOT_TARGET_TRIPLE from the outside. And then that sets TARGET_SYSTEM_NAME and then TARGET_SYSTEM_NAME is used to set other target properties. So it's not redundant. The triple is the source of truth.
It's unfortunate that we use the same triple for ios and mac. Did we do that in mono/mono, too? @vargaz ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We has no cross compiler to osx previously, probably just used the normal host mono. If we need it, it should use a separate triple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything you would suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like x86_64-apple-macos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://reviews.llvm.org/D40998 they use x86_64-apple-macosx
(note the x
at the end) for clang's -target
but if I understand correctly we're not passing the triple down to clang here so this is just for us?
# MacOS | ||
elif "aarch64-apple-darwin20" == args.abi: | ||
require_sysroot (args) | ||
self.target = Target ("TARGET_ARM64", "TARGET_OSX", IOS_DEFINES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IOS_DEFINES
sounds a bit weird here if we're using it for macOS too. We should probably rename it to APPLE_DEFINES
. Also if we're using a different AOT_TARGET_TRIPLE for macOS then we need to also add the case for x86_64
here that is covered by the iOS case on L149 now.
@@ -119,7 +119,11 @@ if(NOT AOT_TARGET_TRIPLE STREQUAL "") | |||
set(MONO_OFFSETS_FILE "${AOT_OFFSETS_FILE}") | |||
endif() | |||
if(AOT_TARGET_TRIPLE STREQUAL "x86_64-apple-darwin10") | |||
set(TARGET_SYSTEM_NAME "iOS") | |||
if(REAL_TARGET_OS STREQUAL "osx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to https://reviews.llvm.org/D40998 they use x86_64-apple-macosx
(note the x
at the end) for clang's -target
but if I understand correctly we're not passing the triple down to clang here so this is just for us?
Since Xam.mac can toggle between runtimes, it may make sense to provide an AOT option when using mono.