Skip to content

Commit b835b9d

Browse files
committed
restish: work around patchelf.rb bug when cgo is required
1 parent 2bc1b16 commit b835b9d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Formula/r/restish.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class Restish < Formula
1919
depends_on "go" => :build
2020

2121
def install
22+
# Workaround to avoid patchelf corruption when cgo is required (for crypto11)
23+
if OS.linux? && Hardware::CPU.arch == :arm64
24+
ENV["CGO_ENABLED"] = "1"
25+
ENV["GO_EXTLINK_ENABLED"] = "1"
26+
ENV.append "GOFLAGS", "-buildmode=pie"
27+
end
28+
2229
system "go", "build", *std_go_args(ldflags: "-s -w -X main.version=#{version}")
2330

2431
generate_completions_from_executable(bin/"restish", "completion")

0 commit comments

Comments
 (0)