summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2018-04-07Merging r327135:Tom Stellard
------------------------------------------------------------------------ r327135 | hans | 2018-03-09 06:46:44 -0800 (Fri, 09 Mar 2018) | 7 lines CMake: Make libxml2 show up in --system-libs (PR36660) lib/WindowsManifest/CMakeLists.txt adds it to LLVM_SYSTEM_LIBS on that target, but it was never getting picked up in tools/llvm-config/CMakeLists.txt. Differential Revision: https://reviews.llvm.org/D44302 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@329482 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-02Merging r323155:Hans Wennborg
------------------------------------------------------------------------ r323155 | chandlerc | 2018-01-22 23:05:25 +0100 (Mon, 22 Jan 2018) | 133 lines Introduce the "retpoline" x86 mitigation technique for variant #2 of the speculative execution vulnerabilities disclosed today, specifically identified by CVE-2017-5715, "Branch Target Injection", and is one of the two halves to Spectre.. Summary: First, we need to explain the core of the vulnerability. Note that this is a very incomplete description, please see the Project Zero blog post for details: https://googleprojectzero.blogspot.com/2018/01/reading-privileged-memory-with-side.html The basis for branch target injection is to direct speculative execution of the processor to some "gadget" of executable code by poisoning the prediction of indirect branches with the address of that gadget. The gadget in turn contains an operation that provides a side channel for reading data. Most commonly, this will look like a load of secret data followed by a branch on the loaded value and then a load of some predictable cache line. The attacker then uses timing of the processors cache to determine which direction the branch took *in the speculative execution*, and in turn what one bit of the loaded value was. Due to the nature of these timing side channels and the branch predictor on Intel processors, this allows an attacker to leak data only accessible to a privileged domain (like the kernel) back into an unprivileged domain. The goal is simple: avoid generating code which contains an indirect branch that could have its prediction poisoned by an attacker. In many cases, the compiler can simply use directed conditional branches and a small search tree. LLVM already has support for lowering switches in this way and the first step of this patch is to disable jump-table lowering of switches and introduce a pass to rewrite explicit indirectbr sequences into a switch over integers. However, there is no fully general alternative to indirect calls. We introduce a new construct we call a "retpoline" to implement indirect calls in a non-speculatable way. It can be thought of loosely as a trampoline for indirect calls which uses the RET instruction on x86. Further, we arrange for a specific call->ret sequence which ensures the processor predicts the return to go to a controlled, known location. The retpoline then "smashes" the return address pushed onto the stack by the call with the desired target of the original indirect call. The result is a predicted return to the next instruction after a call (which can be used to trap speculative execution within an infinite loop) and an actual indirect branch to an arbitrary address. On 64-bit x86 ABIs, this is especially easily done in the compiler by using a guaranteed scratch register to pass the target into this device. For 32-bit ABIs there isn't a guaranteed scratch register and so several different retpoline variants are introduced to use a scratch register if one is available in the calling convention and to otherwise use direct stack push/pop sequences to pass the target address. This "retpoline" mitigation is fully described in the following blog post: https://support.google.com/faqs/answer/7625886 We also support a target feature that disables emission of the retpoline thunk by the compiler to allow for custom thunks if users want them. These are particularly useful in environments like kernels that routinely do hot-patching on boot and want to hot-patch their thunk to different code sequences. They can write this custom thunk and use `-mretpoline-external-thunk` *in addition* to `-mretpoline`. In this case, on x86-64 thu thunk names must be: ``` __llvm_external_retpoline_r11 ``` or on 32-bit: ``` __llvm_external_retpoline_eax __llvm_external_retpoline_ecx __llvm_external_retpoline_edx __llvm_external_retpoline_push ``` And the target of the retpoline is passed in the named register, or in the case of the `push` suffix on the top of the stack via a `pushl` instruction. There is one other important source of indirect branches in x86 ELF binaries: the PLT. These patches also include support for LLD to generate PLT entries that perform a retpoline-style indirection. The only other indirect branches remaining that we are aware of are from precompiled runtimes (such as crt0.o and similar). The ones we have found are not really attackable, and so we have not focused on them here, but eventually these runtimes should also be replicated for retpoline-ed configurations for completeness. For kernels or other freestanding or fully static executables, the compiler switch `-mretpoline` is sufficient to fully mitigate this particular attack. For dynamic executables, you must compile *all* libraries with `-mretpoline` and additionally link the dynamic executable and all shared libraries with LLD and pass `-z retpolineplt` (or use similar functionality from some other linker). We strongly recommend also using `-z now` as non-lazy binding allows the retpoline-mitigated PLT to be substantially smaller. When manually apply similar transformations to `-mretpoline` to the Linux kernel we observed very small performance hits to applications running typical workloads, and relatively minor hits (approximately 2%) even for extremely syscall-heavy applications. This is largely due to the small number of indirect branches that occur in performance sensitive paths of the kernel. When using these patches on statically linked applications, especially C++ applications, you should expect to see a much more dramatic performance hit. For microbenchmarks that are switch, indirect-, or virtual-call heavy we have seen overheads ranging from 10% to 50%. However, real-world workloads exhibit substantially lower performance impact. Notably, techniques such as PGO and ThinLTO dramatically reduce the impact of hot indirect calls (by speculatively promoting them to direct calls) and allow optimized search trees to be used to lower switches. If you need to deploy these techniques in C++ applications, we *strongly* recommend that you ensure all hot call targets are statically linked (avoiding PLT indirection) and use both PGO and ThinLTO. Well tuned servers using all of these techniques saw 5% - 10% overhead from the use of retpoline. We will add detailed documentation covering these components in subsequent patches, but wanted to make the core functionality available as soon as possible. Happy for more code review, but we'd really like to get these patches landed and backported ASAP for obvious reasons. We're planning to backport this to both 6.0 and 5.0 release streams and get a 5.0 release with just this cherry picked ASAP for distros and vendors. This patch is the work of a number of people over the past month: Eric, Reid, Rui, and myself. I'm mailing it out as a single commit due to the time sensitive nature of landing this and the need to backport it. Huge thanks to everyone who helped out here, and everyone at Intel who helped out in discussions about how to craft this. Also, credit goes to Paul Turner (at Google, but not an LLVM contributor) for much of the underlying retpoline design. Reviewers: echristo, rnk, ruiu, craig.topper, DavidKreitzer Subscribers: sanjoy, emaste, mcrosier, mgorny, mehdi_amini, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D41723 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@324067 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-16Merging r321980:Hans Wennborg
------------------------------------------------------------------------ r321980 | phosek | 2018-01-07 18:23:10 -0800 (Sun, 07 Jan 2018) | 5 lines [llvm-readobj] Support -needed-libs option for Mach-O files This implements the -needed-libs option in Mach-O dumper. Differential Revision: https://reviews.llvm.org/D41527 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_60@322561 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03Thread MCSubtargetInfo through Target::createMCAsmBackendAlex Bradbury
Currently it's not possible to access MCSubtargetInfo from a TgtMCAsmBackend. D20830 threaded an MCSubtargetInfo reference through MCAsmBackend::relaxInstruction, but this isn't the only function that would benefit from access. This patch removes the Triple and CPUString arguments from createMCAsmBackend and replaces them with MCSubtargetInfo. This patch just changes the interface without making any intentional functional changes. Once in, several cleanups are possible: * Get rid of the awkward MCSubtargetInfo handling in ARMAsmBackend * Support 16-bit instructions when valid in MipsAsmBackend::writeNopData * Get rid of the CPU string parsing in X86AsmBackend and just use a SubtargetFeature for HasNopl * Emit 16-bit nops in RISCVAsmBackend::writeNopData if the compressed instruction set extension is enabled (see D41221) This change initially exposed PR35686, which has since been resolved in r321026. Differential Revision: https://reviews.llvm.org/D41349 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321692 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-02[llvm-objcopy] Add support for visibilityJake Ehrlich
I have no clue how this was missed when symbol table support was added. This change ensures that the visibility of symbols is preserved by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28Fix tests after move to utohexstr.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321527 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer
Some output changes from uppercase hex to lowercase hex, no other functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-28[dsymutil][NFC] Replace calls to CoreFoundation with LLVM equivalent.Jonas Devlieghere
This patch replaces a block of logic that was implemented using CoreFoundations calls with functionally equivalent logic that makes use of LLVM libraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-27[llvm-readobj] Support -needed-libs option for COFF filesPetr Hosek
This implements the -needed-libs option in the COFF dumper. Differential Revision: https://reviews.llvm.org/D41529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[llvm-readobj] Fix ambiguous call to the `printNumber`Simon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-21[llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumpingSimon Atanasyan
This change adds `printMipsGOT` and `printMipsPLT` methods to the `DumpStyle` class and overrides them in the `GNUStyle` and `LLVMStyle` descendants. To pass information about GOT/PLT layout into these methods, the `MipsGOTParser` class has been extended to hold all necessary data. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20[opt-viewer] Also demangle indirect-call promotion targetsAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[Support][CachePruning] Disable cache pruning regression fixBen Dunbobbin
borked by: rL284966 (see: https://reviews.llvm.org/D25730). Previously, Interval was unsigned (see: CachePruning.h), replacing the type with std::chrono::seconds (which is signed) causes a regression in behaviour because the c-api intends negative values to translate to large positive intervals to *effectively* disable the pruning (see comments on: setCachePruningInterval()). Differential Revision: https://reviews.llvm.org/D41231 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321077 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[dwarfdump] Lookup needs to be an unsigned long long parameter.Jonas Devlieghere
Before this patch, dwarfdump's lookup parameter only accepts unsigned. Given that for many current platforms the load address already exceeds unsigned (e.g. arm64 w/ 0x100000000), dwarfdump needs an unsigned long long parameter. Patch by: Dr. Michael 'Mickey' Lauer <mickey@vanille-media.de> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321064 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[llvm-objcopy] Add option to add a progbits section from a fileJake Ehrlich
This change adds support for adding progbits sections with contents from a file Differential Revision: https://reviews.llvm.org/D41212 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19[llvm-readobj] Dump wasm init functionsSam Clegg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321042 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18Fix more inconsistent line endings. NFC.Dimitry Andric
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321016 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18[YAML] Add support for non-printable charactersFrancis Visoiu Mistrih
LLVM IR function names which disable mangling start with '\01' (https://www.llvm.org/docs/LangRef.html#identifiers). When an identifier like "\01@abc@" gets dumped to MIR, it is quoted, but only with single quotes. http://www.yaml.org/spec/1.2/spec.html#id2770814: "The allowed character range explicitly excludes the C0 control block allowed), the surrogate block #xD800-#xDFFF, #xFFFE, and #xFFFF." http://www.yaml.org/spec/1.2/spec.html#id2776092: "All non-printable characters must be escaped. [...] Note that escape sequences are only interpreted in double-quoted scalars." This patch adds support for printing escaped non-printable characters between double quotes if needed. Should also fix PR31743. Differential Revision: https://reviews.llvm.org/D41290 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-16Fixed warning 'function declaration isn’t a prototype ↵Galina Kistanova
[-Werror=strict-prototypes]' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15[llvm-objcopy] Reformat everything using clang-format -iJake Ehrlich
Overtime some non-clang formatted code has creeped into llvm-objcopy. This patch fixes all of that. Differential Revision: https://reviews.llvm.org/D41262 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent
Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. All tests are passing for llvm, clang, and lld. llvm-objdump builds without compiler warnings. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41199 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320832 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15[LLVMgold] Don't set undefined symbol as prevailingEugene Leviant
Differential revision: https://reviews.llvm.org/D41113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320794 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-15Don't crash in llvm-pdbutil when dumping TypeIndexes with high bit set.Zachary Turner
This is a special code that indicates that it's a function id. While I'm still not certain how to interpret these, we definitely should *not* be using these values as indices into an array directly. For now, when we encounter one of these, just print the numeric value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320775 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[WebAssembly] Add support for init functions linking metadataSam Clegg
Summary: This change lays the groundwork lowering of @llvm.global_ctors and @llvm.global_dtors for the wasm object format. Some parts of this patch are subset of: https://reviews.llvm.org/D40759 See https://github.com/WebAssembly/tool-conventions/issues/25 Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41208 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320742 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[opt-viewer] Render utf-8 characters properly in the generated HTMLAdam Nemet
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320729 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14[opt-viewer] Support unicode characters in function namesAdam Nemet
This is a Swift feature. The output stream for the index page and the source HTML page is utf-8 now. The next patch will add the HTML magic to properly render these characters in the browser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13Recover some overzealously removed includes.Michael Zolotukhin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[WebAssembly] Add linking metatdata test coverage for wasm2yamlSam Clegg
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish Differential Revision: https://reviews.llvm.org/D41196 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320639 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13Remove redundant includes from tools.Michael Zolotukhin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13[dsymutil] Re-enable threadingJonas Devlieghere
Threading was disabled in r317263 because it broke a test in combination with `-DLLVM_ENABLE_THREADS=OFF`. This was because a ThreadPool warning was piped to llvm-dwarfdump which was expecting to read an object from stdin. This patch re-enables threading and fixes the offending test. Unfortunately this required more than just moving the ThreadPool out of the for loop because of the TempFile refactoring that took place in the meantime. Differential revision: https://reviews.llvm.org/D41180 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320601 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13reverting out -r320532 because a warning is breaking the lld buildMichael Trent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent
Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41061 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12[dsymutil] Accept line tables up to DWARFv5.Jonas Devlieghere
This patch removes the hard-coded check for DWARFv2 line tables. Now dsymutil accepts line tables for DWARF versions 2 to 5 (inclusive). Differential revision: https://reviews.llvm.org/D41084 rdar://35968319 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11[llvm-cov] Add an option for "export" command to emit only file summary data.Max Moroz
Summary: That allows to get the same data as produced by "llvm-cov report", but in JSON format, which is better for further processing by end users. Reviewers: vsk Reviewed By: vsk Differential Revision: https://reviews.llvm.org/D41085 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08dwarfdump: Add support for the --diff option.Adrian Prantl
--diff Emit the output in a diff-friendly way by omitting offsets and addresses. <rdar://problem/34502625> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08[Debugify] Add a pass to test debug info preservationVedant Kumar
The Debugify pass synthesizes debug info for IR. It's paired with a CheckDebugify pass which determines how much of the original debug info is preserved. These passes make it easier to create targeted tests for debug info preservation. Here is the Debugify algorithm: NextLine = 1 for (Instruction &I : M) attach DebugLoc(NextLine++) to I NextVar = 1 for (Instruction &I : M) if (canAttachDebugValue(I)) attach dbg.value(NextVar++) to I The CheckDebugify pass expects contiguous ranges of DILocations and DILocalVariables. If it fails to find all of the expected debug info, it prints a specific error to stderr which can be FileChecked. This was discussed on llvm-dev in the thread: "Passes to add/validate synthetic debug info" Differential Revision: https://reviews.llvm.org/D40512 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Reverting r320166 to fix test failures.Michael Trent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320174 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08Updated llvm-objdump to display local relocations in Mach-O binariesMichael Trent
Summary: llvm-objdump's Mach-O parser was updated in r306037 to display external relocations for MH_KEXT_BUNDLE file types. This change extends the Macho-O parser to display local relocations for MH_PRELOAD files. When used with the -macho option relocations will be displayed in a historical format. rdar://35778019 Reviewers: enderby Reviewed By: enderby Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40867 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320166 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07[dsymutil] Add -verify option to run DWARF verifier after linking.Jonas Devlieghere
This patch adds support for running the DWARF verifier on the linked debug info files. If the -verify options is specified and verification fails, dsymutil exists with abort with non-zero exit code. This behavior is *not* enabled by default. Differential revision: https://reviews.llvm.org/D40777 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Update obj2yaml and yaml2obj for .debug$H section.Zachary Turner
Differential Revision: https://reviews.llvm.org/D40842 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319925 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06[opt-viewer] Suppress noisy Swift remarksAdam Nemet
Most likely, this is not how we want to handle this in the long term. This code should probably be in the Swift repo and somehow plugged into the opt-viewer. This is still however very experimental at this point so I don't want to over-engineer it at this point. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319902 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06Fix error in llvm-pdbutil.Zachary Turner
A recent change made this print the wrong value, breaking some tests. This is now fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319862 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Teach llvm-pdbutil to dump types from object files.Zachary Turner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai
We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05Test commit, as per the LLVM Developer Policy.Michael Trent
Commit message, as per the same policy. I added a blank space to the end of the file. Excelsior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319743 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Remove redundant local variables to reduce the code. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Print static MIPS GOTSimon Atanasyan
If a linked binary file contains a dynamic section, the GOT layout defined by the dynamic section entries. In a statically linked file the GOT is just a series of entries. This change teaches `llvm-readobj` to print the GOT in that case. That provides a feature parity with GNU `readelf`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319616 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-02[llvm-readobj] Delete unused method argument. NFCSimon Atanasyan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm] Add stripped installation targetsShoaib Meenai
CMake's generated installation scripts support `CMAKE_INSTALL_DO_STRIP` to enable stripping the installed binaries. LLVM's build system doesn't expose this option to the `install-` targets, but it's useful in conjunction with `install-distribution`. Add a new function to create the install targets, which creates both the regular install target and a second install target that strips during installation. Change the creation of all installation targets to use this new function. Stripping doesn't make a whole lot of sense for some installation targets (e.g. the LLVM headers), but consistency doesn't hurt. I'll make other repositories (e.g. clang, compiler-rt) use this in a follow-up, and then add an `install-distribution-stripped` target to actually accomplish the end goal of creating a stripped distribution. I don't want to do that step yet because the creation of that target would depend on the presence of the `install-*-stripped` target for each distribution component, and the distribution components from other repositories will be missing that target right now. Differential Revision: https://reviews.llvm.org/D40620 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319480 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30[llvm-objcopy] Add support for --only-keep/-j and --keepJake Ehrlich
This change adds support for the --only-keep option and the -j alias as well. A common use case for these being used together is to dump a specific section's data. Additionally the --keep option is added (GNU objcopy doesn't have this) to avoid removing a bunch of things. This allows people to err on the side of stripping aggressively and then to keep the specific bits that they need for their application. Differential Revision: https://reviews.llvm.org/D39021 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319467 91177308-0d34-0410-b5e6-96231b3b80d8