Skip to content

Commit

Permalink
Merge pull request leanprover-community#22 from goens/linux-build
Browse files Browse the repository at this point in the history
Add PIC for Linux builds
  • Loading branch information
marcusrossel authored Feb 28, 2024
2 parents 67e509f + 4238aaf commit 5b20019
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ target importTarget pkg : FilePath := do
let oFile := pkg.buildDir / "c" / "ffi.o"
let srcJob ← inputFile <| pkg.dir / "C" / "ffi.c"
buildFileAfterDep oFile srcJob fun srcFile => do
let flags := #["-I", toString (← getLeanIncludeDir)]
let flags := #["-I", toString (← getLeanIncludeDir), "-fPIC"]
compileO "ffi.c" oFile srcFile flags

extern_lib ffi pkg := do
Expand All @@ -23,7 +23,7 @@ extern_lib ffi pkg := do
buildStaticLib libFile #[job]

extern_lib egg_for_lean pkg := do
proc { cmd := "cargo", args := #["build", "--release"], cwd := pkg.dir / "Rust" }
proc { cmd := "cargo", args := #["rustc", "--release", "--", "-C", "relocation-model=pic"], cwd := pkg.dir / "Rust" }
let name := nameToStaticLib "egg_for_lean"
let srcPath := pkg.dir / "Rust" / "target" / "release" / name
IO.FS.createDirAll pkg.nativeLibDir
Expand Down

0 comments on commit 5b20019

Please sign in to comment.