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

lib/ vs lib64/ #8

Closed
milibopp opened this issue Jul 5, 2017 · 5 comments
Closed

lib/ vs lib64/ #8

milibopp opened this issue Jul 5, 2017 · 5 comments

Comments

@milibopp
Copy link

milibopp commented Jul 5, 2017

Just tried compiling this crate on a 64-bit NixOS system.

And I ran into the issue that the compiled native libffi ended up in a lib64/ folder, not in lib/. So changing line 23 of build.rs from

let libdir = Path::new(&prefix).join("lib");

to

let libdir = Path::new(&prefix).join("lib64");

made it compile for me. I assume a more robust solution would be to just add both variants to the search path for rustc?

For reference, this is the Nix expression I used to setup the environment:

with import <nixpkgs> {};

stdenv.mkDerivation {
  name = "libffi-rs-sys";
  src = ./.;
  LIBCLANG_PATH = "${llvmPackages.clang.cc}/lib";
  buildInputs = [ automake file gnum4 libtool clang texinfo autoconf rustc cargo ];
}
@tov
Copy link
Owner

tov commented Jul 5, 2017

Thanks for the report. I suppose we could just put both in the search path, unless there's a way to ask the environment for where to look?

@milibopp
Copy link
Author

milibopp commented Jul 6, 2017

Well, you could determine the architecture easily. But I wouldn't take the chance to assume, that it always corresponds. I bet you have compiled this with lib/ successfully on other 64-bit systems, otherwise this issue would have come up sooner.

One would have to figure out, how this is determined by autotools (I guess?). But then the build process probably becomes more tightly coupled to how libffi is built, which may be harder to maintain in the long run.

Should I create PR adding both to the search path?

@tov
Copy link
Owner

tov commented Jul 6, 2017

Unfortunately, 64-bit architecture doesn't necessarily mean it will be in lib64/, so I think we should just look in both, hoping there aren’t additional places to look. No need for a PR—I just pushed the change. Does it work for you?

@milibopp
Copy link
Author

milibopp commented Jul 7, 2017

Yes, it works now. Thanks! Closing this.

@milibopp milibopp closed this as completed Jul 7, 2017
@tov
Copy link
Owner

tov commented Jul 7, 2017

Okay, I am releasing this as 0.5.3. Thanks!

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