-
Notifications
You must be signed in to change notification settings - Fork 738
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
Fix extern "C" naming issues on OSX #3020
Merged
+130
−13
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Can the JIT_HELPER macro be updated to include
_
on OSX? That would minimize the other required changes.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.
The leading
_
is needed for platforms other than OSX. So what we would need is to haveJIT_HELPER(x)
defined toextern "C" void x()
on mac andextern "C" void _x()
on other platforms. We would then also need to enclose any calls to these functions in C/C++ in another macro, say,CALL_JIT_HELPER
.However, I did not go with that solution because the problem is that there is a lack of consistency here. The method calls/declarations with leading underscore in C also are named with leading underscores in the MASM code. Most of the methods are missing a leading underscore (and also in the assembly code), and so using our single
JIT_HELPER
macro that expands differently on OSX would not work. We would then need to divide them into 2 different categories, requiring 4 different macros:JIT_HELPER(x)
,JIT_HELPER_UNDERSCORE(x)
,CALL_JIT_HELPER(x)
,CALL_JIT_HELPER_UNDERSCORE(x)
.Did you have a different idea in mind?
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.
The VM handles this somewhat differently by hiding the platform differences in the macros. Looking at the JIT code, the approach there is to handle it with ifdefs throughout.
I don't want this to block this PR from moving forward. Though I think it would be worth looking at cleaning this up in the future.
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.
This will be cleaned up once the NASM assembly files are set up to be used by Windows and xLinux. We will no longer need to have the code in the
#else
blocks of#if defined(OSX)
in this PR.