@@ -200,21 +200,21 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
200
200
vrun \$ {CCACHE} $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
201
201
""" )
202
202
end
203
-
203
+
204
204
# Helper invocations
205
205
target_tool (io:: IO , tool:: String , args... ; kwargs... ) = wrapper (io, " /opt/$(target) /bin/$(target) -$(tool) " , args... ; kwargs... )
206
206
llvm_tool (io:: IO , tool:: String , args... ; kwargs... ) = wrapper (io, " /opt/$(host_target) /bin/llvm-$(tool) " , args... ; kwargs... )
207
207
208
208
# For now this is required for Clang, since apple spells aarch64 as "arm64".
209
209
# Should probably be fixed upstream, but will do for now
210
210
clang_target_triplet (p:: AbstractPlatform ) = replace (aatriplet (p), " aarch64" => " arm64" )
211
-
211
+
212
212
function clang_flags! (p:: AbstractPlatform , flags:: Vector{String} = String[])
213
213
# Focus the clang targeting laser
214
214
append! (flags, [
215
215
# Set the `target` for `clang` so it generates the right kind of code
216
216
" -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
218
218
" --sysroot=/opt/$(aatriplet (p)) /$(aatriplet (p)) /sys-root" ,
219
219
])
220
220
# 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
410
410
end
411
411
end
412
412
fc (io:: IO , p:: AbstractPlatform ) = gfortran (io, p)
413
-
413
+
414
414
# Go stuff where we build an environment mapping each time we invoke `go-${target}`
415
415
function GOOS (p:: AbstractPlatform )
416
416
if os (p) == " macos"
@@ -437,6 +437,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
437
437
)
438
438
return wrapper (io, " /opt/$(host_target) /go/bin/go" ; env= env, allow_ccache= false )
439
439
end
440
+ gofmt (io:: IO , p:: AbstractPlatform ) = wrapper (io, " /opt/$(host_target) /go/bin/gofmt" ; allow_ccache= false )
440
441
441
442
# Rust stuff
442
443
function rust_flags! (p:: AbstractPlatform , flags:: Vector{String} = String[])
@@ -549,7 +550,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
549
550
:strip , :install_name_tool , :dlltool , :windres , :winmc , :lipo )
550
551
@eval $ (tool)(io:: IO , p:: AbstractPlatform ) = $ (wrapper)(io, string (" /opt/" , aatriplet (p), " /bin/" , aatriplet (p), " -" , $ (string (tool))); allow_ccache= false )
551
552
end
552
-
553
+
553
554
# c++filt is hard to write in symbols
554
555
function cxxfilt (io:: IO , p:: AbstractPlatform )
555
556
if Sys. isapple (p)
@@ -645,6 +646,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
645
646
# Generate go stuff
646
647
if :go in compilers
647
648
write_wrapper (go, p, " $(t) -go" )
649
+ write_wrapper (gofmt, p, " $(t) -gofmt" )
648
650
end
649
651
650
652
# Misc. utilities
@@ -704,7 +706,7 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
704
706
append! (default_tools, (" rustc" ," rustup" ," cargo" ))
705
707
end
706
708
if :go in compilers
707
- append! (default_tools, (" go" ,))
709
+ append! (default_tools, (" go" , " gofmt " ))
708
710
end
709
711
# Create symlinks for default compiler invocations, invoke target toolchain
710
712
for tool in default_tools
0 commit comments