summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/ubsan/ubsan_flags.cc
Commit message (Collapse)AuthorAgeFilesLines
* compiler-rt: Rename .cc files in lib/ubsan to .cpp.Nico Weber2019-07-311-85/+0
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452
* Improve error message when '=' is missing in {ASAN,...}_OPTIONS.Vitaly Buka2019-06-151-1/+1
| | | | | | | | | | | | | | | | | | Summary: It's handling isses as described here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89832 Patch by Martin Liška. Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: cryptoad, kubamracek Differential Revision: https://reviews.llvm.org/D59876 llvm-svn: 363480
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [ubsan] Add preinit initializer for ubsanFrancis Ricci2018-01-231-2/+11
| | | | | | | | | | | | | | | | | | | | Summary: Now that ubsan does function interception (for signals), we need to ensure that ubsan is initialized before any library constructors are called. Otherwise, if a constructor calls sigaction, ubsan will intercept in an unitialized state, which will cause a crash. This patch is a partial revert of r317757, which removed preinit arrays for ubsan. Reviewers: vitalybuka, eugenis, pcc Subscribers: kubamracek, mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42389 llvm-svn: 323249
* ubsan: Allow programs to use setenv to configure ubsan_standalone.Peter Collingbourne2017-11-091-2/+4
| | | | | | | | | | | | | | | | | | | | | | Previously ubsan_standalone used the GetEnv function to read the environment variables UBSAN_OPTIONS and UBSAN_SYMBOLIZER_PATH. The problem with GetEnv is that it does not respect changes to the environment variables made using the libc setenv function, which prevents clients from setting environment variables to configure ubsan before loading ubsan-instrumented libraries. The reason why we have GetEnv is that some runtimes need to read environment variables while they initialize using .preinit_array, and getenv does not work while .preinit_array functions are being called. However, it is unnecessary for ubsan_standalone to initialize that early. So this change switches ubsan_standalone to using getenv and removes the .preinit_array entry. The static version of the runtime still ends up being initialized using a C++ constructor that exists to support the shared runtime. Differential Revision: https://reviews.llvm.org/D39827 llvm-svn: 317757
* Let ubsan search UBSAN_SYMBOLIZER_PATH for llvm-symbolizerNico Weber2017-04-191-0/+1
| | | | | | https://reviews.llvm.org/D27375 llvm-svn: 300692
* General definition for weak functionsMarcos Pividori2017-01-291-15/+3
| | | | | | | | | | | | | | | | | | In this diff, I define a general macro for defining weak functions with a default implementation: "SANITIZER_INTERFACE_WEAK_DEF()". This way, we simplify the implementation for different platforms. For example, we cannot define weak functions on Windows, but we can use linker pragmas to create an alias to a default implementation. All of these implementation details are hidden in the new macro. Also, as I modify the name for exported weak symbols on Windows, I needed to temporarily disable "dll_host" test for asan, which checks the list of functions included in asan_win_dll_thunk. Differential Revision: https://reviews.llvm.org/D28596 llvm-svn: 293419
* [sanitizer] [asan] Use macros to simplify weak aliases on Windows.Marcos Pividori2017-01-201-5/+3
| | | | | | | | | This patch adds some useful macros for dealing with pragma directives on Windows. Also, I add appropriate documentation for future users. Differential Revision: https://reviews.llvm.org/D28525 llvm-svn: 292650
* [sancov] common flags initialization.Mike Aizatsky2016-03-181-1/+1
| | | | | | | | | | | | Summary: Introducing InitializeCommonFlags accross all sanitizers to simplify common flags management. Setting coverage=1 when html_cov_report is requested. Differential Revision: http://reviews.llvm.org/D18273 llvm-svn: 263820
* [UBSan] Enable 'help' option output, report unrecognized flagsAlexey Samsonov2015-08-131-0/+3
| | | | | | | | | | | | Summary: Let UBSan output flag description if 'help' options is provided. Report unrecognized flags if verbosity mode is turned on. Patch by Svetlana Ryabkova! Differential Revision: http://reviews.llvm.org/D11903 llvm-svn: 244946
* Re-apply r241217 with build fixes:Peter Collingbourne2015-07-021-2/+13
| | | | | | | - Disable building of the interceptor library on 64-bit Windows. - Mangle names in /alternatename directive for 32-bit Windows. llvm-svn: 241224
* Revert r241217, it breaks the build on Windows.Nico Weber2015-07-021-9/+2
| | | | llvm-svn: 241219
* ubsan: Port runtime library to (32- and 64-bit) Windows.Peter Collingbourne2015-07-021-2/+9
| | | | | | Differential Revision: http://reviews.llvm.org/D10856 llvm-svn: 241217
* [UBSan] Embed UBSan into ASan runtime (compiler-rt part).Alexey Samsonov2015-04-011-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the way we use ASan and UBSan together. Instead of keeping two separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on a platform, all UBSan sources are just compiled into dummy empty object files. UBSan initialization code (e.g. flag parsing) is directly called from ASan initialization, so we are able to enforce correct initialization order. This mirrors the approach we already use for ASan+LSan. This change doesn't modify the way we use standalone UBSan. Test Plan: regression test suite Reviewers: kubabrecka, zaks.anna, rsmith, kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D8646 llvm-svn: 233861
* [UBSan] Explicitly list all supported OS/arch pairs supported by UBSan.Alexey Samsonov2015-03-261-0/+4
| | | | llvm-svn: 233295
* [asan] Allow changing verbosity in activation flags.Evgeniy Stepanov2015-01-201-0/+1
| | | | | | | This change removes some debug output in asan_flags.cc that was reading the verbosity level before all the flags were parsed. llvm-svn: 226566
* [sanitizer] Flag parser rewrite.Evgeniy Stepanov2015-01-151-18/+29
| | | | | | | The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. llvm-svn: 226169
* [Sanitizer] Change the runtime flag representation.Alexey Samsonov2015-01-071-12/+14
| | | | | | | | | | | This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. llvm-svn: 225327
* Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after ↵Alexey Samsonov2015-01-021-2/+4
| | | | | | | | | | | | | | | | initialization."" Fix test failures by introducing CommonFlags::CopyFrom() to make sure compiler doesn't insert memcpy() calls into runtime code. Original commit message: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. llvm-svn: 225088
* Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."Chandler Carruth2015-01-021-3/+2
| | | | | | | | | | We've got some internal users that either aren't compatible with this or have found a bug with it. Either way, this is an isolated cleanup and so I'm reverting it to un-block folks while we investigate. Alexey and I will be working on fixing everything up so this can be re-committed soon. Sorry for the noise and any inconvenience. llvm-svn: 225079
* [Sanitizer] Make CommonFlags immutable after initialization.Alexey Samsonov2014-12-221-2/+3
| | | | | | | | | | | | | | | | | | | Summary: Protect CommonFlags singleton by adding const qualifier to common_flags() accessor. The only ways to modify the flags are SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and OverrideCommonFlags() functions, which are only supposed to be called during initialization. Test Plan: regression test suite Reviewers: kcc, eugenis, glider Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6741 llvm-svn: 224736
* [Sanitizer] Refactor CommonFlags interface. NFC.Alexey Samsonov2014-12-191-3/+3
| | | | | | | | | | Add CommonFlags::SetDefaults() and CommonFlags::ParseFromString(), so that this object can be easily tested. Enforce that ParseCommonFlagsFromString() and SetCommonFlagsDefaults() work only with singleton CommonFlags, shared across all sanitizer runtimes. llvm-svn: 224617
* [UBSan] Introduce more flexible __ubsan_default_options function instead of ↵Alexey Samsonov2014-09-191-13/+13
| | | | | | UBSAN_DEFAULT_OPTIONS compile definition llvm-svn: 218137
* Revert r217616. Problems and complexity it introduces negate its benefitAlexey Samsonov2014-09-121-2/+1
| | | | llvm-svn: 217652
* [UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even ifAlexey Samsonov2014-09-111-1/+2
| | | | | | UBSan is combined with ASan. llvm-svn: 217616
* [UBSan] Add halt_on_error runtime flagAlexey Samsonov2014-09-101-0/+3
| | | | llvm-svn: 217535
* [UBSan] Allow to override runtime flags defaults by providingAlexey Samsonov2014-07-301-1/+16
| | | | | | | compile definition UBSAN_DEFAULT_OPTIONS when building the runtime. This mirrors similar ASan functionality. llvm-svn: 214259
* [UBSan] Move all runtime flags parsing to ubsan_flags.cc.Alexey Samsonov2014-07-291-6/+17
| | | | | | No functionality change. llvm-svn: 214258
* [UBSan] Add the ability to dump call stacks to -fsanitize=vptrAlexey Samsonov2014-07-231-0/+34
This change introduces the first UBSan-specific runtime flag: print_stacktrace (off by default). It can be set in UBSAN_OPTIONS to unwind and print call stacks in addition to diagnostic messages. For now these stacks are printed only in vptr checker. This change is based on http://reviews.llvm.org/D4410 by Byoungyoung Lee! llvm-svn: 213783
OpenPOWER on IntegriCloud