Trying to get Mold to work for a project that currently spends 2 minutes linking on an M1. It statically links JavaScriptCore and related libraries (parts of WebKit)
I wasn't expecting it to work and it does say it's too early, so feel free to close this if it's unhelpful.
Some notes:
If you pass LTO'd files, mold doesn't detect it without an explicit -flto=full and instead reports undefined symbol errors. This doesn't happen with apple ld
-exported_symbols_list is not implemented yet
-object_path_lto is not implemented yet
This diff ignores the above two args:
❯ git diff
diff --git a/macho/cmdline.cc b/macho/cmdline.cc
index 73ffb9ba..ff57757a 100644
--- a/macho/cmdline.cc
+++ b/macho/cmdline.cc
@@ -253,6 +253,8 @@ std::vector<std::string> parse_nonpositional_args(Context<E> &ctx) {
} else if (read_flag("-export_dynamic")) {
ctx.arg.export_dynamic = true;
} else if (read_arg("-fatal_warnings")) {
+ } else if (read_arg("-exported_symbols_list")) {
+ } else if (read_arg("-object_path_lto")) {
} else if (read_arg("-filelist")) {
remaining.push_back("-filelist");
remaining.push_back(std::string(arg));
From there, mold no longer reports errors and instead segfaults
Trying to get Mold to work for a project that currently spends 2 minutes linking on an M1. It statically links JavaScriptCore and related libraries (parts of WebKit)
I wasn't expecting it to work and it does say it's too early, so feel free to close this if it's unhelpful.
Some notes:
-flto=full
and instead reports undefined symbol errors. This doesn't happen with apple ld-exported_symbols_list
is not implemented yet-object_path_lto
is not implemented yetThis diff ignores the above two args:
From there, mold no longer reports errors and instead segfaults
Here is the crash report from `Console.app` (macOS)
```c++ ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: mold [35826] Path: /Users/USER/*/mold Identifier: mold Version: ??? Code Type: ARM-64 (Native) Parent Process: clang++ [35814] Responsible: alacritty [9216] User ID: 501 Date/Time: 2022-05-30 21:35:13.6989 -0700 OS Version: macOS 12.4 (21F79) Report Version: 12 Anonymous UUID: 96255C35-E415-1AB8-FAA6-9E17B4F28471 Sleep/Wake UUID: D5D39DC8-C3CC-4695-88A1-AF1D46F673EC Time Awake Since Boot: 590000 seconds Time Since Wake: 15886 seconds System Integrity Protection: enabled Crashed Thread: 0 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000003f00000000 Exception Codes: 0x0000000000000002, 0x0000003f00000000 Exception Note: EXC_CORPSE_NOTIFY Termination Reason: Namespace SIGNAL, Code 10 Bus error: 10 Terminating Process: exc handler [35826] VM Region Info: 0x3f00000000 is in 0x1000000000-0x7000000000; bytes after start: 201863462912 bytes before end: 210453397503 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated) ---> GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated) GAP OF 0x5f9000000000 BYTES MALLOC_NANO 600000000000-600008000000 [128.0M] rw-/rwx SM=PRV Thread 0 Crashed: 0 libLLVM.dylib 0x2a829c5a0 llvm::StructType::setName(llvm::StringRef) + 968 1 libLLVM.dylib 0x2a829c2f0 llvm::StructType::setName(llvm::StringRef) + 280 2 libLLVM.dylib 0x2a829c700 llvm::StructType::create(llvm::LLVMContext&, llvm::StringRef) + 164 3 libLLVM.dylib 0x2a892cbf0 (anonymous namespace)::BitcodeReader::createIdentifiedStructType(llvm::LLVMContext&, llvm::StringRef) + 44 4 libLLVM.dylib 0x2a892905c (anonymous namespace)::BitcodeReader::parseModule(unsigned long long, bool, llvm::function_ref