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

20 Commits

Author SHA1 Message Date
Peter Wu
ba0da850a8 [Object] Deduplicate long archive member names
Summary:
Import libraries as created by llvm-dlltool always use the same archive
member name for every object file (namely, the DLL library name). Ensure
that long names are not repeatedly stored in the string table.

Reviewed By: ruiu

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

llvm-svn: 349637
2018-12-19 16:15:05 +00:00
James Y Knight
6f1053539e llvm-ar: Darwin archive format fixes.
* Support writing the DARWIN64 symbol table format.

* In darwin archives, emit a symbol table whenever requested, even
  when there are no members, as the apple linker will abort if given
  an archive without a symbol table.

Added tests for same, and also simplified and moved the GNU 64-bit
symbol table test into archive-symtab.test.

llvm-svn: 344183
2018-10-10 21:07:02 +00:00
Rafael Espindola
208332c2a4 Archives require a symbol table on Solaris, even if empty.
On Solaris ld (and some other tools that use the underlying utility
libraries, such as elfdump) chokes on an archive library that has no
symbol table. The Solaris tools always create one, even if it's empty.

That bug has been fixed in the latest development line, and can
probably be backported to a supported release, but it would be nice if
LLVM's archiver could emit the empty symbol table, too.

Patch by Danek Duvall!

llvm-svn: 297773
2017-03-14 19:57:13 +00:00
Rafael Espindola
98752fcfe6 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.

llvm-svn: 295765
2017-02-21 20:40:54 +00:00
Saleem Abdulrasool
dae66e6aa5 Object: pad out BSD archive members to 8-bytes
ld64 requires its archive members to be 8-byte aligned for 64-bit
content and 4-byte aligned for 32-bit content.  Opt for the larger
alignment requirement.  This ensures that ld64 can consume archives
generated by llvm-ar.

Thanks to Kevin Enderby for the hint about the ld64/cctools behaviours!

Resolves PR28361!

llvm-svn: 294615
2017-02-09 19:29:35 +00:00
Rui Ueyama
acf47023d0 Use printf instead of "echo -e" or "echo -n".
Not all echo commands support "-e". On the other hand, printf
command is in POSIX, so it's more portable than "echo -e".

llvm-svn: 285151
2016-10-26 01:07:26 +00:00
Rafael Espindola
e51691ab66 Don't try to create thin bsd archives.
Not such variant has been specified yet.

llvm-svn: 268305
2016-05-02 21:06:57 +00:00
Rafael Espindola
d9685286be Trying to fix the windows bots.
llvm-svn: 242367
2015-07-16 00:38:34 +00:00
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
Rafael Espindola
71571d65a9 Initial support for writing thin archives.
llvm-svn: 242269
2015-07-15 05:47:46 +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
111ba6bab3 Create BSD archives by default on OS X.
They should probably be created on anything that is not windows or linux, but I will
test on freebsd before changing that.

With this it is possible to bootstrap with llvm-ar instead of ar+ranlib on OS X.

llvm-svn: 241849
2015-07-09 20:12:50 +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
NAKAMURA Takumi
76110bc083 Make llvm/test/Object/archive-format.test CRLF-tolerant.
llvm-svn: 231074
2015-03-03 15:54:48 +00:00
Reid Kleckner
0da22610a5 lit: Add 'cd' support to the internal shell and port some tests
The internal shell was already threading around a 'cwd' parameter. We
just have to make it mutable so that we can update it as the test script
executes.

If the shell ever grows support for environment variable substitution,
we could also implement support for export.

llvm-svn: 231017
2015-03-02 21:33:18 +00:00
Benjamin Kramer
740741f2c0 Only verify the length in archive test, we can't make assumptions on the spacing.
And .* did just match about anything anyways.

llvm-svn: 186246
2013-07-13 15:21:39 +00:00
Rafael Espindola
9e9a37033b Add r186216 back, but make the test tolerant of different uids and gids.
original message:
Fix a off by one error about which members need to use the string table.

llvm-svn: 186238
2013-07-13 04:14:13 +00:00
Chandler Carruth
40918c60f8 Revert commit r186216 -- it's breaking bots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/6897/steps/check-all/logs/LLVM%3A%3Aarchive-format.test

Original commit log:
  Fix a off by one error about which members need to use the string
  table.

llvm-svn: 186232
2013-07-13 00:42:56 +00:00
Rafael Espindola
d955e6ac00 Fix a off by one error about which members need to use the string table.
llvm-svn: 186216
2013-07-12 22:22:34 +00:00