<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - [Rust] lld mislinks libstd"
href="https://bugs.llvm.org/show_bug.cgi?id=35422">35422</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Rust] lld mislinks libstd
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>MachO
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>tamird@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Linking with ld produces a 3.8M dylib:
<a href="https://drive.google.com/file/d/17K2mHAYTJlQLY5rfkhH9VDw9n1Uq6ild/view?usp=sharing">https://drive.google.com/file/d/17K2mHAYTJlQLY5rfkhH9VDw9n1Uq6ild/view?usp=sharing</a>
Linking with ld64.lld produces a 270K dylib:
<a href="https://drive.google.com/file/d/10FReHMsNqrGjUD5cRav4RKFlKhnwZ52O/view?usp=sharing">https://drive.google.com/file/d/10FReHMsNqrGjUD5cRav4RKFlKhnwZ52O/view?usp=sharing</a>
All the object files:
/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std8-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o
Note in particular there is a 2.4M "metadata" file in there.
The command that produces the malformed dylib (the same command produces a
valid dylib with ld):
```
"ld64.lld" "-L"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std0-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std1-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std10-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std11-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std12-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std13-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std14-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std15-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std2-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std3-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std4-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std5-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std6-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std7-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std8-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.std9-de1910cab5cd67f784cf62e11a900e1.rs.rcgu.o"
"-o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/libstd-7e31d26014a7ccd4.dylib"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.crate.metadata.rcgu.o"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps/std-7e31d26014a7ccd4.crate.allocator.rcgu.o"
"-dead_strip" "-L"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/deps"
"-L" "/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/release/deps"
"-L"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/native/libbacktrace/.libs"
"-L" "/Users/tamird/src/rust/build/x86_64-apple-darwin/native/jemalloc/lib"
"-L"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1-std/x86_64-apple-darwin/release/build/compiler_builtins-39245271e9dcc1b6/out"
"-L"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib"
"-force_load"
"/Users/tamird/src/rust/build/x86_64-apple-darwin/native/libbacktrace/.libs/libbacktrace.a"
"-lSystem" "-lresolv" "-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/libpanic_unwind-ed6c5bc8c42d12a9.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/libunwind-0534c8b308c1f77b.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/liballoc_jemalloc-101dc8c3b880a680.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/liballoc_system-3f3c46b7ac23f346.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/liblibc-e46fc9bf5efb0e23.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/liballoc-f979067171741caa.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/libstd_unicode-2a5c4b6b79c42cbe.rlib"
"-force_load"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/libcore-c5b474679ae3e263.rlib"
"/var/folders/hr/870gls214_j5d8ndyvkbzlqw0000gn/T/rustc.ul5T2cZgbKmg/libcompiler_builtins-21e0a7e843257473.rlib"
"-lpthread" "-lc" "-lm" "-dylib" "-install_name"
"@rpath/libstd-7e31d26014a7ccd4.dylib" "-rpath" "@loader_path/../lib"
"-macosx_version_min" "10.13"
```</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>