Skip to content

Commit

Permalink
more rpath for libsilkworm search
Browse files Browse the repository at this point in the history
on Linux search relative to $ORIGIN (see https://stackoverflow.com/a/72577483/1009546 )
on macOS it should search relative to @executable_path, but Go doesn't support it:
golang/go#40559
  • Loading branch information
battlmonstr committed Dec 14, 2023
1 parent b5475c6 commit d4ec8a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions link_linux_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ package silkworm_go

// #cgo LDFLAGS: -lsilkworm_capi
// #cgo LDFLAGS: -L${SRCDIR}/lib/linux_arm64
// #cgo LDFLAGS: -Wl,-rpath,$ORIGIN
// #cgo LDFLAGS: -Wl,-rpath,$ORIGIN/../lib
// #cgo LDFLAGS: -Wl,-rpath ${SRCDIR}/lib/linux_arm64
import "C"
2 changes: 2 additions & 0 deletions link_linux_x64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ package silkworm_go

// #cgo LDFLAGS: -lsilkworm_capi
// #cgo LDFLAGS: -L${SRCDIR}/lib/linux_x64
// #cgo LDFLAGS: -Wl,-rpath,$ORIGIN
// #cgo LDFLAGS: -Wl,-rpath,$ORIGIN/../lib
// #cgo LDFLAGS: -Wl,-rpath ${SRCDIR}/lib/linux_x64
import "C"
2 changes: 2 additions & 0 deletions link_macos_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ package silkworm_go

// #cgo LDFLAGS: -lsilkworm_capi
// #cgo LDFLAGS: -L${SRCDIR}/lib/macos_arm64
// #cgo LDFLAGS: -Wl,-rpath,./
// #cgo LDFLAGS: -Wl,-rpath,./../lib
// #cgo LDFLAGS: -Wl,-rpath ${SRCDIR}/lib/macos_arm64
import "C"
2 changes: 2 additions & 0 deletions link_macos_x64.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ package silkworm_go

// #cgo LDFLAGS: -lsilkworm_capi
// #cgo LDFLAGS: -L${SRCDIR}/lib/macos_x64
// #cgo LDFLAGS: -Wl,-rpath,./
// #cgo LDFLAGS: -Wl,-rpath,./../lib
// #cgo LDFLAGS: -Wl,-rpath ${SRCDIR}/lib/macos_x64
import "C"

0 comments on commit d4ec8a8

Please sign in to comment.