From 5d83c8f3b879bf99f06ac5b7150b08c8fe928ee6 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 6 Aug 2022 13:47:18 -0700 Subject: [PATCH] fix: do not use -fPIC on Windows --- cli/loader/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index e71001a4..2c268347 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -395,7 +395,6 @@ impl Loader { } else { command .arg("-shared") - .arg("-fPIC") .arg("-fno-exceptions") .arg("-g") .arg("-I") @@ -403,6 +402,10 @@ impl Loader { .arg("-o") .arg(&library_path); + if !cfg!(windows) { + command.arg("-fPIC"); + } + if self.debug_build { command.arg("-O0"); } else {