-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[Linux] Force the inclusion of the backtracing code when static linking. #68671
Conversation
When we're statically linking the standard library, we need to force the inclusion of the backtracing code in the runtime, otherwise we don't get on-crash backtraces. Also, add a test to make sure that this works. rdar://115774613
@swift-ci Please test |
Explanation: When using |
When we're building with host tools, we should use the host's swiftrt.o and not the one we've just built when we're trying to build tools that we will run on the host system. rdar://115774613
@swift-ci Please test |
Can we get this cherrypicked onto the next 5.9 monthly release? Additionally is there a workaround for current applications? |
@al45tair This is not sufficient for backtracing to work in statically linked executables. There are two other major issues:
In short, it doesn't work (very well) with statically linked binaries anyway 😕. As an aside, as a workaround for the linkage problem in 5.9.0 that this PR addresses, it is sufficient to add |
I'm aware of that (and, actually, on Glibc at least, I think you can also put a copy of I have a better solution in mind in the longer term.
I'm aware of the various reasons people might want a statically linked executable. I'm also working on a statically linked
There is already a 5.9 cherrypick.
As Gwynne says, you could do this:
|
We want the static version of Dispatch here. If we don't use that version, we'll fail the tests on the release branches (but strangely not on main for some reason). rdar://115774613
@swift-ci Please test |
When we're statically linking the standard library, we need to force the inclusion of the backtracing code in the runtime, otherwise we don't get on-crash backtraces.
Also, add a test to make sure that this works.
rdar://115774613