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

cc-wrapper: More intelligent sierra hack #29935

Merged

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Sep 29, 2017

Motivation for this change

Forward port #29096 from 17.03. Sorry I didn't do this earlier.

Things done

Normal hashes unchanged, as the cctools patch is opt-in.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @ElvishJerricco @luigy

Patch is drawn from [1], made a PR at [2].

Eventually, we might consider doing something for GNU binutils too, in
order that we switch (the normal) ld-wrapper to always use this to
leverage ld to resolve libraries, rather than faking it in bash.

[1]: https://github.com/obsidiansystems/cctools-port/tree/libs-normalize
[2]: tpoechtrager/cctools-port#34
Also fix numberous bugs, such as:

 - Not getting confused on more flags taking file arguments.

 - Ensuring children reexport their children, but the original
   binary/library doesn't.

 - Not spawning children when it turns out we just dynamically link
   under the threshold but our total number of inputs exceeeds it.

 - Children were always named `libunnamed-*`, when that name was
   supposed to be the last resort only.

In addition to the script, we also patch ld-wrapper to respect `.dylib`
and `.so` alike. In a future version of nixpkgs, this can be so enabled
by defaut. Newer nixpkgs will probably do this by default.
@jtojnar
Copy link
Contributor

jtojnar commented Dec 14, 2017

Sorry, accidentaly deleted release-17.09 branch

@jtojnar jtojnar reopened this Dec 14, 2017
@Ericson2314 Ericson2314 merged commit 3e3bee0 into NixOS:release-17.09 Jan 17, 2018
@Ericson2314 Ericson2314 deleted the appease-sierra-linker-17.09 branch January 17, 2018 23:28
@ElvishJerricco
Copy link
Contributor

Is it documented anywhere what exactly is going on here? Very confusing.

@Ericson2314
Copy link
Member Author

Sorry it isn't. Just the comments in the original PRs. I can add some.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants