-
-
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
[build] Mass-update JLL versions to get codesigned libraries on Darwin #39719
Conversation
I'll need to look over all of the changes to the JLLs but the changes here look good |
It's still failing tests so there's likely something wrong. I will try to fix it today. |
61f974e
to
b6c60b2
Compare
There's an issue with OpenBLAS and FreeBSD/MacOS. For some reason, when OpenBLAS tries to initialize itself to the I have identified the issue as being triggered by the recent change to set |
Turns out that OpenBLAS 0.3.12 and earlier have some kind of `clang`-related code generation bug when built like this. The issue is that the call to `gotoblas->init()` here [0] does not actually call `init` but instead calls `ztrsm_olnncopy`, presumably because of some struct layout issue. I briefly looked into it, but since it only effects `clang` and doesn't effect `0.3.13`, I'm taking the coward's way out and just not poking the compiler bear. [0] https://github.com/xianyi/OpenBLAS/blob/v0.3.10/driver/others/dynamic.c#L921 X-ref: JuliaLang/julia#39719
…2598) Turns out that OpenBLAS 0.3.12 and earlier have some kind of `clang`-related code generation bug when built like this. The issue is that the call to `gotoblas->init()` here [0] does not actually call `init` but instead calls `ztrsm_olnncopy`, presumably because of some struct layout issue. I briefly looked into it, but since it only effects `clang` and doesn't effect `0.3.13`, I'm taking the coward's way out and just not poking the compiler bear. [0] https://github.com/xianyi/OpenBLAS/blob/v0.3.10/driver/others/dynamic.c#L921 X-ref: JuliaLang/julia#39719
b6c60b2
to
9ae5d70
Compare
Looks like that was the only issue! |
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.
Also, there's an empty file deps/checksums/llvm-tools
bc376db
to
0aea071
Compare
@Keno building this branch on Apple Silicon (with this [0] patch applied) ends up taking this branch and I get the following error during bootstrap:
Could this be indicative that our PCRE patch is insufficient? I hear that this does not happen to @omus. |
Could there me some entitlement thing for JIT permissions that gets turned on when you codesign it? |
I checked for entitlements, but it claims this library has none:
|
Right, I'm suggesting it might need them if codesign is turned on |
I don't think so; these things aren't codesigned in the normal way, this is just the signing that the linker does to every executable. I don't have any entitlements, and I haven't opted into the hardened runtime. I can work around it by disabling the PCRE2 JIT but that's the only way. Compiling locally has the same problem. |
Well, the error suggests that a MAP_JIT mmap was rejected, which Darwin does like to do. No idea why it would happen if the hardened runtime isn't used though. |
This seems a bit big to backport and the discussion about the various problems make me think we should put this at the earliest into 1.6.1. 1.6.0 is really at a crucial bugfix only stage at this point. |
I agree with Kristoffer. We’ll have a special 1.6.1-alpha for aarch64-Darwin after 1.6.0 final is tagged. |
0aea071
to
8aa9074
Compare
I disabled SIP on my system a while ago to get lldb working (I forgot about this). I bet that enabling it again will cause the PCRE JIT issue |
Seems like re-enabling SIP does still not cause the PCRE JIT issue. |
Building a debug static SLJIT_INLINE void* alloc_chunk(sljit_uw size)
{
void *retval;
const int prot = PROT_READ | PROT_WRITE | PROT_EXEC;
int flags = MAP_PRIVATE | MAP_ANON | SLJIT_MAP_JIT;
retval = mmap(NULL, size, prot, flags, -1, 0);
if (retval == MAP_FAILED)
return NULL;
if (mprotect(retval, size, prot) < 0) {
munmap(retval, size);
return NULL;
}
SLJIT_UPDATE_WX_FLAGS(retval, (uint8_t *)retval + size, 0);
return retval;
} We get to the
Just to be sure, I re-codesigned everything with explicit
But this doesn't improve anything; I still get the same error. |
Aha; looks like the issue is that I'm running MacOS 11.2: zherczeg/sljit#99 |
Okay so the fundamental issue is that it's illegal to |
Looks like there's already a patch for this: zherczeg/sljit#105 |
bca401c
to
aa8ded0
Compare
Looks like something is wrong with the openblas aarch64 build? |
40d2f81
to
c609a2e
Compare
This now builds cleanly on Apple silicon for me, with the exception of the patch needed to comment out the |
I plan to merge this when green. |
On Apple Silicon, we need ad-hoc code signatures on all libraries. This mass rebuild of the dependencies provides signed versions of all libraries on both `x86_64-apple-darwin` and `aarch64-apple-darwin`
c609a2e
to
db1c340
Compare
Interesting failure. Looks unrelated |
CI had a hickup, I've restarted it. |
On Apple Silicon, we need ad-hoc code signatures on all libraries. This
mass rebuild of the dependencies provides signed versions of all
libraries on both
x86_64-apple-darwin
andaarch64-apple-darwin