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

gcc: fix cyclic dependency for Darwin cross-build #90526

Closed
wants to merge 1 commit into from
Closed

gcc: fix cyclic dependency for Darwin cross-build #90526

wants to merge 1 commit into from

Conversation

mroi
Copy link
Contributor

@mroi mroi commented Jun 15, 2020

When building a cross-compiler for Linux targets on Darwin hosts, the sanitizer libraries are built as Linux ELF shared objects. These binaries contain superfluous rpaths, causing a cyclic dependency between the out and lib outputs.

Manually pruning rpaths with patchelf fixes the issue. This should have no impact on non-cross builds.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Linux shared objects built on Darwin contain superfluous rpaths,
causing a cyclic dependency between the out and lib outputs
@parthy
Copy link
Contributor

parthy commented Jun 16, 2020

@mroi Are you aware of the discussion in #88213?

@mroi
Copy link
Contributor Author

mroi commented Jun 16, 2020

No I was not. Sorry about that. It describes exactly the problem I was seeing: rpaths in the sanitizer libraries caused dependency cycles because they have been moved to a separate output.

With my patch, I get a working cross-compiler. But I am not sure if there is a better way to fix this, like reverting d9feea5.

@TravisWhitaker
Copy link
Contributor

@Ericson2314 @matthewbauer what are your thoughts on this approach versus @Gaelan 's master...Gaelan:gcc-cross ?

@FRidh FRidh added this to WIP in Staging via automation Jul 2, 2020
@FRidh FRidh moved this from WIP to Needs review in Staging Jul 2, 2020
@mroi
Copy link
Contributor Author

mroi commented Aug 27, 2020

It has been decided to go with PR #88213. I am closing this one and suggest everyone to follow that PR.

@mroi mroi closed this Aug 27, 2020
Staging automation moved this from Needs review to Done Aug 27, 2020
@mroi mroi deleted the patch-gcc branch August 27, 2020 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Staging
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants