Skip to content

Commit f128644

Browse files
authored
Merge pull request #251672 from Homebrew/kapacitor-arm64-linux
kapacitor: work around patchelf.rb bug when cgo is required
2 parents 6fa6f18 + c2a727d commit f128644

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Formula/k/kapacitor.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ def install
4242
# `flux` Workaround for `error: private item shadows public glob re-export`
4343
ENV.append_to_rustflags "--allow hidden_glob_reexports"
4444

45+
# Workaround to avoid patchelf corruption when cgo is required (for flux)
46+
if OS.linux? && Hardware::CPU.arch == :arm64
47+
ENV["CGO_ENABLED"] = "1"
48+
ENV["GO_EXTLINK_ENABLED"] = "1"
49+
ENV.append "GOFLAGS", "-buildmode=pie"
50+
end
51+
4552
resource("pkg-config-wrapper").stage do
4653
system "go", "build", *std_go_args, "-o", buildpath/"bootstrap/pkg-config"
4754
end

0 commit comments

Comments
 (0)