repo/extra/mold/patches/elf_amd64_only.patch
2022-10-19 11:53:39 -05:00

77 lines
2.1 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a5344d9a..11c7d806 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -246,8 +246,7 @@ add_dependencies(mold git_hash)
# As a workaround, we create a .cc file for each target and spawn many
# compiler instances. This is hacky but greatly reduces compile time.
list(APPEND MOLD_ELF_TARGETS
- X86_64 I386 ARM64 ARM32 RV32LE RV32BE RV64LE RV64BE
- PPC64V1 PPC64V2 SPARC64 S390X)
+ X86_64)
list(APPEND MOLD_ELF_TEMPLATE_FILES
elf/cmdline.cc
@@ -296,32 +295,15 @@ foreach (SOURCE IN LISTS MOLD_ELF_TEMPLATE_FILES)
endforeach()
endforeach()
-foreach (SOURCE IN LISTS MOLD_MACHO_TEMPLATE_FILES)
- foreach(TARGET IN LISTS MOLD_MACHO_TARGETS)
- mold_instantiate_templates(${SOURCE} ${TARGET})
- endforeach()
-endforeach()
-
# Add other non-template source files.
target_sources(mold PRIVATE
compress.cc
demangle.cc
- elf/arch-arm32.cc
- elf/arch-arm64.cc
- elf/arch-i386.cc
- elf/arch-ppc64v1.cc
- elf/arch-ppc64v2.cc
- elf/arch-riscv.cc
- elf/arch-s390x.cc
- elf/arch-sparc64.cc
elf/arch-x86-64.cc
filepath.cc
git-hash.cc
glob.cc
hyperloglog.cc
- macho/arch-arm64.cc
- macho/arch-x86-64.cc
- macho/yaml.cc
main.cc
multi-glob.cc
perf.cc
diff --git a/elf/main.cc b/elf/main.cc
index 8b6cf3fb..46e07424 100644
--- a/elf/main.cc
+++ b/elf/main.cc
@@ -422,11 +422,6 @@ int elf_main(int argc, char **argv) {
if (ctx.arg.emulation == MachineType::NONE)
ctx.arg.emulation = deduce_machine_type(ctx, file_args);
- // Redo if -m is not x86-64.
- if constexpr (std::is_same_v<E, X86_64>)
- if (ctx.arg.emulation != MachineType::X86_64)
- return redo_main<E>(argc, argv, ctx.arg.emulation);
-
Timer t_all(ctx, "all");
install_signal_handler();
diff --git a/main.cc b/main.cc
index db834c69..181e045e 100644
--- a/main.cc
+++ b/main.cc
@@ -144,8 +144,5 @@ i64 get_default_thread_count() {
int main(int argc, char **argv) {
mold::mold_version = mold::get_mold_version();
- std::string cmd = mold::filepath(argv[0]).filename().string();
- if (cmd == "ld64" || cmd == "ld64.mold")
- return mold::macho::main(argc, argv);
return mold::elf::main(argc, argv);
}