OSDN Git Service

[ThinLTO] Adding architecture name into saved object filename
authorSteven Wu <stevenwu@apple.com>
Mon, 29 Apr 2019 21:39:54 +0000 (21:39 +0000)
committerSteven Wu <stevenwu@apple.com>
Mon, 29 Apr 2019 21:39:54 +0000 (21:39 +0000)
commit036707485e98bd85369aca8dd174538d34e01893
treef70e50e4f1082b938962ad96cff4f2d6eb4a7f7c
parent4f53d5f4e7d58b6dcaae045884b91f5c5695a481
[ThinLTO] Adding architecture name into saved object filename

Summary:
For ThinLTOCodegenerator, it has an option to save the object file
outputs into a directory which is essential for debug info. Tools like lldb
and dsymutil will look for these object files for debug info.

On Darwin platform, you can link fat binaries with one single clang
driver invocation like:
 $ clang -arch x86_64 -arch i386 -Wl,-object_path_lto,$TMPDIR ...
Unfornately, the output object files for one architecture is going to
overwrite the previous ones and one architecture slice will end up with
no debug info. One example for this is to turn on ThinLTO for sanitizer
dylibs in compiler-rt project.

To fix the issue, add the name for the architecture into the name of the
output object file.

rdar://problem/35482935

Reviewers: tejohnson, bd1976llvm, dexonsmith, JDevlieghere

Reviewed By: dexonsmith

Subscribers: mehdi_amini, aprantl, inglorion, eraman, hiraditya, jkorous, dang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60924

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359508 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
lib/LTO/ThinLTOCodeGenerator.cpp
test/ThinLTO/X86/save_objects.ll