-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
glibc: add enableCopyLibGccHack #210112
glibc: add enableCopyLibGccHack #210112
Conversation
What is the plan to turn this flag off? I am pretty sure it cannot be turned off conditionally based on architecture, as right now that copy is the one loaded dynamically by glibc at runtime for certain pthread functions. It will abort if it can't be found. The fact that it's from the wrong GCC and causes linker errors is sort of a separate issue. But once that issue is fixed then we can just remove the |
This PR turns off |
I think the hack is no longer necessary for bootstrap, but it is still necessary (or at least currently supports) for programs which uses pthreads. Please try to build |
Indeed, I have observed the failure you describe. I will investigate. |
This seems to be a |
Yes, I provided additional context in #208412, particularly in option 2. glibc seems to need to dynamically load it in support of pthreads. To me the crime is not that there is a |
Root cause:
If killing threads needs compiler-specific information (which it probably does), what's supposed to happen when you compile two If |
The crime is that
The solution to the closure size concern is to move |
Added an explanation of the real reason why this hack was put in place. |
This is not quite the correct explanation, glibc itself does the abort and the application cannot stop it from happening in any way. You can see If you simply Google I don't think adding the extra output is a bad solution, but it will then require a hack to GCC to link it into every program which uses pthreads or even glibc to be safe. It is also probably smart to update the comment in nixpkgs to the current state of the problem. |
guix have their gcc patched so it will add libgcc to all libraries they build btw: https://github.com/guix-mirror/guix/blob/5e4ec8218142eee8e6e148e787381a5ef891c5b1/gnu/packages/gcc.scm#L243 |
Thanks, fixed
You provided the same example I did --
I have an implementation of that and am testing it now.
I don't believe so. The |
As explained in my previous comments
How does this happen? It is not currently as |
As explained in my previous comments and commits
We seem to be talking past each other. |
My point is I don't understand why it matters what glibc could actually do, the problem today is that it does need Do you propose changing (or at least make a note that it could be changed in the future) glibc to need |
That would be nice. But the politicking required to get it merged is not something I have time for. It would also be nice if they had not deleted the old implementation that did not need |
@Mic92, thank you so much for this link. The most important part of that link is that it links to this mailing list posting. That was incredibly helpful. I bet that explains why all previous attempts to pull |
Proof of concept of removing the hack completely here. Can you point me to the commit which puts |
Can this be closed? |
Yep. |
Description of changes
There has been much wailing and gnashing of teeth over the "libgcc copying hack":
To facilitate the excision of this foulness, let's provide an option (on by default) for it. Turning this option off will be a first step towards removing the hack.
Things done