summaryrefslogtreecommitdiffstats
path: root/lld/ELF/DriverUtils.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplify. NFC.Rui Ueyama2016-11-201-3/+1
| | | | llvm-svn: 287510
* Remove a file that is too short to be an independent file.Rui Ueyama2016-11-191-0/+29
| | | | | | | We have a .cpp and a .h for parseDynamicList(). This patch moves the function to DriverUtil.cpp. llvm-svn: 287468
* Restore a comment that was accidentally changed.Rui Ueyama2016-11-191-2/+3
| | | | llvm-svn: 287457
* Use Optional<std::string> instead of "" to represent a failure.Rui Ueyama2016-11-191-9/+9
| | | | llvm-svn: 287456
* Make buildSysrootedPath file-scoped.Rui Ueyama2016-11-191-30/+28
| | | | | | This patch also changes its return type to simplify callers. llvm-svn: 287455
* Simplify "missing argument" error message.Rui Ueyama2016-11-191-3/+1
| | | | | | | We do not have an option taking more than one arguments, so we can just say "missing argument" instead of "missing argument(s)". llvm-svn: 287454
* [ELF] - format. NFC.George Rimar2016-11-141-4/+2
| | | | llvm-svn: 286805
* Consolidate BumpPtrAllocators.Rui Ueyama2016-10-281-2/+1
| | | | | | | | | | | Previously, we have a lot of BumpPtrAllocators, but all these allocators virtually have the same lifetime because they are not freed until the linker finishes its job. This patch aggregates them into a single allocator. Differential revision: https://reviews.llvm.org/D26042 llvm-svn: 285452
* Move getVersionString to Core and simplify Version.cpp.Rui Ueyama2016-10-191-8/+0
| | | | llvm-svn: 284641
* COFF: Implement /linkrepro flag.Peter Collingbourne2016-07-261-103/+3
| | | | | | | | | | | | | | | | This flag is implemented similarly to --reproduce in the ELF linker. This patch implements /linkrepro by moving the cpio writer and associated utility functions to lldCore, and using that implementation in both linkers. One COFF-specific detail is that we store the object file from which the resource files were created in our reproducer, rather than the resource files themselves. This allows the reproducer to be used on non-Windows systems for example. Differential Revision: https://reviews.llvm.org/D22418 llvm-svn: 276719
* Attempt to unbreak Windows bot.Rui Ueyama2016-07-161-1/+1
| | | | llvm-svn: 275695
* Remove redundant namespace specifiers.Rui Ueyama2016-07-161-2/+2
| | | | llvm-svn: 275694
* Do not call warning() from ELFOptTable::parse().Rui Ueyama2016-07-071-5/+2
| | | | | | | warning() depends on Config->FatalWarnings, so we don't want to call that function before we initialize that member. llvm-svn: 274723
* Fix indentation.Rui Ueyama2016-07-071-1/+1
| | | | llvm-svn: 274719
* [ELF] Introduce a flag to parse response files according to windows rules.Davide Italiano2016-07-061-3/+23
| | | | | | Differential Revision: http://reviews.llvm/org/D22015 llvm-svn: 274684
* Use / instead of \ on windows created cpio filesRafael Espindola2016-07-061-0/+5
| | | | | | | Otherwise when extracting these files on a unix system one ends up with files named like "repro\bar\foo.o". llvm-svn: 274622
* Create Strings.cpp and move string manipulation functions to that file.Rui Ueyama2016-06-291-16/+0
| | | | llvm-svn: 274109
* Fix library search order.Rui Ueyama2016-06-271-4/+9
| | | | | | | | Previously, we searched for a .so file from all library paths and then searched for a .a file. That logic is wrong. What we need to do is to look for a .so and a .a for each library path. llvm-svn: 273846
* Create version.txt in a reproduce archive file.Rui Ueyama2016-06-061-6/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D21008 llvm-svn: 271901
* Handle the -T option.Rafael Espindola2016-06-011-0/+1
| | | | | | We were not reading it or including in the --reproduce archive. llvm-svn: 271367
* Reorganize the cpio archiver as CpioFile class. NFC.Rui Ueyama2016-05-151-46/+39
| | | | | | This code separates the code to create cpio archive from the driver. llvm-svn: 269593
* Support --build-id=0x<hexstring>.Rui Ueyama2016-05-131-0/+16
| | | | | | | | If you specify the option in the form of --build-id=0x<hexstring>, that hexstring is set as a build ID. We observed that the feature is actually in use in some builds, so we want this feature. llvm-svn: 269495
* Add a link to the format description.Rafael Espindola2016-05-101-0/+2
| | | | llvm-svn: 269102
* Make --reproduce to not produce undesired whitespace.Rui Ueyama2016-05-041-4/+12
| | | | | | Fixes bug 27648. llvm-svn: 268569
* Print the cpio trailer after every member.Rafael Espindola2016-05-041-15/+18
| | | | | | | | | This is both simpler and safer. If we crash at any point, there is a valid cpio file to reproduce the crash. Thanks to Rui for the suggestion. llvm-svn: 268495
* Produce cpio files for --reproduce.Rafael Espindola2016-05-031-23/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want --reproduce to * not rewrite scripts and thin archives * work with absolute paths Given that, it pretty much has to create a full directory tree. On windows that is problematic because of the very short maximum path limit. On most cases users can still work around it with "--repro c:\r", but that is annoying and not viable for automated testing. We then need to produce some form of archive with the files. The first option that comes to mind is .a files since we already have code for writing them. There are a few problems with them The format has a dedicated string table, so we cannot start writing it until all members are known. Regular implementations don't support creating directories. We could make llvm-ar support that, but that is probably not a good idea. The next natural option would be tar. The problem is that to support long path names (which is how this started) it needs a "pax extended header" making this an annoying format to write. The next option I looked at seems a natural fit: cpio files. They are available on pretty much every unix, support directories and long path names and are really easy to write. The only slightly annoying part is a terminator, but at least gnu cpio only prints a warning if it is missing, which is handy for crashes. This patch still makes an effort to always create it. llvm-svn: 268404
* Simplify. NFC.Rafael Espindola2016-05-021-2/+1
| | | | llvm-svn: 268324
* Remove unnecessary namespace specifiers.Rui Ueyama2016-05-021-2/+2
| | | | llvm-svn: 268292
* Remove unnecessary namespace specifiers.Rui Ueyama2016-05-021-8/+8
| | | | llvm-svn: 268278
* Attempt to fix Windows bots.Rui Ueyama2016-05-021-1/+1
| | | | llvm-svn: 268275
* Fix --reproduce for --export-dynamic-symbol.Rui Ueyama2016-05-021-1/+0
| | | | | | --export-dynamic-symbol doesn't take path. llvm-svn: 268273
* Quote arguments for --reproduce.Rui Ueyama2016-05-021-1/+4
| | | | llvm-svn: 268258
* Don't include the output dir in the response file.Rafael Espindola2016-05-021-1/+1
| | | | | | | | With this it is possible to use chroot/fakechroot to have a completely reproducible link even when thin archives or linker scripts have absolute paths. llvm-svn: 268231
* Don't quote "--hash-style gnu".Rafael Espindola2016-05-021-1/+1
| | | | | | Otherwise lld fails to use the response file. llvm-svn: 268225
* ELF: --reproduce: quote pathnames for -L and other options.Rui Ueyama2016-04-301-12/+18
| | | | | | Previously, arguments for options that take pathnames were not rewritten. llvm-svn: 268172
* ELF: --reproduce: Copy files referenced by linker scripts.Rui Ueyama2016-04-301-9/+13
| | | | | | Previuosly, only files appeared on the command line were copied. llvm-svn: 268171
* Attempt to fix Windows buildbots.Rui Ueyama2016-04-301-2/+2
| | | | llvm-svn: 268170
* ELF: Make --reproduce to produce a response file.Rui Ueyama2016-04-301-16/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The aim of this patch is to make it easy to re-run the command without updating paths in the command line. Here is a use case. Assume that Alice is having an issue with lld and is reporting the issue to developer Bob. Alice's current directly is /home/alice/work and her command line is "ld.lld -o foo foo.o ../bar.o". She adds "--reproduce repro" to the command line and re-run. Then the following text will be produced as response.txt (notice that the paths are rewritten so that they are relative to /home/alice/work/repro.) -o home/alice/work/foo home/alice/work/foo.o home/alice/bar.o The command also produces the following files by copying inputs. /home/alice/repro/home/alice/work/foo.o /home/alice/repro/home/alice/bar.o Alice zips the directory and send it to Bob. Bob get an archive from Alice and extract it to his home directory as /home/bob/repro. Now his directory have the following files. /home/bob/repro/response.txt /home/bob/repro/home/alice/work/foo.o /home/bob/repro/home/alice/bar.o Bob then re-run the command with these files by the following commands. cd /home/bob/repro ld.lld @response.txt This command will run the linker with the same command line options and the same input files as Alice's, so it is very likely that Bob will see the same issue as Alice saw. Differential Revision: http://reviews.llvm.org/D19737 llvm-svn: 268169
* Move utility functions to DriverUtils.cpp.Rui Ueyama2016-04-261-0/+28
| | | | llvm-svn: 267602
* Variable names should start with uppercase letters.Rui Ueyama2016-04-021-4/+3
| | | | llvm-svn: 265239
* Simplify. NFC.Rui Ueyama2016-03-291-11/+5
| | | | llvm-svn: 264785
* ELF: Fix use-after-free problem.Rui Ueyama2016-03-151-9/+4
| | | | | | | | | Fixes pr26908. This patch is based on Filipe Cabecinhas' patch (http://reviews.llvm.org/D18167) http://reviews.llvm.org/D18169 llvm-svn: 263569
* Print out newline in both cases.Rui Ueyama2016-03-131-1/+2
| | | | llvm-svn: 263401
* This reverts the r263125George Rimar2016-03-111-3/+3
| | | | | | | | | | | | | | | | | | | | It was discussed to make all messages be lowercase to be consistent with clang. (also reverts the r263128 which fixed build bot fail after r263125) Original commit message: [ELF] - Consistent spelling for error/warning messages Previously error and warnings were not consistent in lld. Some of them started from lowercase letter, others from uppercase. Also there was one or two which had a dot at the end. This patch changes all messages to start from uppercase letter if they were not before. Differential revision: http://reviews.llvm.org/D18045 llvm-svn: 263240
* [ELF] - Consistent spelling for error/warning messagesGeorge Rimar2016-03-101-3/+3
| | | | | | | | | | | | Previously error and warnings were not consistent in lld. Some of them started from lowercase letter, others from uppercase. Also there was one or two which had a dot at the end. This patch changes all messages to start from uppercase letter if they were not before. Differential revision: http://reviews.llvm.org/D18045 llvm-svn: 263125
* ELF: Add --help option.Rui Ueyama2016-02-281-0/+5
| | | | llvm-svn: 262168
* ELF: Add --version option.Rui Ueyama2016-02-281-0/+8
| | | | llvm-svn: 262167
* Rename elf2 to elf.Rafael Espindola2016-02-281-6/+6
| | | | llvm-svn: 262159
* Re-submit ELF: Report multiple errors from the driver.Rui Ueyama2016-02-021-4/+3
| | | | | | This reverts r259395 which reverted r259143. llvm-svn: 259572
* Revert r259143, it broke check-lld on Windows (see PR26388).Nico Weber2016-02-011-3/+4
| | | | llvm-svn: 259395
OpenPOWER on IntegriCloud