diff --git a/CMakeLists.txt b/CMakeLists.txt index aff8fc6..9790e28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -310,14 +310,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) # compiler instances. This is hacky but greatly reduces compile time # on a multicore machine. list(APPEND MOLD_ELF_TARGETS - X86_64 I386 ARM64LE ARM64BE ARM32 RV32LE RV32BE RV64LE RV64BE PPC32 - PPC64V1 PPC64V2 S390X SPARC64 M68K SH4LE SH4BE LOONGARCH32 LOONGARCH64) + X86_64) list(APPEND MOLD_ELF_TEMPLATE_FILES - src/arch-arm64.cc - src/arch-loongarch.cc - src/arch-riscv.cc - src/arch-sh4.cc src/cmdline.cc src/filetype.cc src/gc-sections.cc @@ -385,14 +380,6 @@ target_sources(mold PRIVATE lib/perf.cc lib/random.cc lib/tar.cc - src/arch-arm32.cc - src/arch-i386.cc - src/arch-m68k.cc - src/arch-ppc32.cc - src/arch-ppc64v1.cc - src/arch-ppc64v2.cc - src/arch-s390x.cc - src/arch-sparc64.cc src/arch-x86-64.cc src/config.cc src/elf.cc diff --git a/src/main.cc b/src/main.cc index 4674b1c..b1ca4cb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -290,11 +290,6 @@ int mold_main(int argc, char **argv) { if (ctx.arg.emulation.empty()) ctx.arg.emulation = detect_machine_type(ctx, file_args); - // Redo if -m is not x86-64. - if constexpr (is_x86_64) - if (ctx.arg.emulation != X86_64::name) - return redo_main(ctx, argc, argv); - Timer t_all(ctx, "all"); install_signal_handler(); diff --git a/src/mold.h b/src/mold.h index ce74a26..079c0a8 100644 --- a/src/mold.h +++ b/src/mold.h @@ -1603,7 +1603,6 @@ std::vector parse_nonpositional_args(Context &ctx); // passes.cc // -template int redo_main(Context &, int argc, char **argv); template void create_internal_file(Context &); template void apply_exclude_libs(Context &); template void create_synthetic_sections(Context &); diff --git a/src/passes.cc b/src/passes.cc index aeac428..078f43a 100644 --- a/src/passes.cc +++ b/src/passes.cc @@ -14,52 +14,6 @@ namespace mold { -// Since mold_main is a template, we can't run it without a type parameter. -// We speculatively run mold_main with X86_64, and if the speculation was -// wrong, re-run it with an actual machine type. -template -int redo_main(Context &ctx, int argc, char **argv) { - std::string_view target = ctx.arg.emulation; - - if (target == I386::name) - return mold_main(argc, argv); - if (target == ARM64LE::name) - return mold_main(argc, argv); - if (target == ARM64BE::name) - return mold_main(argc, argv); - if (target == ARM32::name) - return mold_main(argc, argv); - if (target == RV64LE::name) - return mold_main(argc, argv); - if (target == RV64BE::name) - return mold_main(argc, argv); - if (target == RV32LE::name) - return mold_main(argc, argv); - if (target == RV32BE::name) - return mold_main(argc, argv); - if (target == PPC32::name) - return mold_main(argc, argv); - if (target == PPC64V1::name) - return mold_main(argc, argv); - if (target == PPC64V2::name) - return mold_main(argc, argv); - if (target == S390X::name) - return mold_main(argc, argv); - if (target == SPARC64::name) - return mold_main(argc, argv); - if (target == M68K::name) - return mold_main(argc, argv); - if (target == SH4LE::name) - return mold_main(argc, argv); - if (target == SH4BE::name) - return mold_main(argc, argv); - if (target == LOONGARCH32::name) - return mold_main(argc, argv); - if (target == LOONGARCH64::name) - return mold_main(argc, argv); - unreachable(); -} - template void apply_exclude_libs(Context &ctx) { Timer t(ctx, "apply_exclude_libs"); @@ -3222,7 +3176,6 @@ void show_stats(Context &ctx) { using E = MOLD_TARGET; -template int redo_main(Context &, int, char **); template void create_internal_file(Context &); template void apply_exclude_libs(Context &); template void create_synthetic_sections(Context &);