summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
Commit message (Collapse)AuthorAgeFilesLines
...
* Make backtraces work again with both the configure and cmake build.Benjamin Kramer2012-09-281-1/+1
| | | | llvm-svn: 164817
* The assumption that /proc/self/exe always exists is incorrect.Sylvestre Ledru2012-09-261-4/+13
| | | | | | | | | | | For example, under a Linux chroot, /proc/ might not be mounted. Therefor, we test if this file exist. If it is the case, use it (the current behavior). Otherwise, we fall back to the detection used by *BSD. The issue has been reported initially on the Debian bug tracker: http://bugs.debian.org/674588 llvm-svn: 164676
* Add an --enable-backtraces option to configure to determineEric Christopher2012-09-211-1/+1
| | | | | | | | | whether or not we want to print out backtrace information. Useful for libraries that don't need backtrace information on a crash. rdar://11844710 llvm-svn: 164426
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-191-12/+186
| | | | | | implement section-specific protection handling in MCJIT. llvm-svn: 164249
* Add support for finding cacheflush on OpenBSD/mips64 platforms.Chandler Carruth2012-09-111-0/+8
| | | | | | Patch by Brad Smith! llvm-svn: 163584
* Whitespace.NAKAMURA Takumi2012-09-061-2/+2
| | | | llvm-svn: 163289
* Unix/Signals.inc: Fix a typo. Thanks to Dani Berg!NAKAMURA Takumi2012-09-061-1/+1
| | | | llvm-svn: 163288
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-151-1/+1
| | | | llvm-svn: 161978
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-151-0/+112
| | | | llvm-svn: 161976
* stdcxx's cstdio doesn't include stdio.h, but the code using PathV2.incJoerg Sonnenberger2012-08-101-0/+6
| | | | | | includes both. Deal with feof and ferror potentially being macros. llvm-svn: 161658
* Add support for the OpenBSD for Bitrig.Eric Christopher2012-08-062-5/+6
| | | | | | Patch by David Hill. llvm-svn: 161344
* Process: Add sys::Process::FileDescriptorHasColors().Daniel Dunbar2012-07-201-6/+8
| | | | llvm-svn: 160557
* Fixed few warnings.Galina Kistanova2012-07-121-1/+2
| | | | llvm-svn: 160142
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-201-7/+71
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. llvm-svn: 158770
* Don't call 'FilesToRemove[0]' when the vector is empty, even to computeChandler Carruth2012-06-161-1/+1
| | | | | | | the address of it. Found by a checking STL implementation used on a dragonegg builder. Sorry about this one. =/ llvm-svn: 158582
* Harden the Unix signals code to be more async signal safe.Chandler Carruth2012-06-161-9/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is likely only the tip of the ice berg, but this particular bug caused any double-free on a glibc system to turn into a deadlock! It is not generally safe to either allocate or release heap memory from within the signal handler. The 'pop_back()' in RemoveFilesToRemove was deleting memory and causing the deadlock. What's worse, eraseFromDisk in PathV1 has lots of allocation and deallocation paths. We even passed 'true' in a place that would have caused the *signal handler* to try to run the 'system' system call and shell out to 'rm -rf'. That was never going to work... This patch switches the file removal to use a vector of strings so that the exact text needed for the 'unlink' system call can be stored there. It switches the loop to be a boring indexed loop, and directly calls unlink without looking at the error. It also works quite hard to ensure that calling 'c_str()' is safe, by ensuring that the non-signal-handling code path that manipulates the vector always leaves it in a state where every element has already had 'c_str()' called at least once. I dunno exactly how overkill this is, but it fixes the deadlock-on-double free issue, and seems likely to prevent any other issues from sneaking up. Sorry for not having a test case, but I *really* don't know how to test signal handling code easily.... llvm-svn: 158580
* Use access(2) instead of stat(2) to check if a file exists.Benjamin Kramer2012-06-021-2/+1
| | | | | | | | | | | Apart from being slightly cheaper, this fixes a real bug that hits 32 bit linux systems. When passing a file larger than 2G to be linked (which isn't that uncommon with large projects such as WebKit), clang's driver checks if the file exists but the file size doesn't fit in an off_t and stat(2) fails with EOVERFLOW. Clang then says that the file doesn't exist instead of passing it to the linker. llvm-svn: 157891
* Allow unique_file to take a mode for file permissions, but defaultEric Christopher2012-05-111-3/+4
| | | | | | | | to user only read/write. Part of rdar://11325849 llvm-svn: 156591
* [Support] Fix sys::GetRandomNumber() to always use a high quality seed.Daniel Dunbar2012-05-081-5/+15
| | | | llvm-svn: 156414
* Unix/Process.inc: Give more useful random seed to srand. Workaround for PR12743.NAKAMURA Takumi2012-05-061-1/+14
| | | | llvm-svn: 156252
* Support/Process: Move llvm::sys::Process::GetRandomNumber() from Process.cpp ↵NAKAMURA Takumi2012-05-061-0/+9
| | | | | | | to Unix/Process.inc. FIXME: GetRandomNumber() is not implemented in Win32. llvm-svn: 156251
* [Support] Fix up comments.Daniel Dunbar2012-05-051-5/+3
| | | | llvm-svn: 156239
* [Support] Rewrite sys::fs::unique_file to not be stupid with /dev/urandom.Daniel Dunbar2012-05-051-19/+5
| | | | | | | | - Just use sys::Process::GetRandomNumber instead of having two poor implementations. - This is ~70 times (!) faster on my OS X machine. llvm-svn: 156238
* [Support/Unix] Unconditionally include time.h.Michael J. Spencer2012-04-231-8/+2
| | | | | | | | | | | | When building LLVM on Linux with libc++ with CMake TIME_WITH_SYS_TIME is undefined, and HAVE_SYS_TIME_H is defined. This ends up including sys/time.h but not time.h. Unix/TimeValue.inc requires time.h for asctime_r and localtime. libstdc++ seems to include time.h anyway, but libc++ does not. Fix this by always including time.h llvm-svn: 155382
* Conflict with st_dev/st_ino identifiers under Debian GNU/HurdSylvestre Ledru2012-04-231-4/+4
| | | | | | | | | | | | | The problem is that the struct file_status on UNIX systems has two members called st_dev and st_ino; those are also members of the struct stat, and they are reserved identifiers which can also be provided as #define (and this is the case for st_dev on Hurd). The solution (attached) is to rename them, for example adding a "fs_" prefix (= file status) to them. Patch by Pino Toscano llvm-svn: 155354
* Reapply 'Add reverseColor to raw_ostream'.Benjamin Kramer2012-04-161-0/+4
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell, with a minor fix for mingw by me. llvm-svn: 154805
* Revert r154800 which breaks windows builders.Argyrios Kyrtzidis2012-04-161-4/+0
| | | | llvm-svn: 154802
* Add reverseColor to raw_ostream.Argyrios Kyrtzidis2012-04-161-0/+4
| | | | | | | To be used in printing unprintable source in clang diagnostics. Patch by Seth Cantrell! llvm-svn: 154800
* Fix the build under Debian GNU/Hurd.Sylvestre Ledru2012-04-113-2/+17
| | | | | | Thanks to Pino Toscano for the patch llvm-svn: 154500
* Fix GetMainExecutable on kFreeBSD.Anton Korobeynikov2012-03-261-3/+3
| | | | | | Patch by Sylvestre Ledru! llvm-svn: 153435
* Fix null to integer conversion warnings.Jean-Daniel Dupas2012-03-241-2/+2
| | | | llvm-svn: 153395
* Change default error_code ctor to a 'named ctor' so it's more self-documenting.David Blaikie2012-02-091-17/+17
| | | | | | | | | | | Unify default construction of error_code uses on this idiom so that users don't feel compelled to make static globals for naming convenience. (unfortunately I couldn't make the original ctor private as some APIs don't return their result, instead using an out parameter (that makes sense to default construct) - which is a bit of a pity. I did, however, find/fix some cases of unnecessary default construction of error_code before I hit the unfixable cases) llvm-svn: 150197
* Remove SetWorkingDirectory from the Process interface. Nothing in LLVMChandler Carruth2012-01-151-4/+0
| | | | | | | | | | | | or Clang is using this, and it would be hard to use it correctly given the thread hostility of the function. Also, it never checked the return which is rather dangerous with chdir. If someone was in fact using this, please let me know, as well as what the usecase actually is so that I can add it back and make it more correct and secure to use. (That said, it's never going to be "safe" per-se, but we could at least document the risks...) llvm-svn: 148211
* Disable the crash reporter when running lit tests.Argyrios Kyrtzidis2012-01-111-0/+20
| | | | llvm-svn: 147965
* revert r147542 after comments from Joerg SonnenbergerSebastian Pop2012-01-051-12/+6
| | | | llvm-svn: 147608
* use getHostTriple instead of getDefaultTargetTriple in getClosestTargetForJITSebastian Pop2012-01-041-6/+12
| | | | | | | | | | Get back getHostTriple. For JIT compilation, use the host triple instead of the default target: this fixes some JIT testcases that used to fail when the compiler has been configured as a cross compiler. llvm-svn: 147542
* Support/Program: Make Change<stream>ToBinary return error_code.Michael J. Spencer2011-12-131-6/+6
| | | | llvm-svn: 146522
* Revert r146363 to allow buildbots to make forward progress.Chad Rosier2011-12-121-7/+0
| | | | | | | Original commit message: Support/FileSystem: Implement canonicalize. llvm-svn: 146378
* Support/FileSystem: Implement bool equivalent(file_status A, file_status B);Michael J. Spencer2011-12-121-21/+13
| | | | llvm-svn: 146364
* Support/FileSystem: Implement canonicalize.Michael J. Spencer2011-12-121-0/+7
| | | | llvm-svn: 146363
* Support/FileSystem: Implement recursive_directory_iterator and makeMichael J. Spencer2011-12-081-3/+4
| | | | | | directory_iterator preserve InputIterator semantics on copy. llvm-svn: 146200
* rename getHostTriple into getDefaultTargetTripleSebastian Pop2011-11-011-5/+5
| | | | llvm-svn: 143502
* rename LLVM_HOSTTRIPLE into LLVM_DEFAULT_TARGET_TRIPLESebastian Pop2011-11-011-4/+1
| | | | llvm-svn: 143501
* Remove a couple unused methods. PR11201.Eli Friedman2011-11-011-5/+0
| | | | llvm-svn: 143452
* sys::Process: Add a SetWorkingDirectory method.Daniel Dunbar2011-09-231-0/+4
| | | | llvm-svn: 140433
* Remove the hack to check UNAME_RELEASE when identifying the Darwin version.Bob Wilson2011-09-201-9/+0
| | | | | | | | | This was only needed to locate llvm-gcc's installation directory when clang falls back to run llvm-gcc for i386 kexts. As of clang svn r140187, we're now just searching paths with several different Darwin versions on either side of the current version, so this is no longer needed. llvm-svn: 140188
* Include limits.h to make sure PATH_MAX is known on Solaris 10.Bill Wendling2011-09-141-0/+3
| | | | | | Patch by Joakim Johansson! llvm-svn: 139743
* Clarify a comment.Bob Wilson2011-08-101-1/+3
| | | | llvm-svn: 137204
* Put Darwin-specific code inside an __APPLE__ ifdef.Bob Wilson2011-08-091-0/+2
| | | | llvm-svn: 137137
* Recognize the UNAME_RELEASE environment variable to match Darwin's uname.Bob Wilson2011-08-091-0/+6
| | | | | | | | When this variable is set, "uname -r" will return its value instead of the real OS version. Make this affect LLVM's triple for consistency. <rdar://problem/9919167> llvm-svn: 137111
OpenPOWER on IntegriCloud