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

libffi: Does not build on OSX 10.7.5 #907

Closed
danieroux opened this issue Sep 3, 2013 · 4 comments
Closed

libffi: Does not build on OSX 10.7.5 #907

danieroux opened this issue Sep 3, 2013 · 4 comments

Comments

@danieroux
Copy link
Contributor

Started completely clean

sudo rm -rf /nix
rm ~/.nix-channels ~/.nix-profile
rm -rf ~/.nix-defexpr ~/.nixpkgs/
cd / && \
sudo tar xfj ~/Downloads/nix-1.5.3-x86_64-darwin.tar.bz2 && \
sudo chown -R danie /nix && \
nix-finish-install

Then build from #902

$ cd ~/source/nixpkgs && git rev-parse --verify HEAD
f6114a880eb859c8e034e461bfd6b63134dc1e0f
$ nix-env -Ki libffi -f ~/source/nixpkgs 2>&1 | tee /tmp/libffi.log

Fails to build

no such instruction: `vmovdqa %xmm0, (%rsi)'

Log files

@vcunat
Copy link
Member

vcunat commented Sep 3, 2013

Hmm, it does build on hydra, but there seem to be impurities, not just on darwin. At the very least we don't want the configure script to detect -march= according to the build machine (I see corei7-avx and amdfam10 in hydra logs). This can be serious, as many packages depend on libffi through mesa or llvm (I don't know how strongly they depend).

@vcunat
Copy link
Member

vcunat commented Sep 3, 2013

Would you try if the following patch solves this problem? It should make the resulting binaries portable, at least...

diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index 27c3e9f..3e71663 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -8,6 +8,9 @@ stdenv.mkDerivation (rec {
     sha256 = "077ibkf84bvcd6rw1m6jb107br63i2pp301rkmsbgg6300adxp8x";
   };

+  # no detection of -march= or -mtune=
+  configureFlags = [ "--enable-portable-binary" "--with-gcc-arch=generic" ];
+
   doCheck = true;

   postInstall =

@danieroux
Copy link
Contributor Author

Yes, that makes it build. Thank you!

vcunat added a commit that referenced this issue Sep 3, 2013
@vcunat
Copy link
Member

vcunat commented Sep 3, 2013

We should thank you. It was lucky that they misdetected architecture on your machine, otherwise we would still be distributing unportable libffi.

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

No branches or pull requests

2 participants