This repository has been archived by the owner on Apr 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-ar] Make llvm-lib behave more like the MSVC archiver
Summary: Use the filepath used to open the archive member as the archive member name instead of the file basename. This path might be absolute or relative. This is important because the archive member name will show up in the PDB, and we want our PDBs to look as much like MSVC's as possible. This also helps avoid an issue in our PDB module descriptor writing code, which assumes that all module names are unique. Relative paths still aren't guaranteed to be unique, but they're much better than basenames, which definitely aren't unique. Reviewers: ruiu, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33575 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305223 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
llvm-lib should behave like "link.exe /lib" and use relative paths to describe | ||
archive members. | ||
|
||
First, get in a clean working directory. | ||
RUN: rm -rf %t && mkdir -p %t && cd %t | ||
|
||
Make foo/a.obj and foo/b.obj. | ||
RUN: mkdir foo | ||
RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/a.obj %S/Inputs/a.s | ||
RUN: llvm-mc -triple=x86_64-pc-windows-msvc -filetype=obj -o foo/b.obj %S/Inputs/b.s | ||
|
||
RUN: llvm-lib -out:foo.lib foo/a.obj foo/b.obj | ||
RUN: llvm-ar t foo.lib | FileCheck %s | ||
|
||
FIXME: We should probably use backslashes on Windows to better match MSVC tools. | ||
CHECK: foo/a.obj | ||
CHECK: foo/b.obj | ||
|
||
Do it again with absolute paths and see that we get something. | ||
RUN: llvm-lib -out:foo.lib %t/foo/a.obj %t/foo/b.obj | ||
RUN: llvm-ar t foo.lib | FileCheck %s --check-prefix=ABS | ||
|
||
ABS: {{.*}}/foo/a.obj | ||
ABS: {{.*}}/foo/b.obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters