[llvm-bugs] [Bug 35422] New: [Rust] lld mislinks libstd

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 25 22:56:40 PST 2017


https://bugs.llvm.org/show_bug.cgi?id=35422

            Bug ID: 35422
           Summary: [Rust] lld mislinks libstd
           Product: lld
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: unassignedbugs at nondot.org
          Reporter: tamird at gmail.com
                CC: llvm-bugs at lists.llvm.org

Linking with ld produces a 3.8M dylib:
https://drive.google.com/file/d/17K2mHAYTJlQLY5rfkhH9VDw9n1Uq6ild/view?usp=sharing
Linking with ld64.lld produces a 270K dylib:
https://drive.google.com/file/d/10FReHMsNqrGjUD5cRav4RKFlKhnwZ52O/view?usp=sharing

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"
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171126/cb7da9b0/attachment.html>


More information about the llvm-bugs mailing list