Skip to content

Commit

Permalink
-fPIC: Windows is fully position independent, some compiler may error…
Browse files Browse the repository at this point in the history
… on -fPIC
  • Loading branch information
mratsim authored Jan 9, 2024
1 parent 96f16ba commit ad8e2d9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions constantine.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,10 @@ task make_lib, "Build Constantine library":
task make_lib_rust, "Build Constantine library (use within a Rust build.rs script)":
doAssert existsEnv"OUT_DIR", "Cargo needs to set the \"OUT_DIR\" environment variable"
let rustOutDir = getEnv"OUT_DIR"
# Compile as position independent, since rust does the same by default
genStaticLib(rustOutDir, rustOutDir/"nimcache", "--passC:-fPIC")
# Compile as position independent, since rust does the same by default
let extflags = if defined(windows): "" # Windows is fully position independent, flag is a no-op or on error depending on compiler.
else: "--passC:-fPIC"
genStaticLib(rustOutDir, rustOutDir/"nimcache", extflags)

proc testLib(path, testName: string, useGMP: bool) =
let dynlibName = if defined(windows): "constantine.dll"
Expand Down

0 comments on commit ad8e2d9

Please sign in to comment.