From 219a937fc2e01770e16850c317e970f39bbee43c Mon Sep 17 00:00:00 2001 From: Neved4 <63655535+Neved4@users.noreply.github.com> Date: Wed, 23 Oct 2024 19:15:41 +0200 Subject: [PATCH] Add `-gcflags` to `std_go_args` --- Library/Homebrew/formula.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 1bea34ff0f161..ceac979995011 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1837,12 +1837,16 @@ def std_configure_args(prefix: self.prefix, libdir: "lib") # Standard parameters for Go builds. sig { - params(output: T.any(String, Pathname), - ldflags: T.nilable(T.any(String, T::Array[String]))).returns(T::Array[String]) + params( + output: T.any(String, Pathname), + ldflags: T.nilable(T.any(String, T::Array[String])), + gcflags: T.nilable(T.any(String, T::Array[String])), + ).returns(T::Array[String]) } - def std_go_args(output: bin/name, ldflags: nil) + def std_go_args(output: bin/name, ldflags: nil, gcflags: nil) args = ["-trimpath", "-o=#{output}"] args += ["-ldflags=#{Array(ldflags).join(" ")}"] if ldflags + args += ["-gcflags=#{Array(gcflags).join(" ")}"] if gcflags args end