1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

23 Commits

Author SHA1 Message Date
Rafael Espindola
b840aaf868 Fix handling of relative paths in thin archives.
The member has to end up with a path relative to the archive.

llvm-svn: 242362
2015-07-16 00:14:49 +00:00
Rafael Espindola
955d5aae40 llvm-ar: Don't write the directory in the string table.
We were already doing the right thing for short file names, but not long
ones.

llvm-svn: 242354
2015-07-15 23:15:33 +00:00
David Majnemer
b695e1d0f9 Silence GCC -Wparenthesis warning
llvm-svn: 242348
2015-07-15 22:48:26 +00:00
Rafael Espindola
d304dca4c6 For new archive member we only need to store the full path.
We were storing both the path and the file name, which was redundant
and easy to get confused up with.

llvm-svn: 242347
2015-07-15 22:46:53 +00:00
Rafael Espindola
cb9db3a66d Handle the error of trying to convert a regular archive to a thin one.
While at it, test that we can add to a thin archive.

llvm-svn: 242330
2015-07-15 20:45:56 +00:00
Rafael Espindola
71571d65a9 Initial support for writing thin archives.
llvm-svn: 242269
2015-07-15 05:47:46 +00:00
Rafael Espindola
737c5a83f8 Use a range loop.
llvm-svn: 242250
2015-07-14 23:51:01 +00:00
Rafael Espindola
8be47bcf22 Add support deterministic output in llvm-ar and make it the default.
llvm-svn: 242061
2015-07-13 20:38:09 +00:00
Rafael Espindola
282d12d41c llvm-ar: Pad the symbol table to 4 bytes.
It looks like ld64 requires it. With this we seem to be able to bootstrap using
llvm-ar+/usr/bin/true instead of ar+ranlib (currently on stage2).

llvm-svn: 241842
2015-07-09 19:48:06 +00:00
Rafael Espindola
70e52a227c Basic support for BSD symbol tables in archives.
This could be optimized and for now we only produce __.SYMDEF
and not "__.SYMDEF SORTED".

llvm-svn: 241814
2015-07-09 15:56:23 +00:00
Rafael Espindola
c1de8246ff Remove redundant variable. NFC.
llvm-svn: 241810
2015-07-09 15:24:39 +00:00
Rafael Espindola
19838c666d Add a helper to printing BE of LE depending on the format.
The gnu ar format uses BE numbers. The BSD one uses LE. Add a helper for one or the
other. NFC for now, just removes some noise from the following patch.

llvm-svn: 241808
2015-07-09 15:13:41 +00:00
Rafael Espindola
18999e2ab1 Extract printBSDMemberHeader.
It will get another use in the following patch. Also rename the other helper to
printGNUSmallMemberHeader for consistency.

llvm-svn: 241805
2015-07-09 14:54:12 +00:00
Rafael Espindola
aa281f8938 Disallow Archive::child_iterator that don't point to an archive.
NFC, just less error prone.

llvm-svn: 241747
2015-07-08 22:15:07 +00:00
Rafael Espindola
9d348c0806 Use a raw_svector_ostream and simplify a loop. NFC.
llvm-svn: 241727
2015-07-08 21:07:18 +00:00
Rafael Espindola
116995db75 Start adding support for writing archives in BSD format.
No support for the symbol table yet (but will hopefully add it today).
We always use the long filename format so that we can align the member,
which is an advantage of the BSD format.

llvm-svn: 241721
2015-07-08 20:47:32 +00:00
Rafael Espindola
9307c62bc7 Inline function into only use.
llvm-svn: 241692
2015-07-08 17:26:24 +00:00
Rafael Espindola
5fdc41bc6b Add a helper function to reduce a bit of code duplication.
llvm-svn: 241691
2015-07-08 17:08:26 +00:00
Rafael Espindola
1f5e97430d Use a range loop. NFC.
llvm-svn: 241685
2015-07-08 16:16:15 +00:00
Benjamin Kramer
44bf0bddeb [ArchiveWriter] Use EndianStream. No functional change intended.
llvm-svn: 239913
2015-06-17 16:02:56 +00:00
Rafael Espindola
da86c89e4a Don't use std::errc.
As noted on Errc.h:

// * std::errc is just marked with is_error_condition_enum. This means that
//   common patters like AnErrorCode == errc::no_such_file_or_directory take
//   4 virtual calls instead of two comparisons.

And on some libstdc++ those virtual functions conclude that

------------------------
int main() {
  std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
  return foo == std::errc::no_such_file_or_directory;
}
-------------------------

should exit with 0.

llvm-svn: 239683
2015-06-13 17:23:04 +00:00
Peter Collingbourne
08d6c7d7dd Fix Windows build.
llvm-svn: 239279
2015-06-08 02:43:32 +00:00
Peter Collingbourne
2a2ba76ed8 llvm-ar: Move archive writer to Object.
No functional change intended, other than some minor changes to certain
diagnostics.

Differential Revision: http://reviews.llvm.org/D10296

llvm-svn: 239278
2015-06-08 02:32:01 +00:00