@@ -200,21 +200,21 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
200200 vrun \$ {CCACHE} $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
201201 """ )
202202 end
203-
203+
204204 # Helper invocations
205205 target_tool (io:: IO , tool:: String , args... ; kwargs... ) = wrapper (io, " /opt/$(target) /bin/$(target) -$(tool) " , args... ; kwargs... )
206206 llvm_tool (io:: IO , tool:: String , args... ; kwargs... ) = wrapper (io, " /opt/$(host_target) /bin/llvm-$(tool) " , args... ; kwargs... )
207207
208208 # For now this is required for Clang, since apple spells aarch64 as "arm64".
209209 # Should probably be fixed upstream, but will do for now
210210 clang_target_triplet (p:: AbstractPlatform ) = replace (aatriplet (p), " aarch64" => " arm64" )
211-
211+
212212 function clang_flags! (p:: AbstractPlatform , flags:: Vector{String} = String[])
213213 # Focus the clang targeting laser
214214 append! (flags, [
215215 # Set the `target` for `clang` so it generates the right kind of code
216216 " -target $(clang_target_triplet (p)) " ,
217- # Set our sysroot to the platform-specific location, dropping compiler ABI annotations
217+ # Set our sysroot to the platform-specific location, dropping compiler ABI annotations
218218 " --sysroot=/opt/$(aatriplet (p)) /$(aatriplet (p)) /sys-root" ,
219219 ])
220220 # For MacOS and FreeBSD, we don't set `-rtlib`, and FreeBSD is special-cased within the LLVM source tree
@@ -410,7 +410,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
410410 end
411411 end
412412 fc (io:: IO , p:: AbstractPlatform ) = gfortran (io, p)
413-
413+
414414 # Go stuff where we build an environment mapping each time we invoke `go-${target}`
415415 function GOOS (p:: AbstractPlatform )
416416 if os (p) == " macos"
@@ -437,6 +437,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
437437 )
438438 return wrapper (io, " /opt/$(host_target) /go/bin/go" ; env= env, allow_ccache= false )
439439 end
440+ gofmt (io:: IO , p:: AbstractPlatform ) = wrapper (io, " /opt/$(host_target) /go/bin/gofmt" ; allow_ccache= false )
440441
441442 # Rust stuff
442443 function rust_flags! (p:: AbstractPlatform , flags:: Vector{String} = String[])
@@ -549,7 +550,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
549550 :strip , :install_name_tool , :dlltool , :windres , :winmc , :lipo )
550551 @eval $ (tool)(io:: IO , p:: AbstractPlatform ) = $ (wrapper)(io, string (" /opt/" , aatriplet (p), " /bin/" , aatriplet (p), " -" , $ (string (tool))); allow_ccache= false )
551552 end
552-
553+
553554 # c++filt is hard to write in symbols
554555 function cxxfilt (io:: IO , p:: AbstractPlatform )
555556 if Sys. isapple (p)
@@ -645,6 +646,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
645646 # Generate go stuff
646647 if :go in compilers
647648 write_wrapper (go, p, " $(t) -go" )
649+ write_wrapper (gofmt, p, " $(t) -gofmt" )
648650 end
649651
650652 # Misc. utilities
@@ -704,7 +706,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
704706 append! (default_tools, (" rustc" ," rustup" ," cargo" ))
705707 end
706708 if :go in compilers
707- append! (default_tools, (" go" ,))
709+ append! (default_tools, (" go" , " gofmt " ))
708710 end
709711 # Create symlinks for default compiler invocations, invoke target toolchain
710712 for tool in default_tools
0 commit comments