Skip to content
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

Update libjulia 1.12.0-DEV to latest master #9331

Merged
merged 11 commits into from
Sep 3, 2024

Conversation

fingolfin
Copy link
Member

There were several breaking kernel API changes

Will need this to update GAP related JLLs.

Perhaps we should also update 1.11 to rc3? Dunno if there were relevant changes.

CC @benlorenz

There were several breaking kernel API changes
@benlorenz
Copy link
Contributor

benlorenz commented Aug 30, 2024

There is one api change in julia.h between 1.11-beta1 and rc3:

-JL_DLLEXPORT jl_binding_t *jl_get_binding_wr(jl_module_t *m JL_PROPAGATES_ROOT, jl_sym_t *var);
+JL_DLLEXPORT jl_binding_t *jl_get_binding_wr(jl_module_t *m JL_PROPAGATES_ROOT, jl_sym_t *var, int alloc);

There are also some newly exported functions jl_getaffinity and jl_setaffinity, so I think it makes sense to upgrade the 1.11 version.

Various FreeBSD builds are failing with something similar to JuliaLang/julia#54533, so we might need -Wl,--undefined-version there.

1.11 for x86_64 apple seems to hitting JuliaLang/julia#52067.

1.12 for apple fails with

[09:14:18] /workspace/srcdir/julia/src/threading.c:376:5: error: call to undeclared function 'unw_ensure_tls'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
[09:14:18]   376 |     unw_ensure_tls();

which comes from JuliaLang/julia#55049 but this should be libunwind specific and not active for llvmunwind which we are using for apple?
Edit: The variable LLVMLIBUNWIND for the check is only defined in the USE_SYSTEM_UNWIND=0 branch here.

@fingolfin
Copy link
Member Author

Thank you for the analysis @benlorenz, very helpful as always!

I've updated to 1.11.0-rc3. I don't have time to look into the rest right now, maybe later or monday (of course everyone is welcome to push additional fixes in the meantime).

@benlorenz
Copy link
Contributor

benlorenz commented Aug 30, 2024

I have added fixes for the freebsd issue and the llvmlibunwind issue.

A PR for the unwind issue: JuliaLang/julia#55639
It might make sense to keep the extra flag here for older julia versions even if the PR is merged.
It did not cause build issues so far but I think the build previously used some wrong code paths, which luckily don't make a difference for the binaries that are built against libjulia.

Not sure yet how to deal with the __truncsfbf2 llvm issue (JuliaLang/julia#52067) on x86_64 macos (julia 1.11, 1.12).

[14:44:08] ld64.lld: error: undefined symbol: __truncsfbf2
[14:44:08] >>> referenced by runtime_intrinsics.c:381
[14:44:08] >>>               ./runtime_intrinsics.o:(symbol julia__truncsfbf2+0x20)
[14:44:08] >>> referenced by runtime_intrinsics.c:387
[14:44:08] >>>               ./runtime_intrinsics.o:(symbol julia__truncdfbf2+0x64)

fingolfin pushed a commit to JuliaLang/julia that referenced this pull request Aug 31, 2024
Assuming non-windows and libunwind not disabled:

The flag `-DLLVMLIBUNWIND` is currently set on macos only for
`USE_SYSTEM_UNWIND=0` which seems wrong to me and causes build issues
for macos on Yggdrasil in combination with the recent
#55049 which should only affect
gnu libunwind (`error: call to undeclared function 'unw_ensure_tls'`).
This flag is now set independently of the system-libunwind flag (on
Darwin and OpenBSD as before).

`LIBUNWIND=-lunwind` is set for `USE_SYSTEM_UNWIND=0` ||
`USE_SYSTEM_UNWIND=1` && `OS != Darwin`.
I don't think the check for Darwin make sense and might be a leftover
from using osxunwind a (long) while ago.
Changed that to always set `-lunwind` if enabled.

x-ref: JuliaPackaging/Yggdrasil#9331
@fingolfin
Copy link
Member Author

Seems to build now with my latest patch. @benlorenz could you please double check what I did?

L/libjulia/common.jl Outdated Show resolved Hide resolved
@benlorenz
Copy link
Contributor

Seems to build now with my latest patch. @benlorenz could you please double check what I did?

I don't know much about this but it seems reasonable from the discussion in that issue, we are now blocking the b16 instrinsic on x86_64 darwin. It falls back to the xmm code and the compiler seems happy with this.
The fix for julia will probably need some version bound on the fixed clang version but I don't think we need that here.

L/libjulia/common.jl Outdated Show resolved Hide resolved
L/libjulia/common.jl Outdated Show resolved Hide resolved
@benlorenz
Copy link
Contributor

I guess we should also update the jllversion in the build_tarballs.jl file?

fingolfin and others added 3 commits September 3, 2024 13:12
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
@fingolfin
Copy link
Member Author

Indeed (I could have sworn that I already updated jllversion but clearly I didn't).

Hmm, do we have any rules as to when we update the patch level vs. the minor version? I've now changed it to 1.10.11 but could just as well use 1.11.0 ...

@fingolfin fingolfin merged commit 0fca019 into JuliaPackaging:master Sep 3, 2024
18 checks passed
@fingolfin fingolfin deleted the mh/libjulia branch September 3, 2024 11:58
KristofferC pushed a commit to JuliaLang/julia that referenced this pull request Sep 12, 2024
Assuming non-windows and libunwind not disabled:

The flag `-DLLVMLIBUNWIND` is currently set on macos only for
`USE_SYSTEM_UNWIND=0` which seems wrong to me and causes build issues
for macos on Yggdrasil in combination with the recent
#55049 which should only affect
gnu libunwind (`error: call to undeclared function 'unw_ensure_tls'`).
This flag is now set independently of the system-libunwind flag (on
Darwin and OpenBSD as before).

`LIBUNWIND=-lunwind` is set for `USE_SYSTEM_UNWIND=0` ||
`USE_SYSTEM_UNWIND=1` && `OS != Darwin`.
I don't think the check for Darwin make sense and might be a leftover
from using osxunwind a (long) while ago.
Changed that to always set `-lunwind` if enabled.

x-ref: JuliaPackaging/Yggdrasil#9331
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants