Skip to content

Commit

Permalink
Do not generate wrappers for tools that don't exist (#168)
Browse files Browse the repository at this point in the history
As far as I know, binutils tools come from the GCCBootstrap, so they aren't
available if the C compiler is not requested.
  • Loading branch information
giordano authored Aug 16, 2021
1 parent 4ef815a commit 0820b59
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions src/Runner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -700,42 +700,41 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
# Someday, you will be split out
write_wrapper(gfortran, p, "$(t)-f77")
write_wrapper(gfortran, p, "$(t)-gfortran")
end


# Binutils (we always do these)
write_wrapper(ar, p, "$(t)-ar")
write_wrapper(as, p, "$(t)-as")
write_wrapper(cpp, p, "$(t)-cpp")
write_wrapper(cxxfilt, p, "$(t)-c++filt")
write_wrapper(ld, p, "$(t)-ld")
# ld wrappers for clang's `-fuse-ld=$(target)`
if Sys.isapple(p)
write_wrapper(ld, p, "ld64.$(t)")
else
write_wrapper(ld, p, "ld.$(t)")
end
write_wrapper(nm, p, "$(t)-nm")
write_wrapper(libtool, p, "$(t)-libtool")
write_wrapper(objcopy, p, "$(t)-objcopy")
write_wrapper(objdump, p, "$(t)-objdump")
write_wrapper(ranlib, p, "$(t)-ranlib")
write_wrapper(readelf, p, "$(t)-readelf")
write_wrapper(strip, p, "$(t)-strip")

# Special mac stuff
if Sys.isapple(p)
write_wrapper(install_name_tool, p, "$(t)-install_name_tool")
write_wrapper(lipo, p, "$(t)-lipo")
write_wrapper(dsymutil, p, "$(t)-dsymutil")
write_wrapper(otool, p, "$(t)-otool")
end
# Binutils
write_wrapper(ar, p, "$(t)-ar")
write_wrapper(as, p, "$(t)-as")
write_wrapper(cpp, p, "$(t)-cpp")
write_wrapper(cxxfilt, p, "$(t)-c++filt")
write_wrapper(ld, p, "$(t)-ld")
# ld wrappers for clang's `-fuse-ld=$(target)`
if Sys.isapple(p)
write_wrapper(ld, p, "ld64.$(t)")
else
write_wrapper(ld, p, "ld.$(t)")
end
write_wrapper(nm, p, "$(t)-nm")
write_wrapper(libtool, p, "$(t)-libtool")
write_wrapper(objcopy, p, "$(t)-objcopy")
write_wrapper(objdump, p, "$(t)-objdump")
write_wrapper(ranlib, p, "$(t)-ranlib")
write_wrapper(readelf, p, "$(t)-readelf")
write_wrapper(strip, p, "$(t)-strip")

# Special mac stuff
if Sys.isapple(p)
write_wrapper(install_name_tool, p, "$(t)-install_name_tool")
write_wrapper(lipo, p, "$(t)-lipo")
write_wrapper(dsymutil, p, "$(t)-dsymutil")
write_wrapper(otool, p, "$(t)-otool")
end

# Special Windows stuff
if Sys.iswindows(p)
write_wrapper(dlltool, p, "$(t)-dlltool")
write_wrapper(windres, p, "$(t)-windres")
write_wrapper(winmc, p, "$(t)-winmc")
# Special Windows stuff
if Sys.iswindows(p)
write_wrapper(dlltool, p, "$(t)-dlltool")
write_wrapper(windres, p, "$(t)-windres")
write_wrapper(winmc, p, "$(t)-winmc")
end
end

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

default_tools = [
# Binutils
"ar", "as", "c++filt", "ld", "nm", "libtool", "objcopy", "ranlib", "readelf", "strip",

# Misc. utilities
# Misc. utilities from RootFS
"patchelf",
]

if Sys.isapple(platform)
append!(default_tools, ("dsymutil", "lipo", "otool", "install_name_tool"))
elseif Sys.iswindows(platform)
append!(default_tools, ("dlltool", "windres", "winmc"))
end

if :c in compilers
# Binutils
append!(default_tools,
("ar", "as", "c++filt", "ld", "nm", "libtool", "objcopy", "ranlib", "readelf", "strip"))

if Sys.isapple(platform)
append!(default_tools, ("dsymutil", "lipo", "otool", "install_name_tool"))
elseif Sys.iswindows(platform)
append!(default_tools, ("dlltool", "windres", "winmc"))
end

append!(default_tools, ("cc", "c++", "cpp", "f77", "gfortran", "gcc", "clang", "g++", "clang++"))
end
if :rust in compilers
Expand Down

0 comments on commit 0820b59

Please sign in to comment.