[Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

Fangrui Song via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed May 15 20:14:43 PDT 2019


MaskRay added a comment.

In D54747#1459175 <https://reviews.llvm.org/D54747#1459175>, @rocallahan wrote:

> Updated results for the rusoto test in https://github.com/rust-lang/rust/issues/56068#issue-382175735. The test changed a bit because I'm using an updated Rust toolchain and `rusoto_core` 0.37.0.
>
> | Linker                                 | Size (bytes) | Real time (ms) |
> | GNU ld version 2.29.1-23.fc28          | 48,554,736   | 2234           |
> | GNU gold (version 2.29.1-23.fc28) 1.14 | 49,888,392   | 813            |
> | lld-6.0.1-1.fc28.x86_64                | 49,800,824   | 247            |
> | lld d918d74461724a22cedd0b76dc1237392f295656                                  | 49,873,960   | 224            |
> | lld d918d74461724a22cedd0b76dc1237392f295656 + this patch                     | 5,390,632    | 158            |
> |


@rocallahan
Can you also share the linker command line? You may execute `export LLD_REPRODUCE=/tmp/reproduce.tar` before the linking stage. After unpacking, there is a `response.txt` file that contains the full command line. I know little about Rust crates but I worry some component doesn't use static archives .a correctly. If you don't have .a but you have a bunch of .o files, you may place them inside a `--start-lib ... --end-lib` to get the archive semantic.

If all debug information of an object file is discarded, it sounds like if you switch the build system to use archives, the member in the archive will just get discarded, i.e.

If you do `ld.lld main.o a.o b.o c.o d1.o d2.o d3.o` before, you should probably switch to

`ld.lld main.o --start-lib a.o b.o c.o --end-lib --start-lib d1.o d2.o d3.o --end-lib`


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54747/new/

https://reviews.llvm.org/D54747





More information about the lldb-commits mailing list