Summary: This is a re-land of r370487 with a fix for the use-after-free bug that rev contained. This implements -start-lib and -end-lib flags for lld-link, analogous to the similarly named options in ld.lld. Object files after -start-lib are included in the link only when needed to resolve undefined symbols. The -end-lib flag goes back to the normal behavior of always including object files in the link. This mimics the semantics of static libraries, but without needing to actually create the archive file. Reviewers: ruiu, smeenai, MaskRay Reviewed By: ruiu, MaskRay Subscribers: akhuang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D66848 llvm-svn: 370816
14 lines
258 B
LLVM
14 lines
258 B
LLVM
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-pc-windows-msvc"
|
|
|
|
declare i32 @bar()
|
|
|
|
define i32 @foo() {
|
|
%1 = call i32 () @bar()
|
|
%2 = add i32 %1, 1
|
|
ret i32 %2
|
|
}
|
|
|
|
!llvm.linker.options = !{!0}
|
|
!0 = !{!"/INCLUDE:foo"}
|