aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-ar
Commit message (Collapse)AuthorAgeFilesLines
* Update aosp/master llvm for rebase to r233350Pirama Arumuga Nainar2015-04-091-0/+1
| | | | Change-Id: I07d935f8793ee8ec6b7da003f6483046594bca49
* Update aosp/master LLVM for rebase to r230699.Stephen Hines2015-03-233-43/+65
| | | | Change-Id: I2b5be30509658cb8266be782de0ab24f9099f9b9
* Update aosp/master LLVM for rebase to r222494.Stephen Hines2014-12-022-126/+213
| | | | Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
* Fix build of llvm-ar.Stephen Hines2014-07-251-54/+0
| | | | | | | | | Bug: 15433215 llvm-ar was accidentally including static libraries and libLLVM dynamically, leading to redefined options. Change-Id: If1f05ff68a3c88580b9ff1981937e8d2cf99ee02
* Update LLVM for rebase to r212749.Stephen Hines2014-07-214-46/+92
| | | | | | | Includes a cherry-pick of: r212948 - fixes a small issue with atomic calls Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
* Adds the ability to run the llvm test suite in-tree.Chris Wailes2014-06-061-0/+48
| | | | | | | | | | | | | | | | | This was accomplished by building additional tools and hand-generating several files that are auto-generated by the configuration system when LLVM is built out-of-tree. The LTO, Interpreter, and DebugInfo libraries are now being compiled, and several source files were added to existing compilation targets. To run these tests you must first run build/envsetup.sh and have used lunch to select a target. You can then launch the test script by running: cd $ANDROID_BUILD_TOP/external/llvm && ./android_test.sh Bug: 15433215 Change-Id: I43d87de0a4620cdd46c8d0f825dd4428e8409702
* Update LLVM for 3.5 rebase (r209712).Stephen Hines2014-05-291-3/+3
| | | | Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
* Update to LLVM 3.5a.Stephen Hines2014-04-242-91/+123
| | | | Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
* llvm-ar: Let opening a directory failed in llvm-ar.NAKAMURA Takumi2013-11-081-0/+7
| | | | | | | | Linux cannot open directories with open(2), although cygwin and *bsd can. Motivation: The test, Object/directory.ll, had been failing with --target=cygwin on Linux. XFAIL was improper for host issues. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194257 91177308-0d34-0410-b5e6-96231b3b80d8
* Support names like llvm-ar-3.4 and llvm-ranlib-3.4.Rafael Espindola2013-10-291-2/+2
| | | | | | | | | They are used in some packages. For example: http://packages.ubuntu.com/saucy/i386/llvm-3.4/filelist This fixes pr17721. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193612 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix name matching to work on windows.Rafael Espindola2013-08-281-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189517 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a minimal implementation of ranlib.Rafael Espindola2013-08-283-13/+56
| | | | | | | | | | | | This is just enough to get "llvm-ranlib foo.a" working and tested. Making llvm-ranlib a symbolic link to llvm-ar doesn't work so well with llvm's option parsing, but ar's option parsing is mostly custom anyway. This patch also removes the -X32_64 option. Looks like it was just added in r10297 as part of implementing the current command line parsing. I can add it back (with a test) if someone really has AIX portability problems without it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189489 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the 's' operation to llvm-ar.Rafael Espindola2013-07-291-1/+29
| | | | | | | | | | | | If no other operation is specified, 's' becomes an operation instead of an modifier. The s operation just creates a symbol table. It is the same as running ranlib. We assume the archive was created by a sane ar (like llvm-ar or gnu ar) and if the symbol table is present, then it is current. We use that to optimize the most common case: a broken build system that thinks it has to run ranlib. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187353 91177308-0d34-0410-b5e6-96231b3b80d8
* Split getOpenFile into getOpenFile and getOpenFileSlice.Rafael Espindola2013-07-231-3/+3
| | | | | | | | | | | | | | | | The main observation is that we never need both the filesize and the map size. When mapping a slice of a file, it doesn't make sense to request a null terminator and that would be the only case where the filesize would be used. There are other cleanups that should be done in this area: * A client should not have to pass the size (even an explicit -1) to say if it wants a null terminator or not, so we should probably swap the argument order. * The default should be to not require a null terminator. Very few clients require this, but many end up asking for it just because it is the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186984 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the build in c++03 mode.Rafael Espindola2013-07-231-2/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186935 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an initial implementation of archive symbol table generation.Rafael Espindola2013-07-231-69/+212
| | | | | | | | | | | The symbol table has forward references in the file. Instead of allocating a temporary buffer or counting the size and then writing, this implementation writes a dummy value first and patches it once the final value is known. There is room for performance improvement. I will implement them as soon as I get some other features (like a ranlib mode) in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186934 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace archive members in the old position.Rafael Espindola2013-07-221-51/+94
| | | | | | | | | | | | This matches gnu archive behavior and since archive member order can change which member is used, not changing the order on replacement looks like the right thing to do. This patch also refactors the logic for which archive member to keep and whether to move it to a helper function (computeInsertAction). The nesting in computeNewArchiveMembers was getting a bit confusing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186829 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle replacement into a position past the original member.Rafael Espindola2013-07-211-2/+2
| | | | | | | We were incorrectly computing where to insert a member if it was replacing a previous member that was before the insert point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186792 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix inserting new elements in a specified location.Rafael Espindola2013-07-191-7/+25
| | | | | | We were only handling the 'a' and 'b' options during moves before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186721 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-ar: doExtract(): Write extracted files with F_Binary. It should fix ↵NAKAMURA Takumi2013-07-171-1/+1
| | | | | | llvm/test/Object/extract.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186503 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a wrapper for open.Rafael Espindola2013-07-161-18/+7
| | | | | | | This centralizes the handling of O_BINARY and opens the way for hiding more differences (like how open behaves with directories). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186447 91177308-0d34-0410-b5e6-96231b3b80d8
* On error, close the temporary file descriptor.Rafael Espindola2013-07-161-1/+3
| | | | | | With this change llvm-ar can remove the temporary file on windows too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186423 91177308-0d34-0410-b5e6-96231b3b80d8
* Use open+fstat instead of stat+open.Rafael Espindola2013-07-161-3/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186381 91177308-0d34-0410-b5e6-96231b3b80d8
* Remember that we have a null terminated string.Rafael Espindola2013-07-161-4/+4
| | | | | | | This is a micro optimization. Instead of going char*->StringRef->Twine->char*, go char*->Twine->char* and avoid having to copy the filename on the stack. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186380 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to open the file before use data from stat.Rafael Espindola2013-07-131-2/+3
| | | | | | | Looks like on mingw we get bogus last modification times on directories. Should fix the mingw bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186240 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused file. Thanks to Sean Silva for noticing it.Rafael Espindola2013-07-131-419/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186239 91177308-0d34-0410-b5e6-96231b3b80d8
* Add r186216 back, but make the test tolerant of different uids and gids.Rafael Espindola2013-07-131-1/+1
| | | | | | | original message: Fix a off by one error about which members need to use the string table. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186238 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert commit r186216 -- it's breaking bots:Chandler Carruth2013-07-131-1/+1
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186232 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a off by one error about which members need to use the string table.Rafael Espindola2013-07-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186216 91177308-0d34-0410-b5e6-96231b3b80d8
* fix autoconf buildRafael Espindola2013-07-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186200 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the build with c++03.Rafael Espindola2013-07-121-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186198 91177308-0d34-0410-b5e6-96231b3b80d8
* Change llvm-ar to use lib/Object.Rafael Espindola2013-07-126-1182/+346
| | | | | | | | | | | | | | | | | | | | | | This fixes two bugs is lib/Object that the use in llvm-ar found: * In OS X created archives, the name can be padded with nulls. Strip them. * In the constructor, remember the first non special member and use that in begin_children. This makes sure we skip all special members, not just the first one. The change to llvm-ar itself consist of * Using lib/Object for reading archives instead of ArchiveReader.cpp. * Writing the modified archive directly, instead of creating an in memory representation. The old Archive library was way more general than what is needed, as can be seen by the diffstat of this patch. Having llvm-ar using lib/Object now opens the way for creating regular symbol tables for both native objects and bitcode files so that we can use those archives for LTO. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186197 91177308-0d34-0410-b5e6-96231b3b80d8
* Add static.Rafael Espindola2013-07-121-33/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186170 91177308-0d34-0410-b5e6-96231b3b80d8
* llvm-ar: Clean up memory management with OwningPtr.Benjamin Kramer2013-07-111-15/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186131 91177308-0d34-0410-b5e6-96231b3b80d8
* Use %llu to print a 64 bit number. Should fix the ARM bots.Rafael Espindola2013-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186113 91177308-0d34-0410-b5e6-96231b3b80d8
* InsertBefore is the same as AddBefore. Delete it.Rafael Espindola2013-07-111-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186094 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a FIXME about the format and add a test.Rafael Espindola2013-07-111-7/+5
| | | | | | | While at it, use strftime on Unix too and use the thread safe versions of localtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186090 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the 'N' modifier from llvm-ar.Rafael Espindola2013-07-111-45/+11
| | | | | | | | * It is not present on OS X. * It is untested. * It is not needed for using ar in a build system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186080 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete dead code.Rafael Espindola2013-07-111-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186079 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for truncating names in archives.Rafael Espindola2013-07-113-42/+9
| | | | | | | | | | * All systems we support have some form of long name support. * The options has different names and semantics in different implementations ('f' on gnu, 'T' on OS X), which makes it unlikely it is normally used on build systems. * It was completely untested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186078 91177308-0d34-0410-b5e6-96231b3b80d8
* Sync llvm-ar's help string with the options it supports.Rafael Espindola2013-07-111-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186076 91177308-0d34-0410-b5e6-96231b3b80d8
* Create files with the correct permission instead of changing it afterwards.Rafael Espindola2013-07-081-9/+6
| | | | | | No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185832 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes problem when calling llvm-ar from an unmodifiable directory.Manuel Klimek2013-07-081-2/+2
| | | | | | | | | This fixes a regression introduced by r185726: the new call to get a unique file does not prepend the system temporary directory, so we need to anchor on the file that the temporary file gets moved to to ensure we're on the same file system. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185825 91177308-0d34-0410-b5e6-96231b3b80d8
* [llvm-ar] Added llvm_unreachable to quiet -Wreturn-type warnings.Michael Gottesman2013-07-061-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185751 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a createUniqueFile function and switch llvm's users of unique_file.Rafael Espindola2013-07-051-2/+2
| | | | | | | | | | | | | | This function is complementary to createTemporaryFile. It handles the case were the unique file is *not* temporary: we will rename it in the end. Since we will rename it, the file has to be in the same filesystem as the final destination and we don't prepend the system temporary directory. This has a small semantic difference from unique_file: the default mode is 0666. This matches the behavior of most unix tools. For example, with this change lld now produces files with the same permissions as ld. I will add a test of this change when I port clang over to createUniqueFile (next commit). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185726 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't create an archive if, for example, we are asked to print the index.Rafael Espindola2013-07-051-2/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185697 91177308-0d34-0410-b5e6-96231b3b80d8
* Use simpler version of exists.Rafael Espindola2013-07-051-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185695 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove NoOperation.Rafael Espindola2013-07-051-5/+1
| | | | | | | parseCommandLine prints and error and exists if no operation is specified, so it never returns NoOperation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185691 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't treat bitcode files specially in llvm-ar.Rafael Espindola2013-07-055-34/+2
| | | | | | | We really want bitcode files to behave as regular object files in archives, so we don't need to track that a member is bitcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185681 91177308-0d34-0410-b5e6-96231b3b80d8
* Use enums instead of raw octal values.Rafael Espindola2013-06-261-1/+1
| | | | | | Patch by 罗勇刚(Yonggang Luo). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184971 91177308-0d34-0410-b5e6-96231b3b80d8