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
patchelf: add patch: false alarm for non overlapping sections #106340
Conversation
Oh no. This patch was actually intended for staging. But I also see a branch called staging-patchelf. Not sure which one is correct. Should I re-create the pull request with one of those branches? Sorry for the confusion! |
Are you sure it fixes the problem? My testing of NixOS/patchelf#255 shows that the error still persists |
No. Sorry! I probably glanced over the error messages too quickly and failed to spot the difference. I just tested NixOS/patchelf#255 and the error persists with the patch attached in the pull request at hand. However, it does fix the tsm-client build. So these are likely two different bugs. I'll update the commit message and the text of my pull request accordingly. |
Starting with version 0.12, patchelf sometimes returns an error complaining about overlapping sections: > unsupported overlap of SHT_NOTE and PT_NOTE This issue was reported for tsm-client: NixOS#106257 There is a patch available in this pull request: NixOS/patchelf#230 This patch fixes tsm-client, maybe other packages as well. This commit adds the patch to the nixpkgs patchelf build recipe. Note that the patch may also be downloaded directly here: https://github.com/NixOS/patchelf/pull/230.patch However, in contrast to common nixpkgs policy, the patch is not fetched with fetchpatch, but is copied directly into nixpkgs tree. This is necessary because patchelf is a dependency of fetchpatch. See also the note at the top of the patchelf build recipe in pkgs/development/tools/misc/patchelf/default.nix .
I marked this as stale due to inactivity. → More info |
|
||
for (unsigned int j = 0; j < phdrs.size(); ++j) | ||
- if (rdi(phdrs[j].p_type) == PT_NOTE) { | ||
+ if (rdi(phdrs[j].p_type) == PT_NOTE && noted_phdrs.find(j) == noted_phdrs.end()) { |
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.
I can also make a release of patchelf itself.
This is part of patchelf 0.13. |
Motivation for this change
Starting with version 0.12, patchelf sometimes returns an error complaining about overlapping sections. The build of tsm-client reports the following error message
see #106257
There is a patch available in this patchelf pull request: NixOS/patchelf#230
The pull request at hand adds the patch to the nixpkgs patchelf build recipe. This fixes the
tsm-client
package, maybe more.Note on local tests
Due to lack of machine power, I cannot fully test this commit. It tries to rebuild stdenv again, and would even try to build the whole world to obtain a NixOS system for testing.
However, I tested the patch by building the attached recipe with current nixos-unstable (
83cbad92d73
) and also with current nixos-20.09 (3a02dc9edb2
). This generates a working patchelf alone, then uses a modified autoPatchelfHook to inject the fixed patchelf into thePATH
of the tsm-client build. It makes tsm-client build correctly (on unstable and on 20.09).Note that the attached recipe below can also be used as a workaround to build a working tsm-client.
tsm-client-fix.nix.txt
Notifying patchelf maintainer: @edolstra
Things done
See the note on local tests above.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
: too much./result/bin/
): indirectly tested, by buildingtsm-client
nix path-info -S
before and after): 39,441,192 Bytes + 240 Bytes = 39,441,432 Bytes (this is the increase measured with the patchelf build by the attached recipe)