mold: 1.5.0

This commit is contained in:
Owen Rafferty 2022-09-27 12:10:15 -05:00
parent 79a4c7c53a
commit 01fdeabbb2
No known key found for this signature in database
6 changed files with 130 additions and 5 deletions

View File

@ -6,8 +6,14 @@
# for performing LTO.
# export LDFLAGS="$LDFLAGS -static"
make
make PREFIX=/usr install
patch -p1 < elf_amd64_only.patch
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
cmake --build build
cmake --install build
# Create a symbolic link so users can use mold as the linker system-wide
# (without need for special CFLAGS/CXXFLAGS).

View File

@ -1 +1,2 @@
47e6c48d20f49e5b47dfb8197dd9ffcb11a8833d614f7a03bd29741c658a69cd
55f67a0531cd357fa8c8aa16f9664954188f49537126e9bd35240846de3c3434
9961e46306499052f631563dad64f084934b422347911287024379e9712fa703

View File

@ -1,3 +1,4 @@
cmake make
cmake make
openssl
zlib
zstd

View File

@ -0,0 +1,116 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcbfc2d..d5b3d71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -183,7 +183,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 PPC64V2 SPARC64)
+ X86_64)
list(APPEND MOLD_ELF_TEMPLATE_FILES
elf/cmdline.cc
@@ -203,20 +203,6 @@ list(APPEND MOLD_ELF_TEMPLATE_FILES
elf/thunks.cc
)
-list(APPEND MOLD_MACHO_TARGETS X86_64 ARM64)
-
-list(APPEND MOLD_MACHO_TEMPLATE_FILES
- macho/cmdline.cc
- macho/dead-strip.cc
- macho/input-files.cc
- macho/input-sections.cc
- macho/lto.cc
- macho/main.cc
- macho/mapfile.cc
- macho/output-chunks.cc
- macho/tapi.cc
- )
-
function(mold_instantiate_templates SOURCE TARGET)
set(PATH ${CMAKE_BINARY_DIR}/${SOURCE}.${TARGET}.cc)
file(WRITE ${PATH} "#define MOLD_${TARGET} 1
@@ -232,30 +218,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-ppc64v2.cc
- elf/arch-riscv.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 b63bba6..c46ffc9 100644
--- a/elf/main.cc
+++ b/elf/main.cc
@@ -388,33 +388,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 (ctx.arg.emulation != E::machine_type) {
- switch (ctx.arg.emulation) {
- case MachineType::I386:
- return elf_main<I386>(argc, argv);
- case MachineType::ARM64:
- return elf_main<ARM64>(argc, argv);
- case MachineType::ARM32:
- return elf_main<ARM32>(argc, argv);
- case MachineType::RV64LE:
- return elf_main<RV64LE>(argc, argv);
- case MachineType::RV64BE:
- return elf_main<RV64BE>(argc, argv);
- case MachineType::RV32LE:
- return elf_main<RV32LE>(argc, argv);
- case MachineType::RV32BE:
- return elf_main<RV32BE>(argc, argv);
- case MachineType::PPC64V2:
- return elf_main<PPC64V2>(argc, argv);
- case MachineType::SPARC64:
- return elf_main<SPARC64>(argc, argv);
- default:
- unreachable();
- }
- unreachable();
- }
-
Timer t_all(ctx, "all");
install_signal_handler();
diff --git a/main.cc b/main.cc
index 0f78eff..b4002f8 100644
--- a/main.cc
+++ b/main.cc
@@ -108,8 +108,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);
}

View File

@ -1 +1,2 @@
https://github.com/rui314/mold/archive/vVERSION.tar.gz
patches/elf_amd64_only.patch

View File

@ -1 +1 @@
1.4.2 1
1.5.0 1