From 362bdf209fe8e941eef7db3c90d06447825f916a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 31 Oct 2014 22:03:59 -0700 Subject: [PATCH] Be sure to compile with -fPIC --- src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 206dcbe0e..7f967d2a1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,6 +32,10 @@ pub fn compile_library(output: &str, files: &[&str]) { cmd.arg("-m64"); } + if !target.as_slice().contains("i686") { + cmd.arg("-fPIC"); + } + let src = Path::new(os::getenv("CARGO_MANIFEST_DIR").unwrap()); let dst = Path::new(os::getenv("OUT_DIR").unwrap()); let mut objects = Vec::new();