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

Rebuild libjulia+jll 1.5 with fixed libunwind linkage #2164

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

fingolfin
Copy link
Member

The ultimate goal of this PR is to resolve the linker issue reported here based on the pointers by @benlorenz.

For now I just enabled LibUnwind_jll as a dependency to see what goes wrong, if anything. This can't be the final version, though, as we must also make sure not to break Julia 1.3 and 1.4.

@benlorenz
Copy link
Contributor

More pointers:
LIBOSXUNWIND is not defined in the build output, since there is no code in Make.inc to set that variable for the USE_SYSTEM_LIBUNWIND case on Darwin. I am not really sure why that case is not covered at all there, but I would think that this variable should be set here.
A fix for that rec_backtrace_ctx error is included in 1.5.3.
Have a look at what I posted in an earlier libjulia pull request here: #1951 (comment)

@fingolfin fingolfin force-pushed the mh/libjulia-1.5-unwind branch 2 times, most recently from a084f39 to 414ba72 Compare November 24, 2020 00:39
@benlorenz
Copy link
Contributor

Using the Dependency pulls in LibOSXUnwind_jll version 0.0.5 which doesn't contain a proper shared library (just some stub). The build system would use 0.0.6+0 instead which contains a valid dylib.
The reason is probably that the update from 0.0.6+0 to 0.0.6+1 added a julia compat restriction to 1.6 for all 0.0.6 versions, see #2038 and JuliaRegistries/General#24077

@fingolfin
Copy link
Member Author

sigh. of course.

Anyway, I actually tried to just disable use of libunwind by setting DISABLE_LIBUNWIND, based on the rationale that we just want to use the produced libjulia.dylib during build time, but never during runtime, so there should be no need for unwinding. That resulted in a ton of build failures, though, which is why I abandoned it late last night. I'll give it another try now, locally...

@benlorenz
Copy link
Contributor

Linking it statically instead seems to work here, i.e.:

        LIBUNWIND:=${libdir}/libosxunwind.a

(At least for the build, I have not tested the resulting library)

@fingolfin
Copy link
Member Author

Yeah, and disabling use of libunwind also works locally here... but not (yet?) in the BB file. I am playing with that right now, though

Also upgrade to Julia 1.5.3 to fix macOS compile error related to
rec_backtrace_ctx.
@fingolfin fingolfin marked this pull request as ready for review November 24, 2020 11:22
@fingolfin
Copy link
Member Author

OK, using DISABLE_LIBUNWIND=1 simply is broken in the Julia build system, at least on macOS and in Julia 1.5 and master: it results in compilation errors:

./signals-mach.c:293:51: error: expected expression
        jl_critical_error(SIGSEGV, (unw_context_t*)&state,
                                                  ^
./signals-mach.c:293:37: error: use of undeclared identifier 'unw_context_t'
        jl_critical_error(SIGSEGV, (unw_context_t*)&state,
                                    ^
./signals-mach.c:503:13: error: use of undeclared identifier 'unw_context_t'
            unw_context_t *uc;
            ^
...

But the static compilation trick suggested by @benlorenz seems to work, as in: the build completes and the resulting libjulia.dylib has no unresolved references to unwind related symbols. But whether it works in the sense of "the resulting binary resolve the issues in PR #2158" remains to be seen.

Testing this w/o just merging this PR is a bit of a pain, though; gotta build the JLL locally, then build the next JLL (see #2158) using the first one. Perhaps we can simply merge this PR (it shouldn't make anything worse, after all)?

@benlorenz
Copy link
Contributor

Do we need to verify that 1.3 and 1.4 still build with this change?

@fingolfin fingolfin changed the title WIP: Rebuild libjulia+jll 1.5 with fixed libunwind linkage Rebuild libjulia+jll 1.5 with fixed libunwind linkage Nov 25, 2020
@fingolfin
Copy link
Member Author

Pushing Julia 1.3 and 1.4 here now to see if they still build

@fingolfin
Copy link
Member Author

Seems they all still build just fine. I've removed that HACk commit again.

So yeah, this could be merged... @giordano ?

@giordano giordano merged commit 13aaa47 into JuliaPackaging:master Nov 25, 2020
@fingolfin fingolfin deleted the mh/libjulia-1.5-unwind branch November 25, 2020 22:54
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.

3 participants