-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 #5459 #6220
Conversation
@@ -108,6 +110,24 @@ static void jl_load_sysimg_so(char *fname) | |||
if (sysimg_handle != 0) { | |||
sysimg_gvars = (jl_value_t***)jl_dlsym(sysimg_handle, "jl_sysimg_gvars"); | |||
globalUnique = *(size_t*)jl_dlsym(sysimg_handle, "jl_globalUnique"); | |||
const char *cpu_target = (const char*)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_target"); | |||
if (strcmp(cpu_target,jl_cpu_string) != 0) | |||
jl_error("Julia and the system image were compiled for different architectures."); |
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.
"Please delete or regenerate sys.{so,dll,dylib}."
Yeah, let's go ahead and do this. I didn't realize |
Is there a reason we want to load the |
Loading the |
This is pretty cool! But the LLVM header Hm, not Julia's fault, it's MinGW-w64's fault, see https://github.com/mirror/mingw-w64/blob/master/trunk/mingw-w64-headers/crt/sys/stat.h#L253-L261 and https://github.com/mirror/mingw-w64/blob/master/trunk/mingw-w64-headers/crt/stdio.h#L466-L483 - |
These should really go in CPPFLAGS, but apparently on mingw, there's defines in the stdio headers that rename the function (rather than doing it on a symbol lelve), so we can't use this when we include LLVM headers. Anyway, as long as we don't call the IO functions from C++ we should be fine.
Probably causes other breakage, but adding
right after the Windows-only Using
|
I just moved the |
The cpuid thing seems stupid. I'll just rename it to |
Not so sure about ok on all platforms though?
|
Try |
Nope. Still undefined reference. Moving The inline assembly may give MSVC trouble, but that might just require putting |
Strange. I see |
I was trying both http://gist.github.com/9657225 http://i.imgur.com/lz45tQf.png (ignore the duplicate leaf stuff, it's a recent Cygwin binutils bug, should be harmless - oh and I was deleting |
Alright, I moved jl_cpuid out of the __SSE. I'll merge later tonight. |
@@ -108,6 +110,26 @@ static void jl_load_sysimg_so(char *fname) | |||
if (sysimg_handle != 0) { | |||
sysimg_gvars = (jl_value_t***)jl_dlsym(sysimg_handle, "jl_sysimg_gvars"); | |||
globalUnique = *(size_t*)jl_dlsym(sysimg_handle, "jl_globalUnique"); | |||
const char *cpu_target = (const char*)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_target"); | |||
if (strcmp(cpu_target,jl_cpu_string) != 0) | |||
jl_error("Julia and the system image were compiled for different architectures.\n" |
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.
"Julia and the System Image" is our new band name.
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.
Unfortunately, this breaks compatibility with llvm-svn:
Fixing the most of these is trivial (some of the same API changes as in #5984), but my C++ template-foo isn't up to the task of properly fixing the second error. Here's a patch set (I'm not submitting this as a PR since it punts on creating an OwningPtr and uses a std::unique_ptr instead — but shouldn't they be equivalent now?):
|
Thanks @ihnorton ! |
@loladiro could we switch to llvm::Host instead of our own cpuid in assembly? llvm::Host has a bunch of logic already to deal with various arm flavors... |
I tried to make that work for the longest time, but couldn't. If you have working code, I'm all in favor. |
We still need our own cpuid in |
We can't access the necessary registers on ARM in user mode (so, effectively never AFAICT). It appears that the way everyone (llvm, android) does this is by reading |
This combines the .o emission code from #5787 (without the .o loading code that required LLVM3.5) with some error checking code for cpuid mismatch. When releasing a binary, set JULIA_CPU_TARGET to "core2" (we discussed that this is a reasonable minimum) in your Make.user and everything should work just fine.
@JeffBezanson
@vtjnash (if you want to look it over)