From 1784a1ab0fbd242f5063df0ad5325d38a971cc32 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 8 Feb 2017 16:55:57 -0800 Subject: [PATCH] rustbuild: Pass -fPIC on 32-bit non-Windows platforms This is a smaller and more targeted backport of #39523 which drives to the heart of the issue, just passing `-fPIC` on 32-bit platforms. More rationale for this commit can be found in #39523 itself. --- src/bootstrap/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index db2fe2db813a6..c98dd4751f6c1 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -843,6 +843,11 @@ impl Build { }, _ => {}, } + + if !target.contains("windows") && target.contains("i686") { + base.push("-fPIC".into()); + } + return base }