forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't modify archive members unless really needed.
For whatever reason ld64 requires that member headers (not the member themselves) should be aligned. The only way to do that is to edit the previous member so that it ends at an aligned boundary. Since modifying data put in an archive is an undesirable property, llvm-ar should only do it when it is absolutely necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295765 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
6 changed files
with
80 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,6 +212,7 @@ class Archive : public Binary { | |
K_GNU, | ||
K_MIPS64, | ||
K_BSD, | ||
K_DARWIN, | ||
K_DARWIN64, | ||
K_COFF | ||
}; | ||
|
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
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,19 @@ | ||
Test that only the darwin format needs to modify archive members to | ||
avoid a ld64 bug. | ||
|
||
RUN: echo foo > %t.o | ||
|
||
RUN: rm -f %t.a | ||
RUN: llvm-ar -format=bsd rc %t.a %t.o | ||
RUN: llvm-ar p %t.a > %bsd.o | ||
RUN: cmp %bsd.o %t.o | ||
|
||
RUN: rm -f %t.a | ||
RUN: llvm-ar -format=gnu rc %t.a %t.o | ||
RUN: llvm-ar p %t.a > %gnu.o | ||
RUN: cmp %gnu.o %t.o | ||
|
||
RUN: rm -f %t.a | ||
RUN: llvm-ar -format=darwin rc %t.a %t.o | ||
RUN: llvm-ar p %t.a > %darwin.o | ||
RUN: not cmp %darwin.o %t.o |
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