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

nss: cross compile support #58063

Merged
merged 2 commits into from Jun 11, 2019
Merged

nss: cross compile support #58063

merged 2 commits into from Jun 11, 2019

Conversation

illegalprime
Copy link
Member

Motivation for this change

nss cross compilation! (important to cross compile NixOS)
at first my solution was really hacky but I got it down to be reasonable again.
should work for aarch64 & armv7l

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)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

"CROSS_COMPILE=1"
"NSS_DISABLE_GTESTS=1" # don't want to build tests when cross-compiling
"OS_TEST=${cpu}"
"CPU_ARCH=${cpu}"
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to use NATIVE_CC, OS_TEST and CPU_ARCH unconditionally, no?
This way we have less code that is only when cross-compiling.

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

Copy link
Member

Choose a reason for hiding this comment

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

Wait was this done? Oh as many were moved over as possible?

@veprbl veprbl added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Mar 23, 2019
@Mic92
Copy link
Member

Mic92 commented Mar 25, 2019

@GrahamcOfBorg build nss

@illegalprime
Copy link
Member Author

i cannot test this on darwin unfortunately :(

@Mic92
Copy link
Member

Mic92 commented Mar 26, 2019

This seems like a regression though. The offending line looks like this:

#if defined (__i386__) || defined(__x86_64__)
#include "i386/_types.h"
#else
#error architecture not supported
#endif

I currently blame CPU_ARCH for that. I suppose in that case we should move it back to cross-compiling.

@Mic92
Copy link
Member

Mic92 commented Mar 27, 2019

@GrahamcOfBorg build nss

@flokli
Copy link
Contributor

flokli commented May 17, 2019

@GrahamcOfBorg build pkgsCross.aarch64-multiplatform.nss

@matthewbauer matthewbauer merged commit fc04ec9 into NixOS:master Jun 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cross-compilation Building packages on a different sort platform than than they will be run on 10.rebuild-darwin: 11-100 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants