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

ghc: Misc cross fixes #47626

Merged
merged 3 commits into from Oct 1, 2018
Merged

Conversation

Ericson2314
Copy link
Member

Motivation for this change

Things needed for consistency, and for mobile builds.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

We really need to abstract to avoid these copy-paste errors.
Other patches are also needed for a working build, but that doesn't mean
these patches are any less necessary.
@@ -239,4 +239,8 @@ stdenv.mkDerivation rec {
inherit (ghc.meta) license platforms;
};

}
} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
dontStrip = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds okay for now, but eventually we should try to track down what is happening here. It must be a bug in binutils & patchelf, right? In theory android should just be using standard ELFs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's simpler/stupider than that: a problem from using prebuilt tools. I think if we used the prebuilt tools for gccCrossStageStatic and then built our own stage final GCC it would work fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense. It's surprising that the prebuilt tools would not work though? At least they shouldn't break stuff. Since this is probably needed everywhere, is there a way to set this globally for all prebuilt android?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I take it back; I actually do remember a strip bug with the wrong strip mangling the binary. My newer setup hook included a largely untested provision to do one or the other strip, but if they

There is a bunch of dontStrip for cross scattered about that i don't think has been systematically investigated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea what the don't patchelf side of it about. I could try removing that across the board after reunification. :)

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

3 participants