-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
Supports building up the VM, PAL and various components on Mac OSX 10.10 There are some oddities with the Apple assembler not generating short jumps and not supporting 1 byte relocs.
Initially __LINUX__ was defined when building for OSX as well, bringing in LONGDOUBLE_IS_DOUBLE 1, and some of the local SEH funcations. Add a __APPLE__ guard around these as well, so they're properly included.
The .byte issue is still present that @janvorli pointed out. I tried the .macro suggestion, but OS X generated a reloc, and the smallest reloc size they support is 3 bytes. I'm open to discussion other possibilities. Perhaps its best to let OS X pad the jumps out, and fix the calculation on the patching side? |
Few details:
#if defined(__APPLE__)
static const char * const coreClrDll = "libcoreclr.dylib";
#else
static const char * const coreClrDll = "libcoreclr.so";
#endif by static const char * const coreClrDll = MAKEDLLNAME_A("coreclr");
|
I am sorry, github has renamed the clang and llvm in my previous post |
Regarding the short jump issue, I just got an idea which probably won't change anything, but still is worth trying. Could you please try to replace the labels of the jumps with numeric labels and put the respective numeric label to the place where the jump should land? Maybe from the fact that these are short range labels, the assembler would decide to put in the short versions.
|
…th the rest of the PAL
|
With the short jump issue, numeric lables (or text) are fine for jumping without a reloc, but it goes back to generating the long jumps. |
Regarding 1), you're right, I've missed the fact that it is in the corerun.cpp. So please leave it as it is. |
Hmm, so it seems to me that maybe we should let the assembler use the long versions and just put in more / less nops for Mac to achieve the proper alignment of the constants in instructions following the |
I'm happy to make the change that way. One quick question, the fast write barriers appear to use PATCH_LABEL to find the constants, but JIT_WriteBarrier does not. Can you point me to where its patch offsets are calculated so I can fit it up as well? |
This comment at the JIT_WriteBarrier should explain that: // This is used by the mechanism to hold either the JIT_WriteBarrier_PreGrow
// or JIT_WriteBarrier_PostGrow code (depending on the state of the GC). It _WILL_
// change at runtime as the GC changes. Initially it should simply be a copy of the
// larger of the two functions (JIT_WriteBarrier_PostGrow) to ensure we have created
// enough space to copy that code in. Currently it is a copy of the JIT_WriteBarrier_PreGrow64, so if you make changes to JIT_WriteBarrier_PreGrow64, you should make the same ones to the JIT_WriteBarrier. |
The write barriers are the most performance sensitive helpers. It would be really nice to keep them on the short jump plan, so that they are as small as possible. I think that the jumps emitted via hardcoded bytes is the best solution - as it is right now - is the best solution among the ones discussed. |
#determine nproc in a platform independent way | ||
NPROCS=1 | ||
OS=`uname` | ||
|
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 should not be needed anymore
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.
Fixed in 854c2ae
LGTM, modulo the feedback above |
…ssembly version is guarded on _DEBUG like the original
…afety with the compiler
I believe that addresses everything (again 👍) Would you like me to squash again, or is it ok as is? |
LGTM |
Thanks a lot! |
My pleasure, thanks for the quick merge and review. On to fixing more tests now 👍 |
@kangaroo I got one idea about the assembler on clang complaining about the missing macro parameters. Could you please try to add "=" to the Handler parameter to indicate the parameter has a default value that is empty as follows: |
Nope: /var/folders/_s/vb2gh7xn20l2wrvvlrf7mpd80000gn/T/virtualcallstubamd64-dd3c5b.s:281:41: error: macro argument 'Handler' is missing |
Ok, thanks for testing it. |
Supports building up the VM, PAL and various components on Mac OSX 10.10
There are some oddities with the Apple assembler not generating short jumps
and not supporting 1 byte relocs.
This is a continuation of #105 since GitHub cannot detect my new squashed commit.