2022-09-27 11:10:15 -06:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2022-10-19 10:53:39 -06:00
|
|
|
index a5344d9a..11c7d806 100644
|
2022-09-27 11:10:15 -06:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2022-10-19 10:53:39 -06:00
|
|
|
@@ -246,8 +246,7 @@ add_dependencies(mold git_hash)
|
2022-09-27 11:10:15 -06:00
|
|
|
# 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
|
2022-10-19 10:53:39 -06:00
|
|
|
- X86_64 I386 ARM64 ARM32 RV32LE RV32BE RV64LE RV64BE
|
|
|
|
- PPC64V1 PPC64V2 SPARC64 S390X)
|
2022-09-27 11:10:15 -06:00
|
|
|
+ X86_64)
|
|
|
|
|
|
|
|
list(APPEND MOLD_ELF_TEMPLATE_FILES
|
|
|
|
elf/cmdline.cc
|
2022-10-19 10:53:39 -06:00
|
|
|
@@ -296,32 +295,15 @@ foreach (SOURCE IN LISTS MOLD_ELF_TEMPLATE_FILES)
|
2022-09-27 11:10:15 -06:00
|
|
|
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
|
2022-10-19 10:53:39 -06:00
|
|
|
- elf/arch-ppc64v1.cc
|
2022-09-27 11:10:15 -06:00
|
|
|
- elf/arch-ppc64v2.cc
|
|
|
|
- elf/arch-riscv.cc
|
2022-10-19 10:53:39 -06:00
|
|
|
- elf/arch-s390x.cc
|
2022-09-27 11:10:15 -06:00
|
|
|
- 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
|
2022-10-19 10:53:39 -06:00
|
|
|
index 8b6cf3fb..46e07424 100644
|
2022-09-27 11:10:15 -06:00
|
|
|
--- a/elf/main.cc
|
|
|
|
+++ b/elf/main.cc
|
2022-10-19 10:53:39 -06:00
|
|
|
@@ -422,11 +422,6 @@ int elf_main(int argc, char **argv) {
|
2022-09-27 11:10:15 -06:00
|
|
|
if (ctx.arg.emulation == MachineType::NONE)
|
|
|
|
ctx.arg.emulation = deduce_machine_type(ctx, file_args);
|
|
|
|
|
|
|
|
- // Redo if -m is not x86-64.
|
2022-10-19 10:53:39 -06:00
|
|
|
- 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);
|
2022-09-27 11:10:15 -06:00
|
|
|
-
|
|
|
|
Timer t_all(ctx, "all");
|
|
|
|
|
|
|
|
install_signal_handler();
|
|
|
|
diff --git a/main.cc b/main.cc
|
2022-10-19 10:53:39 -06:00
|
|
|
index db834c69..181e045e 100644
|
2022-09-27 11:10:15 -06:00
|
|
|
--- a/main.cc
|
|
|
|
+++ b/main.cc
|
2022-10-19 10:53:39 -06:00
|
|
|
@@ -144,8 +144,5 @@ i64 get_default_thread_count() {
|
2022-09-27 11:10:15 -06:00
|
|
|
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);
|
|
|
|
}
|