Skip to content

Commit 0820b59

Browse files
authored
Do not generate wrappers for tools that don't exist (#168)
As far as I know, binutils tools come from the GCCBootstrap, so they aren't available if the C compiler is not requested.
1 parent 4ef815a commit 0820b59

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

src/Runner.jl

+44-44
Original file line numberDiff line numberDiff line change
@@ -700,42 +700,41 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
700700
# Someday, you will be split out
701701
write_wrapper(gfortran, p, "$(t)-f77")
702702
write_wrapper(gfortran, p, "$(t)-gfortran")
703-
end
704-
705703

706-
# Binutils (we always do these)
707-
write_wrapper(ar, p, "$(t)-ar")
708-
write_wrapper(as, p, "$(t)-as")
709-
write_wrapper(cpp, p, "$(t)-cpp")
710-
write_wrapper(cxxfilt, p, "$(t)-c++filt")
711-
write_wrapper(ld, p, "$(t)-ld")
712-
# ld wrappers for clang's `-fuse-ld=$(target)`
713-
if Sys.isapple(p)
714-
write_wrapper(ld, p, "ld64.$(t)")
715-
else
716-
write_wrapper(ld, p, "ld.$(t)")
717-
end
718-
write_wrapper(nm, p, "$(t)-nm")
719-
write_wrapper(libtool, p, "$(t)-libtool")
720-
write_wrapper(objcopy, p, "$(t)-objcopy")
721-
write_wrapper(objdump, p, "$(t)-objdump")
722-
write_wrapper(ranlib, p, "$(t)-ranlib")
723-
write_wrapper(readelf, p, "$(t)-readelf")
724-
write_wrapper(strip, p, "$(t)-strip")
725-
726-
# Special mac stuff
727-
if Sys.isapple(p)
728-
write_wrapper(install_name_tool, p, "$(t)-install_name_tool")
729-
write_wrapper(lipo, p, "$(t)-lipo")
730-
write_wrapper(dsymutil, p, "$(t)-dsymutil")
731-
write_wrapper(otool, p, "$(t)-otool")
732-
end
704+
# Binutils
705+
write_wrapper(ar, p, "$(t)-ar")
706+
write_wrapper(as, p, "$(t)-as")
707+
write_wrapper(cpp, p, "$(t)-cpp")
708+
write_wrapper(cxxfilt, p, "$(t)-c++filt")
709+
write_wrapper(ld, p, "$(t)-ld")
710+
# ld wrappers for clang's `-fuse-ld=$(target)`
711+
if Sys.isapple(p)
712+
write_wrapper(ld, p, "ld64.$(t)")
713+
else
714+
write_wrapper(ld, p, "ld.$(t)")
715+
end
716+
write_wrapper(nm, p, "$(t)-nm")
717+
write_wrapper(libtool, p, "$(t)-libtool")
718+
write_wrapper(objcopy, p, "$(t)-objcopy")
719+
write_wrapper(objdump, p, "$(t)-objdump")
720+
write_wrapper(ranlib, p, "$(t)-ranlib")
721+
write_wrapper(readelf, p, "$(t)-readelf")
722+
write_wrapper(strip, p, "$(t)-strip")
723+
724+
# Special mac stuff
725+
if Sys.isapple(p)
726+
write_wrapper(install_name_tool, p, "$(t)-install_name_tool")
727+
write_wrapper(lipo, p, "$(t)-lipo")
728+
write_wrapper(dsymutil, p, "$(t)-dsymutil")
729+
write_wrapper(otool, p, "$(t)-otool")
730+
end
733731

734-
# Special Windows stuff
735-
if Sys.iswindows(p)
736-
write_wrapper(dlltool, p, "$(t)-dlltool")
737-
write_wrapper(windres, p, "$(t)-windres")
738-
write_wrapper(winmc, p, "$(t)-winmc")
732+
# Special Windows stuff
733+
if Sys.iswindows(p)
734+
write_wrapper(dlltool, p, "$(t)-dlltool")
735+
write_wrapper(windres, p, "$(t)-windres")
736+
write_wrapper(winmc, p, "$(t)-winmc")
737+
end
739738
end
740739

741740
# Generate go stuff
@@ -781,20 +780,21 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
781780
write_wrapper(meson, host_platform, "meson")
782781

783782
default_tools = [
784-
# Binutils
785-
"ar", "as", "c++filt", "ld", "nm", "libtool", "objcopy", "ranlib", "readelf", "strip",
786-
787-
# Misc. utilities
783+
# Misc. utilities from RootFS
788784
"patchelf",
789785
]
790786

791-
if Sys.isapple(platform)
792-
append!(default_tools, ("dsymutil", "lipo", "otool", "install_name_tool"))
793-
elseif Sys.iswindows(platform)
794-
append!(default_tools, ("dlltool", "windres", "winmc"))
795-
end
796-
797787
if :c in compilers
788+
# Binutils
789+
append!(default_tools,
790+
("ar", "as", "c++filt", "ld", "nm", "libtool", "objcopy", "ranlib", "readelf", "strip"))
791+
792+
if Sys.isapple(platform)
793+
append!(default_tools, ("dsymutil", "lipo", "otool", "install_name_tool"))
794+
elseif Sys.iswindows(platform)
795+
append!(default_tools, ("dlltool", "windres", "winmc"))
796+
end
797+
798798
append!(default_tools, ("cc", "c++", "cpp", "f77", "gfortran", "gcc", "clang", "g++", "clang++"))
799799
end
800800
if :rust in compilers

0 commit comments

Comments
 (0)