summaryrefslogtreecommitdiffstats
path: root/lib/Support
Commit message (Collapse)AuthorAgeFilesLines
* Merging r313998:Tom Stellard2017-09-281-0/+1
| | | | | | | | | | | | ------------------------------------------------------------------------ r313998 | bmakam | 2017-09-22 10:46:36 -0700 (Fri, 22 Sep 2017) | 3 lines [Falkor] Add falkor CPU to host detection This returns "falkor" for Falkor CPU. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@314437 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r304835: It's not clear printing all targets with --version is the ↵Hans Wennborg2017-07-272-9/+12
| | | | | | right thing to do (see discussion on D33900) git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@309286 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r308483:Hans Wennborg2017-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r308483 | hans | 2017-07-19 08:03:38 -0700 (Wed, 19 Jul 2017) | 12 lines Defeat a GCC -Wunused-result warning It was warning like: ../llvm-project/llvm/lib/Support/ErrorHandling.cpp:172:51: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result] (void)::write(2, OOMMessage, strlen(OOMMessage)); Work around the warning by storing the return value in a variable and casting that to void instead. We already did this for the other write() call in this file. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_50@308487 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Add support for IBM z14 processor (1/3)Ulrich Weigand2017-07-171-0/+2
| | | | | | | | | | | | | | | | This patch series adds support for the IBM z14 processor. This part includes: - Basic support for the new processor and its features. - Support for new instructions (except vector 32-bit float and 128-bit float). - CodeGen for new instructions, including new LLVM intrinsics. - Scheduler description for the new processor. - Detection of z14 as host processor. Support for the new 32-bit vector float and 128-bit vector float instructions is provided by separate patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308194 91177308-0d34-0410-b5e6-96231b3b80d8
* [YAMLTraits] Add filename support to yaml::InputAlex Bradbury2017-07-171-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: The current yaml::Input constructor takes a StringRef of data as its first parameter, discarding any filename information that may have been present when a YAML file was opened. Add an alterate yaml::Input constructor that takes a MemoryBufferRef, which can have a filename associated with it. This leads to clearer diagnostic messages. Sponsored By: DARPA, AFRL Reviewed By: arphaman Differential Revision: https://reviews.llvm.org/D35398 Patch by: Jonathan Anderson (trombonehero) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308172 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Use MSVC's __cpuidex intrinsic instead of inline assembly in ↵Craig Topper2017-07-171-29/+10
| | | | | | | | | | getHostCPUName/getHostCPUFeatures for 32-bit builds too. We're already using it in 64-bit builds because 64-bit MSVC doesn't support inline assembly. As far as I know we were using inline assembly because at the time the code was added we had to support MSVC 2008 pre-SP1 while the intrinsic was added to MSVC in SP1. Now that we don't have to support that we should be able to just use the intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308163 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/Path.cpp: Prune unused "llvm/BinaryFormat".NAKAMURA Takumi2017-07-171-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308160 91177308-0d34-0410-b5e6-96231b3b80d8
* Put std::mutex usage behind #ifdefs to pacify the sanitizer buildbotReid Kleckner2017-07-131-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307925 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: Add llvm::center_justify.Frederich Munch2017-07-131-6/+23
| | | | | | | | | | | | | | Summary: Completes the set. Reviewers: ruiu Reviewed By: ruiu Subscribers: ruiu, llvm-commits Differential Revision: https://reviews.llvm.org/D35278 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307922 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add an SVE target feature to the backend and TargetParser.Amara Emerson2017-07-131-0/+2
| | | | | | | The feature will be used properly once assembler/disassembler support begins to land. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307917 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Simplify the getHostCPUName for AMD family 6 and 15.Craig Topper2017-07-131-38/+11
| | | | | | As far as I can tell we can simply distinguish based on features rather than model number. Many of the strings we were previously using are treated the same by the backend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307884 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow clients to specify search order of DynamicLibraries.Frederich Munch2017-07-123-11/+37
| | | | | | | | | | | | | | Summary: Different JITs and other clients of LLVM may have different needs in how symbol resolution should occur. Reviewers: v.g.vassilev, lhames, karies Reviewed By: v.g.vassilev Subscribers: pcanal, llvm-commits Differential Revision: https://reviews.llvm.org/D33529 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307849 91177308-0d34-0410-b5e6-96231b3b80d8
* Use std::mutex to avoid memory allocation after OOMReid Kleckner2017-07-121-13/+18
| | | | | | | | | | | | | | | ManagedStatic<sys::Mutex> would lazilly allocate a sys::Mutex to lock when reporting an OOM, which is a bad idea. The three STL implementations that I know of use pthread_mutex_lock and EnterCriticalSection to implement std::mutex. I'm pretty sure that neither of those allocate heap memory. It seems that we unconditionally use std::mutex without testing LLVM_ENABLE_THREADS elsewhere in the codebase, so this should be portable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307827 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Synchronize the ProcessorFeatures enum used by getHostCPUName with the ↵Craig Topper2017-07-121-41/+123
| | | | | | | | enum in libgcc and soon compiler-rt. This adds all the feature bits libgcc has. They will soon be added to compiler-rt as well. This adds a second 32 bit feature variable to hold the bits that are needed by getHostCPUName that are not in libgcc. libgcc had already used 31 of the 32 bits in the existing variable and we needed 3 bits so at minimum 2 bits would spill over. I chose to move all 3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307758 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Sync ProcessorTypes and ProcessorSubtypes enums used by getHostCPUName ↵Craig Topper2017-07-121-50/+35
| | | | | | | | with the version proposed to for compiler-rt's cpu_model.c This keeps the starting entries in the enums in sync with what's in gcc and in review D35214 for compiler-rt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307757 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Cleanup the switches in getHostCPUName to remove impossible combinations.Craig Topper2017-07-121-26/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307756 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove 'barcelona' string from getHostCPUName. Use 'amdfam10' instead. ↵Craig Topper2017-07-121-2/+0
| | | | | | The x86 backend doesn't distinguish. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307755 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix minor typo introduced in r276404Don Hinton2017-07-121-1/+1
| | | | | | | | | | | | | | | | | Summary: A space was added between '-' and 'help' when emitting help output. See https://reviews.llvm.org/D22621 for details. Reviewers: MaggieYi, vsk Reviewed By: vsk Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35283 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307745 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] - Add bad alloc error handler for handling allocation malfunctionsReid Kleckner2017-07-112-1/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Patch by Klaus Kretzschmar We would like to introduce a new type of llvm error handler for handling bad alloc fault situations. LLVM already provides a fatal error handler for serious non-recoverable error situations which by default writes some error information to stderr and calls exit(1) at the end (functions are marked as 'noreturn'). For long running processes (e.g. a server application), exiting the process is not an acceptable option, especially not when the system is in a temporary resource bottleneck with a good chance to recover from this fault situation. In such a situation you would rather throw an exception to stop the current compilation and try to overcome the resource bottleneck. The user should be aware of the problem of throwing an exception in bad alloc situations, e.g. you must not do any allocations in the unwind chain. This is especially true when adding exceptions in existing unfamiliar code (as already stated in the comment of the current fatal error handler) So the new handler can also be used to distinguish from general fatal error situations where recovering is no option. It should be used in cases where a clean unwind after the allocation is guaranteed. This patch contains: - A report_bad_alloc function which calls a user defined bad alloc error handler. If no user handler is registered the report_fatal_error function is called. This function is not marked as 'noreturn'. - A install/restore_bad_alloc_error_handler to install/restore the bad alloc handler. - An example (in Mutex.cpp) where the report_bad_alloc function is called in case of a malloc returns a nullptr. If this patch gets accepted we would create similar patches to fix corresponding malloc/calloc usages in the llvm code. Reviewers: chandlerc, greened, baldrick, rnk Reviewed By: rnk Subscribers: llvm-commits, MatzeB Differential Revision: https://reviews.llvm.org/D34753 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307673 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Fix typo in comment. NFCCraig Topper2017-07-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307522 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove asserts from getX86CpuIDAndInfo/getX86CpuIDAndInfoEx. Restore ↵Craig Topper2017-07-101-7/+10
| | | | | | | | | | past behavior of returning an unsupported indication to the caller instead. These asserts could only occur if we fail to properly detect the compiler, but an assert is not a good way to do that because it doesn't work in release builds. I wonder if we could use #error? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307520 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove check for AVX512 support from skylake-avx512 detection in ↵Craig Topper2017-07-091-6/+1
| | | | | | | | getHostCPUName. Users of getHostCPUName should also use getHostCPUFeatures which will take care of making sure avx512 is disabled if the CPU doesn't support it. This is consistent with what we do for other CPUs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307495 91177308-0d34-0410-b5e6-96231b3b80d8
* [Solaris] get rid of _RESTRICT_KYWD warning during the buildKamil Rytarowski2017-07-081-3/+0
| | | | | | | | | | | | | | | | | | | Summary: (re)definition of _RESTRICT_KYWD rightfully causes a warning message during the Solaris build. This hack is not needed if build compiler is properly configured (.e.g /usr/bin/gcc) so just remove it. Reviewers: ro, mgorny, krytarowski, joerg Reviewed By: joerg Subscribers: quenelle, llvm-commits Patch by Fedor Sergeev (Oracle). Differential Revision: https://reviews.llvm.org/D35054 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307469 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] In getHostCPUName, remove some code that changes some AMD CPU names ↵Craig Topper2017-07-081-15/+1
| | | | | | | | | | | | based on features not being enabled. The CPU name is really just used for scheduler and other microarchitectural optimizations. The feature flags should be determined by getHostCPUFeatures which should always be used with getHostCPUName. Trying to alter CPU name strings to control features just isn't practical. Most of these types of things were removed from Intel CPUs a while ago. This is part of my plan to bring compiler-rt's cpu_model.c file up to date with the equivalent functionality in libgcc. A lot of the code in that file is copied from Host.cpp and we want to keep them reasonably in sync. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307467 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Correct the BDVER4 model numbers to include 0x70-0x7f.Craig Topper2017-07-081-1/+1
| | | | | | According to wikipedia and some other googling suggests these should also be considered as BDVER4. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307466 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Minor formatting fix. NFCCraig Topper2017-07-081-4/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307465 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Use 'unsigned' instead of 'unsigned int' for consistency in the X86 ↵Craig Topper2017-07-081-7/+7
| | | | | | portion of Host.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307463 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Cleanup some CPUID usage in getAvailableFeatures.Craig Topper2017-07-081-5/+10
| | | | | | We should make sure leaf 1 is available before accessing it. Same with leaf 0x80000001. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307462 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the Windows version of updateTripleOSVersion to account forAlex Lorenz2017-07-071-2/+2
| | | | | | | changes in r307372 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307377 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] sys::getProcessTriple should return a macOS triple usingAlex Lorenz2017-07-073-7/+25
| | | | | | | | | | | | | | | | the system's version of macOS sys::getProcessTriple returns LLVM_HOST_TRIPLE, whose system version might not be the actual version of the system on which the compiler running. This commit ensures that, for macOS, sys::getProcessTriple returns a triple with the system's macOS version. rdar://33177551 Differential Revision: https://reviews.llvm.org/D34446 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307372 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ODR violations due to abuse of LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTORRichard Smith2017-06-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This is a short-term fix for PR33650 aimed to get the modules build bots green again. Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR macros to try to locally specialize a global template for a global type. That's not how C++ works. Instead, we now centrally define how to format vectors of fundamental types and of string (std::string and StringRef). We use flow formatting for the former cases, since that's the obvious right thing to do; in the latter case, it's less clear what the right choice is, but flow formatting is really bad for some cases (due to very long strings), so we pick block formatting. (Many of the cases that were using flow formatting for strings are improved by this change.) Other than the flow -> block formatting change for some vectors of strings, this should result in no functionality change. Differential Revision: https://reviews.llvm.org/D34907 Corresponding updates to clang, clang-tools-extra, and lld to follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306878 91177308-0d34-0410-b5e6-96231b3b80d8
* Unified logic for computing target ABI in backend and front end by moving ↵Eric Christopher2017-06-301-0/+36
| | | | | | | | | | this common code to Support/TargetParser. Modeled Triple::GNU after front end code (aapcs abi) and updated tests that expect apcs abi. Based heavily on a patch by Ana Pazos! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306768 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit "[Support] Add RetryAfterSignal helper function"Pavel Labath2017-06-293-25/+12
| | | | | | | | | | | | | | | | | | | | | | | | | The difference from the previous version is the use of decltype, as the implementation of std::result_of in libc++ did not work correctly for variadic function like open(2). Original summary: This function retries an operation if it was interrupted by a signal (failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in glibc, but I've turned that into a template function. I've also added a fail-value argument, to enable the function to be used with e.g. fopen(3), which is documented to fail for any reason that open(2) can fail (which includes EINTR). The main user of this function will be lldb, but there were also a couple of uses within llvm that I could simplify using this function. Reviewers: zturner, silvas, joerg Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D33895 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306671 91177308-0d34-0410-b5e6-96231b3b80d8
* [LLVM][X86][Goldmont] Adding new target-cpu: GoldmontMichael Zuckerman2017-06-291-1/+9
| | | | | | | | | | | | | | | | | [LLVM SIDE] Connecting the GoldMont processor to his feature. Reviewers: 1. igorb 2. zvi 3. delena 4. RKSimon 5. craig.topper Differential Revision: https://reviews.llvm.org/D34504 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306658 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for Ananas platformEd Schouten2017-06-251-0/+2
| | | | | | | | | | | | | | | | | | Ananas is a home-brew operating system, mainly for amd64 machines. After using GCC for quite some time, it has switched to clang and never looked back - yet, having to manually patch things is annoying, so it'd be much nicer if this was in the official tree. More information: https://github.com/zhmu/ananas/ https://rink.nu/projects/ananas.html Submitted by: Rink Springer Differential Revision: https://reviews.llvm.org/D32937 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306237 91177308-0d34-0410-b5e6-96231b3b80d8
* [APInt] Move the single word cases of countTrailingZeros and ↵Craig Topper2017-06-231-7/+2
| | | | | | countLeadingOnes inline for consistency with countTrailingOnes and countLeadingZeros. NFCI git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306153 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a misleading indentation warning.Peter Collingbourne2017-06-231-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306130 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the size specification for cache_size_bytes case insensitive.Peter Collingbourne2017-06-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306129 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a ThinLTO cache policy for controlling the maximum cache size in bytes.Peter Collingbourne2017-06-231-15/+46
| | | | | | | | | | | | | | This is useful when an upper limit on the cache size needs to be controlled independently of the amount of the amount of free space. One use case is a machine with a large number of cache directories (e.g. a buildbot slave hosting a large number of independent build jobs). By imposing an upper size limit on each cache directory, users can more easily estimate the server's capacity. Differential Revision: https://reviews.llvm.org/D34547 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306126 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a BinarySubstreamRef, and a method to read one.Zachary Turner2017-06-231-0/+6
| | | | | | | | | This is essentially just a BinaryStreamRef packaged with an offset and the logic for reading one is no different than the logic for reading a BinaryStreamRef, except that we save the current offset. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306122 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Add llvm::to_floatPavel Labath2017-06-232-19/+11
| | | | | | | | | | | | | | | | | | Summary: The function matches the interface of llvm::to_integer, but as we are calling out to a C library function, I let it take a Twine argument, so we can avoid a string copy at least in some cases. I add a test and replace a couple of existing uses of strtod with this function. Reviewers: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D34518 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306096 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Support] Add RetryAfterSignal helper function" and subsequent fixPavel Labath2017-06-223-12/+25
| | | | | | | | | | | The fix in r306003 uncovered a pretty fundamental problem that libc++ implementation of std::result_of does not handle the prototype of open(2) correctly (presumably because it contains ...). This makes the whole function unusable in its current form, so I am also reverting the original commit (r305892), which introduced the function, at least until I figure out a way to solve the libc++ issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306005 91177308-0d34-0410-b5e6-96231b3b80d8
* [ProfileData, Support] Fix some Clang-tidy modernize-use-using and Include ↵Eugene Zelenko2017-06-213-37/+71
| | | | | | What You Use warnings; other minor fixes (NFC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305969 91177308-0d34-0410-b5e6-96231b3b80d8
* [DWARF] Support for DW_FORM_strx3 and complete support for DW_FORM_strx{1,2,4}Wolfgang Pieb2017-06-211-0/+7
| | | | | | | | | | | (consumer). Reviewer: aprantl Differential Revision: https://reviews.llvm.org/D34418 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305944 91177308-0d34-0410-b5e6-96231b3b80d8
* [Support] Add RetryAfterSignal helper functionPavel Labath2017-06-213-25/+12
| | | | | | | | | | | | | | | | | | | | | Summary: This function retries an operation if it was interrupted by a signal (failed with EINTR). It's inspired by the TEMP_FAILURE_RETRY macro in glibc, but I've turned that into a template function. I've also added a fail-value argument, to enable the function to be used with e.g. fopen(3), which is documented to fail for any reason that open(2) can fail (which includes EINTR). The main user of this function will be lldb, but there were also a couple of uses within llvm that I could simplify using this function. Reviewers: zturner, silvas, joerg Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D33895 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305892 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: chunk writing on LinuxSaleem Abdulrasool2017-06-202-1/+16
| | | | | | | | This is a workaround for large file writes. It has been witnessed that write(2) failing with EINVAL (22) due to a large value (>2G). Thanks to James Knight for the help with coming up with a sane test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305846 91177308-0d34-0410-b5e6-96231b3b80d8
* [APFloat] Move the integerPartWidth constant into APFloatBase. Remove ↵Craig Topper2017-06-181-37/+30
| | | | | | integerPart typedef at file scope and just use the one in APFloatBase everywhere. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305652 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement AllocateRWX and ReleaseRWX for NetBSDKamil Rytarowski2017-06-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with PaX MPROTECT disallowing RWX mappings. There is a solution to bypass this restriction with double mapping RX (code) and RW (data) using mremap(2) MAP_REMAPDUP. The initial mapping must be mmap(2)ed with protection: PROT_MPROTECT(PROT_EXEC). This functionality to bypass PaX MPROTECT appeared in NetBSD-7.99.72. This patch fixes 20 failing tests: - LLVM :: DebugInfo/debuglineinfo-macho.test - LLVM :: DebugInfo/debuglineinfo.test - LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_Mips64r2N64_PIC_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_N32_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_N64R6_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_O32R6_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/Mips/ELF_O32_PIC_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/COFF_i386.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/COFF_x86_64.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF-relaxed.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_STT_FILE.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PC8_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x64-64_PIC_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_PIC-small-relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86-64_debug_frame.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/ELF_x86_64_StubBuf.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_empty_ehframe.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_i386_eh_frame.s - LLVM :: ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s Sponsored by <The NetBSD Foundation> Reviewers: joerg, lhames Reviewed By: joerg Subscribers: sdardis, llvm-commits, arichardson Differential Revision: https://reviews.llvm.org/D33874 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305650 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Introduce LLVM_TARGET_TRIPLE_ENV as an option to override ↵NAKAMURA Takumi2017-06-172-1/+15
| | | | | | | | | | | | | | | | | | | LLVM_DEFAULT_TARGET_TRIPLE at runtime. No behavior is changed if LLVM_TARGET_TRIPLE_ENV is blank or undefined. If LLVM_TARGET_TRIPLE_ENV is "TEST_TARGET_TRIPLE" and $TEST_TARGET_TRIPLE is not blank, llvm::sys::getDefaultTargetTriple() returns $TEST_TARGET_TRIPLE. Lit resets config.target_triple and config.environment[LLVM_TARGET_TRIPLE_ENV] to change the default target. Without changing LLVM_DEFAULT_TARGET_TRIPLE nor rebuilding, lit can be run; TEST_TARGET_TRIPLE=i686-pc-win32 bin/llvm-lit -sv path/to/test/ TEST_TARGET_TRIPLE=i686-pc-win32 ninja check-clang-tools Differential Revision: https://reviews.llvm.org/D33662 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305632 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix buildbots.Rui Ueyama2017-06-161-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305542 91177308-0d34-0410-b5e6-96231b3b80d8