summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
Commit message (Collapse)AuthorAgeFilesLines
...
* HAVE_UNWIND_BACKTRACE -> HAVE__UNWIND_BACKTRACEJoerg Sonnenberger2016-09-291-4/+4
| | | | | | Check for existance and not truth value. llvm-svn: 282767
* Add an c++ itanium demangler to llvm.Rafael Espindola2016-09-061-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a copy of the demangler in libcxxabi. The code also has no dependencies on anything else in LLVM. To enforce that I added it as another library. That way a BUILD_SHARED_LIBS will fail if anyone adds an use of StringRef for example. The no llvm dependency combined with the fact that this has to build on linux, OS X and Windows required a few changes to the code. In particular: No constexpr. No alignas On OS X at least this library has only one global symbol: __ZN4llvm16itanium_demangleEPKcPcPmPi My current plan is: Commit something like this Change lld to use it Change lldb to use it as the fallback Add a few #ifdefs so that exactly the same file can be used in libcxxabi to export abi::__cxa_demangle. Once the fast demangler in lldb can handle any names this implementation can be replaced with it and we will have the one true demangler. llvm-svn: 280732
* Implement getRandomBytes() functionEugene Leviant2016-08-261-0/+4
| | | | | | | | | This function allows getting arbitrary sized block of random bytes. Primary motivation is support for --build-id=uuid in lld. Differential revision: https://reviews.llvm.org/D23671 llvm-svn: 279807
* Preserve a pointer to the newly allocated signal stack as well. That tooChandler Carruth2016-08-241-4/+6
| | | | | | is flagged by LSan at least among leak detectors. llvm-svn: 279605
* Increase the size of the sigaltstack used by LLVM signal handlers. 8KB is notRichard Smith2016-08-241-1/+1
| | | | | | | | sufficient in some cases; increase to 64KB, which should be enough for anyone :) Patch by github.com/bryant! llvm-svn: 279599
* Use the range variant of find/find_if instead of unpacking begin/endDavid Majnemer2016-08-121-1/+1
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278469
* Add AIX support to Path.inc, Host.h, and CMake.Chandler Carruth2016-07-191-2/+3
| | | | | | | | Patch by Andrew Paprocki! Differential Revision: https://reviews.llvm.org/D18359 llvm-svn: 276045
* Use posix_fallocate instead of ftruncate.Rafael Espindola2016-07-191-0/+9
| | | | | | | | | | | This makes sure that space is actually available. With this change running lld on a full file system causes it to exit with failed to open foo: No space left on device instead of crashing with a sigbus. llvm-svn: 276017
* In openFileForRead, attempt to fetch the actual name of the file on disk -- ↵Taewook Oh2016-06-131-1/+86
| | | | | | | | | | | | | including case -- so that clang can later warn about non-portable #include and #import directives. Differential Revision: http://reviews.llvm.org/D19842 Corresponding clang patch: http://reviews.llvm.org/D19843 Re-commit after addressing issues with of generating too many warnings for Windows and asan test failures Patch by Eric Niebler llvm-svn: 272555
* Search for llvm-symbolizer binary in the same directory as argv[0], beforeRichard Smith2016-06-091-2/+7
| | | | | | | 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
* Revert commit r271704, a patch that enables warnings for non-portable ↵Taewook Oh2016-06-041-86/+1
| | | | | | #include and #import paths (Corresponding clang patch has been reverted by r271761). Patches are reverted because they generate lots of unadressable warnings for windows and fail tests under ASAN. llvm-svn: 271764
* In openFileForRead, attempt to fetch the actual name of the file on disk -- ↵Taewook Oh2016-06-031-1/+86
| | | | | | | | | | including case -- so that clang can later warn about non-portable #include and #import directives. Differential Revision: http://reviews.llvm.org/D19842 Patch by Eric Niebler llvm-svn: 271704
* [Support] Reapply cleanup r270643Gerolf Hoflehner2016-05-251-39/+0
| | | | llvm-svn: 270674
* [Support] revert previous commit r270643Gerolf Hoflehner2016-05-251-0/+39
| | | | llvm-svn: 270670
* [Support] Cleanup of an ancient Darwin work-around in Signals.inc (PR26174)Gerolf Hoflehner2016-05-251-39/+0
| | | | | | Patch by Jeremy Huddleston Sequoia llvm-svn: 270643
* Enable use of sigaltstack for signal handlers when available. With this,Richard Smith2016-05-231-1/+1
| | | | | | | backtraces from the signal handler on stack overflow now work reliably (on my system at least...). llvm-svn: 270395
* Fix implicit type conversion. NFC.Chris Bieneman2016-05-211-1/+1
| | | | llvm-svn: 270299
* Switch from the linux-specific 'struct sigaltstack' to POSIX's 'stack_t'. ThisRichard Smith2016-05-201-2/+2
| | | | | | is what I get for trusting my system's man pages I suppose. llvm-svn: 270280
* Add a configure-time check for the existence of sigaltstack. It seems that someRichard Smith2016-05-201-2/+4
| | | | | | systems provide a <signal.h> that doesn't declare it. llvm-svn: 270278
* Reinstate r269992 (reverting r270267), but restricted to cases where glibc isRichard Smith2016-05-201-4/+59
| | | | | | | | | the C standard library implementation in use. This works around a glibc bug in the backtrace() function where it fails to produce a backtrace on x86_64 if libgcc / libunwind is statically linked. llvm-svn: 270276
* Create a sigaltstack when we register our signal handlers. Otherwise we'd veryRichard Smith2016-05-201-0/+31
| | | | | | likely fail to produce a backtrace if we crash due to stack overflow. llvm-svn: 270273
* Revert "Work around a glibc bug: backtrace() spuriously fails if..."Chris Bieneman2016-05-201-51/+4
| | | | | | | | | This commit has been breaking the FreeBSD bots: http://lab.llvm.org:8011/builders/lld-x86_64-freebsd This reverts commit r269992. llvm-svn: 270267
* Work around a glibc bug: backtrace() spuriously fails ifRichard Smith2016-05-181-4/+51
| | | | | | | | | | | | - glibc is dynamically linked, and - libgcc_s is unavailable (for instance, another library is being used to provide the compiler runtime or libgcc is statically linked), and - the target is x86_64. If we run backtrace() and it fails to find any stack frames, try using _Unwind_Backtrace instead if available. llvm-svn: 269992
* Revert "Revert "Revert 220932.": "Removing the static initializer in ↵Mehdi Amini2016-05-141-5/+0
| | | | | | | | | | ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex"" This reverts commit r269577. Broke NetBSD, waiting for Kamil to investigate From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 269584
* Revert "Revert 220932.": "Removing the static initializer in ↵Mehdi Amini2016-05-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | ManagedStatic.cpp by using llvm_call_once to initialize the ManagedStatic mutex" This reverts commit r221331 and reinstate r220932 as discussed in D19271. Original commit message was: This patch adds an llvm_call_once which is a wrapper around std::call_once on platforms where it is available and devoid of bugs. The patch also migrates the ManagedStatic mutex to be allocated using llvm_call_once. These changes are philosophically equivalent to the changes added in r219638, which were reverted due to a hang on Win32 which was the result of a bug in the Windows implementation of std::call_once. Differential Revision: http://reviews.llvm.org/D5922 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 269577
* [Support] Creation of minidump after compiler crash on WindowsLeny Kholodov2016-05-041-0/+2
| | | | | | | | | | | In the current implementation compiler only prints stack trace to console after crash. This patch adds saving of minidump files which contain a useful subset of the information for further debugging. Differential Revision: http://reviews.llvm.org/D18216 llvm-svn: 268519
* Fix missing include on OpenBSDMehdi Amini2016-04-081-0/+1
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265803
* Revert "Fix Clang-tidy modernize-deprecated-headers warnings in remaining ↵Duncan P. N. Exon Smith2016-04-056-115/+64
| | | | | | | | | | files; other minor fixes." This reverts commit r265454 since it broke the build. E.g.: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/22413/ llvm-svn: 265459
* Fix Clang-tidy modernize-deprecated-headers warnings in remaining files; ↵Eugene Zelenko2016-04-056-64/+115
| | | | | | | | | | | | other minor fixes. Some Include What You Use suggestions were used too. Use anonymous namespaces in source files. Differential revision: http://reviews.llvm.org/D18778 llvm-svn: 265454
* Add disk_space() to llvm::fsMehdi Amini2016-04-011-1/+31
| | | | | | | | | | Summary: Adapted from Boost::filesystem. (This is a reapply by reverting commit r265080 and fixing the WinAPI part) Differential Revision: http://reviews.llvm.org/D18467 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265082
* Revert "Add disk_space() to llvm::fs"Mehdi Amini2016-04-011-31/+1
| | | | | | | | This reverts commit r265074 and r265068. Breaks windows build From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265080
* Use const ref instead of value for Twine in the disk_space() APIMehdi Amini2016-03-311-1/+1
| | | | | | | Thanks Rui for noticing! From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265074
* Add disk_space() to llvm::fsMehdi Amini2016-03-311-1/+31
| | | | | | | | | | Summary: Adapted from Boost::filesystem. (This is a reapply by reverting commit r265062 and fixing the WinAPI part) Differential Revision: http://reviews.llvm.org/D18467 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265068
* Revert "Add disk_space() to llvm::fs"Mehdi Amini2016-03-311-31/+1
| | | | | | | | | Breaks windows bot. This reverts commit r265050. This reverts commit r265055. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265062
* Add disk_space() to llvm::fsMehdi Amini2016-03-311-1/+31
| | | | | | | | | | | | | Summary: Adapted from Boost::filesystem. Reviewers: bruno, silvas Subscribers: tberghammer, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D18467 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265050
* Add lastAccessedTime to file_statusMehdi Amini2016-03-251-2/+9
| | | | | | | | | Differential Revision: http://reviews.llvm.org/D18456 This is a re-commit of r264387 and r264388 after fixing a typo. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264392
* Revert "Add lastAccessedTime to file_status"Mehdi Amini2016-03-251-9/+2
| | | | | | | | This reverts commit r264387. Bots are broken in various ways, I need to take one commit at a time... From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264390
* Add lastAccessedTime to file_statusMehdi Amini2016-03-251-2/+9
| | | | | | | | | | | Reviewers: silvas Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18456 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 264387
* Fix typo: XDS -> XDGSean Silva2016-03-241-3/+3
| | | | | | Patch by Robert Ma <bob1211@gmail.com>! llvm-svn: 264352
* Remove uses of builtin comma operator.Richard Trieu2016-02-181-1/+1
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261270
* Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; ↵Eugene Zelenko2016-01-261-2/+2
| | | | | | | | other minor fixes. Differential revision: reviews.llvm.org/D16568 llvm-svn: 258831
* [Clang/Support/Windows/Unix] Command lines created by clang may exceed the ↵Oleg Ranevskyy2016-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | command length limit set by the OS Summary: Hi Rafael, Would you be able to review this patch, please? (Clang part of the patch is D15832). When clang runs an external tool, e.g. a linker, it may create a command line that exceeds the length limit. Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS limitation. There are two problems in this function that may cause exceeding of the limit: 1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program path to the command line when it runs the program. 2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails. Reviewers: rafael, ygao, probinson Subscribers: asl, llvm-commits Differential Revision: http://reviews.llvm.org/D15831 llvm-svn: 256866
* [SectionMemoryManager] Make better use of virtual memoryKeno Fischer2015-12-161-2/+3
| | | | | | | | | | | | | | | | | Summary: On Windows, the allocation granularity can be significantly larger than a page (64K), so with many small objects, just clearing the FreeMem list rapidly leaks quite a bit of virtual memory space (if not rss). Fix that by only removing those parts of the FreeMem blocks that overlap pages for which we are applying memory permissions, rather than dropping the FreeMem blocks entirely. Reviewers: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15202 llvm-svn: 255760
* Avoid buffered reads of /dev/urandomRafael Espindola2015-12-111-4/+9
| | | | | | | | | | | | | | I am seeing disappointing clang performance on a large PowerPC64 Linux box. GetRandomNumberSeed() does a buffered read from /dev/urandom to seed its PRNG. As a result we read an entire page even though we only need 4 bytes. With every clang task reading a page worth of /dev/urandom we end up spending a large amount of time stuck on kernel spinlock. Patch by Anton Blanchard! llvm-svn: 255386
* Use array_lengthof instead of manually calculating it. NFCCraig Topper2015-12-011-3/+2
| | | | llvm-svn: 254380
* [JIT/Memory] Fix up semantic of setExecutable().Davide Italiano2015-11-171-4/+1
| | | | | | | | | | setExecutable() should do everything that's needed to make the memory executable on host, i.e. unconditionally set permissions + invalidate instruction cache. llvm-rtdyld will be updated in my next commit. Discusseed with: Lang Hames (as part of D13631). llvm-svn: 253341
* Combine ifdefs around dl_iterate_phdr in Unix/Signals.incReid Kleckner2015-11-091-13/+8
| | | | | | | This avoids the need to have two dummy implementations of findModulesAndOffsets. llvm-svn: 252531
* Appease hosts without HAVE_BACKTRACE nor ENABLE_BACKTRACES.NAKAMURA Takumi2015-11-081-0/+7
| | | | | | | llvm/lib/Support/Signals.cpp:66:13: warning: unused function 'printSymbolizedStackTrace' [-Wunused-function] llvm/lib/Support/Signals.cpp:52:13: warning: function 'findModulesAndOffsets' has internal linkage but is not defined [-Wundefined-internal] llvm-svn: 252418
* Fix OSX build after r252118 (missing parameter for findModulesAndOffsets())Mehdi Amini2015-11-051-1/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 252137
* Remove empty linesMehdi Amini2015-11-051-2/+2
| | | | | From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 252136
OpenPOWER on IntegriCloud