summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/dsymutil.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [dsymutil] Implement the --threads optionJonas Devlieghere2017-10-311-4/+34
| | | | | | | | | | | | | | This patch adds the --threads option to dsymutil to process architectures in parallel. The feature is already present in the version distributed with Xcode, but was not yet upstreamed. This is NFC as far as the linking behavior is concerned. As threads are used automatically, the current tests cover the change in implementation. Differential revision: https://reviews.llvm.org/D39355 llvm-svn: 316999
* Re-land "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-131-1/+5
| | | | | | | | | | This patch adds timestamp verification for swiftmodule files. A new flag is provided to allows us to disable this check in order to allow testing of this feature. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315684
* Revert "[dsymutil] Timestmap verification for __swift_ast"Jonas Devlieghere2017-10-111-5/+1
| | | | | | This reverts commit r315456. llvm-svn: 315458
* [dsymutil] Timestmap verification for __swift_astJonas Devlieghere2017-10-111-1/+5
| | | | | | | | | | | | This patch adds timestamp verification for swiftmodule files. - A new flag is provided to allows us to continue testing of the code for embedding the__swift_ast. (git doesn't maintain timestamps) - Adds a new test for fat (arm) binaries. Differential revision: https://reviews.llvm.org/D38686 llvm-svn: 315456
* Don't call exit from cl::PrintHelpMessage.Rafael Espindola2017-09-071-1/+3
| | | | | | | | | Most callers were not expecting the exit(0) and trying to exit with a different value. This also adds back the call to cl::PrintHelpMessage in llvm-ar. llvm-svn: 312761
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-1/+1
| | | | | | | looking for it along $PATH. This allows installs of LLVM tools outside of $PATH to find the symbolizer and produce pretty backtraces if they crash. llvm-svn: 272232
* [dsymutil] Create the temporary files in the system temp directory.Frederic Riss2016-05-021-3/+6
| | | | | | | | | | llvm-dsymutil used to create the temporary files in the output directory. This works fine except when the output directory contains a '%' char, which is then replaced by llvm::sys::fs::createUniqueFile() generating an invalid path. Just use the default temp dir for those files. llvm-svn: 268304
* [dsymutil] Prevent warningFrederic Riss2015-10-091-1/+2
| | | | llvm-svn: 249836
* [dsymutil] Try to find lipo first besides dsymutil before looking up the PATH.Frederic Riss2015-10-081-1/+4
| | | | | | | | Even if we don't have it in PATH, lipo should usually exist in the same directory as dsymutil. Keep the fallback looking up the PATH, it's very useful when testing a non-installed executable. llvm-svn: 249762
* dsymutil: Make -oso-prepend-path available to DwarfLinker.Adrian Prantl2015-09-221-0/+1
| | | | | | NFC llvm-svn: 248312
* [dsymutil] Implement -symtab/-s option.Frederic Riss2015-08-311-0/+14
| | | | | | | This option dumps the STAB entries that define the debug map(s) stored in the input binaries, and then exits. llvm-svn: 246403
* [dsymutil] Reapply r245960.Frederic Riss2015-08-251-1/+2
| | | | | | | | | | | | | | | | | | There was an issue in the test setup because the test requires an arch that wasn't filtered by the lit.local.cfg, but given the set of bots that failed, I'm not confident this is the (only) issue. So this commit also adds more output to the test to help me track down the failure if it happens again. Original commit message: [dsymutil] Rewrite thumb triple names in user visible messages. We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245988
* Revert "[dsymutil] Rewrite thumb triple names in user visible messages."Frederic Riss2015-08-251-2/+1
| | | | | | | | This reverts commit r245960. Multiple bots are failing on the new test. It seemd like llvm-dsymutil exits with an error. Investigating. llvm-svn: 245964
* [dsymutil] Rewrite thumb triple names in user visible messages.Frederic Riss2015-08-251-1/+2
| | | | | | | | | | We autodetect triples from the input file(s) while reading the mach-o debug map. As we need to create a Target from those triples, we always chose the thumb variant (because the arm variant might not be 'instantiable' eg armv7m). The user visible architecture names should still be 'arm' and not 'thumb' variants though. llvm-svn: 245960
* [dsymutil] Not finding any debug info is not a fatal errorFrederic Riss2015-08-251-0/+4
| | | | llvm-svn: 245959
* [dsymutil] Implement dSYM bundle creationFrederic Riss2015-08-061-6/+101
| | | | | | | | | | | | | | A dSYM bundle is a file hierarchy that looks slike this: <bundle name>.dSYM/ Contents/ Info.plist Resources/ DWARF/ <DWARF file(s)> This is the default output mode of dsymutil. llvm-svn: 244270
* [dsymutil] Add (unimplemented) --flat optionFrederic Riss2015-08-061-2/+12
| | | | | | | | | | | | | | dsymutil should by default generate dSYM bundles which are filesystem hierarchies containing the debug info and an additional Info.plist. Currently llvm-dsymutil emits raw binaries containing the debug info. This is what we call the 'flat mode'. Add a -f/-flat option that is supposed to enable that flat mode, but don't wire it for now, only pass it to the tests that will need it to stay functional once we do bundle generation by default. This basically makes this commit NFC and removes the noise from the actual commit that adds support for bundle generation. llvm-svn: 244269
* [dsymutil] Do not create temporary files in -no-output mode.Frederic Riss2015-08-051-5/+19
| | | | | | | | | The files were never written to and then deleted, but they were created nonetheless. To prevent that, create a wrapper around the 2 variants of createUniqueFile and use the one that only does an access(Exists) call to check for name unicity in -no-output mode. llvm-svn: 244172
* [dsymutil] Add support for the -arch option.Frederic Riss2015-08-051-2/+23
| | | | | | | | This option allows to select a subset of the architectures when performing a universal binary link. The filter is done completely in the mach-o specific part of the code. llvm-svn: 244160
* [dsymutil] Implement support for handling mach-o universal binaries as main ↵Frederic Riss2015-08-051-10/+46
| | | | | | | | | | | | | | | | | input/output. The DWARF linker isn't touched by this, the implementation links individual files and merges them together into a fat binary by calling out to the 'lipo' utility. The main change is that the MachODebugMapParser can now return multiple debug maps for a single binary. The test just verifies that lipo would be invoked correctly, but doesn't actually generate a binary. This mimics the way clang tests its external iplatform tools integration. llvm-svn: 244087
* [dsymutil] Introduce exit helper. NFC.Frederic Riss2015-08-051-3/+7
| | | | | | | | llvm-dsymutil will start creating temporary files in a followup commit. To ease the correct cleanup of this files, introduce a helper called to exit dsymutil. llvm-svn: 244086
* [dsymutil] Split some logic into a helper function. NFCFrederic Riss2015-08-051-10/+10
| | | | llvm-svn: 244085
* [dsymutil] Support multiple input files on the command lineFrederic Riss2015-07-311-23/+33
| | | | llvm-svn: 243777
* [dsymutil] Re-add command line option -v this time printing the version.Frederic Riss2015-07-291-0/+6
| | | | llvm-svn: 243584
* [dsymutil] Use option categories.Frederic Riss2015-07-291-9/+22
| | | | | | | | Prevent all the unrelated LLVM options to appear in the -help output by introducing a tool specific option category. As a drive-by improve the wording of the help message. llvm-svn: 243583
* [dsymutil] Rename -v option to -verboseFrederic Riss2015-07-291-1/+1
| | | | | | | | | | | | The dsymutil-classic -v option dumps the tool version rather than putting it in verbose mode. Rename -v to -verbose and update the tests that use it (in the process removing it from a few tests that didn't require it anymore since the -dump-debug-map option was introduced). A followup commit will reintroduce the -v option that dumps the version. llvm-svn: 243582
* [dsymutil] Implement ODR uniquing for C++ code.Frederic Riss2015-07-211-0/+6
| | | | | | | | | | | | | | | | | This optimization allows the DWARF linker to reuse definition of types it has emitted in previous CUs rather than reemitting them in each CU that references them. The size and link time gains are huge. For example when linking the DWARF for a debug build of clang, this generates a ~150M dwarf file instead of a ~700M one (the numbers date back a bit and must not be totally accurate these days). As with all the other parts of the llvm-dsymutil codebase, the goal is to keep bit-for-bit compatibility with dsymutil-classic. The code is littered with a lot of FIXMEs that should be addressed once we can get rid of the compatibilty goal. llvm-svn: 242847
* Reapply r238941 - [dsymutil] Accept a YAML debug map as input instead of a ↵Frederic Riss2015-06-031-1/+7
| | | | | | | | | | | | | | | | | | | | | binary. With a couple more constructors that GCC thinks are necessary. Original commit message: [dsymutil] Accept a YAML debug map as input instead of a binary. To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238959
* Revert "[dsymutil] Accept a YAML debug map as input instead of a binary."Frederic Riss2015-06-031-7/+1
| | | | | | This reverts commit r238941 while I figure out the bot issues. llvm-svn: 238943
* [dsymutil] Accept a YAML debug map as input instead of a binary.Frederic Riss2015-06-031-1/+7
| | | | | | | | | | | | | To do this, the user needs to pass the new -y flag. As it wasn't tested before, the debug map YAML deserialization was completely buggy (mainly because the DebugMapObject has a dual mapping that allows to search by name and by address, but only the StringMap got populated). It's fixed and tested in this commit by augmenting some test with a 2 stage dwarf link: a frist llvm-dsymutil reads the debug map and pipes it in a second instance that does the actual link without touching the initial binary. llvm-svn: 238941
* [dsymutil] Replace -parse-only option with -dump-debug-mapFrederic Riss2015-06-031-6/+7
| | | | | | | | | | As the serialized debug map is becoming a first class citizen, a way to cleanly dump it is required. We used -parse-only combined with -v for that purpose before, but it dumps a lot of unrelated debug stuff. Dumping the debug map was the only use of the -parse-only flag anyway, so replace it with a more useful option. llvm-svn: 238940
* [dsymutil] Reflow option declarations to be more readable.Frederic Riss2015-06-031-12/+13
| | | | llvm-svn: 238939
* [dsymutil] Add the DwarfStreamer class.Frederic Riss2015-02-281-0/+11
| | | | | | | | | | | | | | | | | | | | This class is responsible for getting the linked data to the disk in the appropriate form. Today it it an empty shell that just instantiates an MC layer. As we do not put anything in the resulting file yet, we just check it has the right architecture (and check that -o does the right thing). To be able to create all the components, this commit adds a few dependencies to llvm-dsymutil, namely all-targets, MC and AsmPrinter. Also add a -no-output option, so that tests that do not need the binary result can continue to run even if they do not have the required target linked in. llvm-svn: 230824
* [dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.Frederic Riss2015-02-281-1/+4
| | | | | | | The only option we have to pass down currently is verbosity, but there are more to come. llvm-svn: 230823
* [dsymutil] Add -o option to select ouptut filenameFrederic Riss2015-02-281-4/+14
| | | | | | We do not create the output file yet, so no means to test. llvm-svn: 230821
* [cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth2015-01-141-4/+2
| | | | | | | | | | | utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
* [dsymutil] Pass the verbosity flag down to the processing. NFC for now.Frederic Riss2014-12-161-2/+2
| | | | llvm-svn: 224361
* Initial dsymutil tool commit.Frederic Riss2014-12-121-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 224134
* Revert "Initial dsymutil tool commit."Frederic Riss2014-12-091-67/+0
| | | | | | This reverts commit r223793. The review thread wasn't concluded. llvm-svn: 223794
* Initial dsymutil tool commit.Frederic Riss2014-12-091-0/+67
The goal of this tool is to replicate Darwin's dsymutil functionality based on LLVM. dsymutil is a DWARF linker. Darwin's linker (ld64) does not link the debug information, it leaves it in the object files in relocatable form, but embbeds a `debug map` into the executable that describes where to find the debug information and how to relocate it. When releasing/archiving a binary, dsymutil is called to link all the DWARF information into a `dsym bundle` that can distributed/stored along with the binary. With this commit, the LLVM based dsymutil is just able to parse the STABS debug maps embedded by ld64 in linked binaries (and not all of them, for example archives aren't supported yet). Note that the tool directory is called dsymutil, but the executable is currently called llvm-dsymutil. This discrepancy will disappear once the tool will be feature complete. At this point the executable will be renamed to dsymutil, but until then you do not want it to override the system one. Differential Revision: http://reviews.llvm.org/D6242 llvm-svn: 223793
OpenPOWER on IntegriCloud