Commit Graph

5625 Commits

Author SHA1 Message Date
Ahmed Bougacha f190def830 [builtins] Hide long double fp_test.h helpers if it's not fp128.
Like we do for the various __*tf* tests, check that long double is the
128bit type we expect directly in the header. The latter is now used by
unrelated tests (__*hf* since r237161), and those tests will break for
no reason if uint128_t doesn't exist, and long double isn't fp128.

llvm-svn: 239630
2015-06-12 18:28:47 +00:00
Chris Bieneman 6bd006f31a [CMake] Cleanup add_compiler_rt_object_library to be platform-agnostic
Summary:
This change takes darwin-specific goop that was scattered around CMakeLists files and spread between add_compiler_rt_object_library and add_compiler_rt_darwin_object_library and moves it all under add_compiler_rt_object_library.

The goal of this is to try to push platform handling as low in the utility functions as possible.

Reviewers: rnk, samsonov

Reviewed By: rnk, samsonov

Subscribers: rnk, rsmith, llvm-commits

Differential Revision: http://reviews.llvm.org/D10250

llvm-svn: 239498
2015-06-10 23:55:07 +00:00
Yury Gribov ef40f0bbff [ASan] Quick-fix tests for new string interceptors.
Patch by Maria Guseva.

Differential Revision: http://reviews.llvm.org/D10336

llvm-svn: 239461
2015-06-10 07:16:02 +00:00
Anna Zaks dd9e6578f0 [asan] Fixup to r239134. This test does pass on darwin.
This should restore the darwin buildbot.

llvm-svn: 239364
2015-06-08 23:24:55 +00:00
Evgeniy Stepanov cbed1e4f79 [asan] Disable asan for aarch64.
lib/Target/AArch64/AArch64FrameLowering.cpp:370: virtual void llvm::AArch64FrameLowering::emitPrologue(llvm::MachineFunction&, llvm::MachineBasicBlock&) const: Assertion `!(NeedsRealignment && NumBytes==0) && "NumBytes should never be 0 when realignment is needed"' failed.

llvm-svn: 239352
2015-06-08 21:07:24 +00:00
Evgeniy Stepanov 24196c505b [asan] Enable AArch64 build of ASan runtime and tests.
llvm-svn: 239322
2015-06-08 18:19:26 +00:00
Evgeniy Stepanov e33f64f682 [asan] Fix Android build for API >= 21.
/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: error: address of function 'dl_iterate_phdr' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if (!dl_iterate_phdr)
      ~^~~~~~~~~~~~~~~
/code/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc:971:8: note: prefix with the address-of operator to silence this warning
  if (!dl_iterate_phdr)
       ^
       &

llvm-svn: 239321
2015-06-08 18:15:52 +00:00
Evgeniy Stepanov 572cd900b2 [asan] Fix build of AsanNoinstTest on Android.
Some of the asan-ubsan build changes were not replicated in the android branch in CMakeLists.

llvm-svn: 239320
2015-06-08 18:03:33 +00:00
Alexey Samsonov 9f97bf0943 [ASan] Bump maximum allowed malloc() size in ASan allocator to 1Tb.
1Tb of RAM ought to be enough for anybody.

llvm-svn: 239187
2015-06-05 20:50:02 +00:00
Yury Gribov 2d45554b82 [ASan] Add process basename to log name and error message to
simplify analysis of sanitized systems logs.
    
Differential Revision: http://reviews.llvm.org/D7333

llvm-svn: 239134
2015-06-05 06:08:23 +00:00
Evgeniy Stepanov 8e27f59a1b [tsan] Disable a flaky test.
llvm-svn: 239063
2015-06-04 18:28:35 +00:00
Yury Gribov e244b49f2c [ASan] Fix Darwin and Windows builds.
llvm-svn: 239027
2015-06-04 07:56:19 +00:00
Yury Gribov c019a57099 [ASan] Make binary name reader cross-platform.
Differential Revision: http://reviews.llvm.org/D10213

llvm-svn: 239020
2015-06-04 07:29:43 +00:00
Yury Gribov c5243f0c6a [ASan] Move ASan runtime library self-checks to a more appropriate place.
llvm-svn: 239018
2015-06-04 07:23:09 +00:00
Filipe Cabecinhas 215046bf98 [sanitizer_common] Added VS-style output for source locations
Summary:
With this patch, we have a flag to toggle displaying source locations in
the regular style:
file:line:column

or Visual Studio style:
file(line,column)

This way, they get picked up on the Visual Studio output window and one
can double-click them to get to that file location.

Reviewers: samsonov, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10113

llvm-svn: 239000
2015-06-04 01:20:06 +00:00
Evgeniy Stepanov 1b3d46ec30 [asan] Fix undefined MAP_NORESERVE on FreeBSD.
llvm-svn: 238995
2015-06-04 00:42:15 +00:00
Filipe Cabecinhas 094c04ec81 [Sanitizers] Add *SAN_OPTIONS to possibly_dangerous_env_vars
Summary:
This way, if they're set when running ninja check-ubsan (or another
sanitizer), they get cleared before we start invoking the programs.

Reviewers: samsonov, kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D10229

llvm-svn: 238991
2015-06-04 00:12:55 +00:00
Tim Northover b1f5879f3a Tests: disable test of /proc filesystem on Darwin.
We don't have it. I'm not entirely sure "Posix" is a good name for that
directory, but perhaps we should see how it develops.

llvm-svn: 238874
2015-06-02 21:59:04 +00:00
Yury Gribov ddf646b8c7 [ASan] Fixed tests to pass on Darwin. Patch by Maria Guseva!
Differential Revision: http://reviews.llvm.org/D10159

llvm-svn: 238837
2015-06-02 14:59:26 +00:00
Evgeniy Stepanov 42fb96652b [sanitizer] Add -lrt to dyndd link line.
llvm-svn: 238626
2015-05-29 22:57:15 +00:00
Justin Bogner ba6e2ae0c5 profile: Fix link errors in this test on darwin
llvm-svn: 238622
2015-05-29 22:41:25 +00:00
Evgeniy Stepanov 8e9c70be7f Add descriptive names to sanitizer entries in /proc/self/maps. Helps debugging.
This is done by creating a named shared memory region, unlinking it
and setting up a private (i.e. copy-on-write) mapping of that instead
of a regular anonymous mapping. I've experimented with regular
(sparse) files, but they can not be scaled to the size of MSan shadow
mapping, at least on Linux/X86_64 and ext3 fs.

Controlled by a common flag, decorate_proc_maps, disabled by default.

This patch has a few shortcomings:
* not all mappings are annotated, especially in TSan.
* our handling of memset() of shadow via mmap() puts small anonymous
  mappings inside larger named mappings, which looks ugly and can, in
  theory, hit the mapping number limit.

llvm-svn: 238621
2015-05-29 22:31:28 +00:00
Reid Kleckner ea09c99a4c Use sanitizer_atomic_clang.h with clang-cl instead of the MSVC variant
llvm-svn: 238585
2015-05-29 17:56:39 +00:00
Yury Gribov 9ebb303459 [ASan] Fix flaky tests (see https://llvm.org/bugs/show_bug.cgi?id=23230).
Patch by Maria Guseva!

Differential Revision: http://reviews.llvm.org/D10063

llvm-svn: 238545
2015-05-29 06:45:13 +00:00
Evgeniy Stepanov bab1a075df [asan] Add new(unsigned int) to ASan interface list.
Also, sized-delete with size_t == unsigned int.
These guys appear when building for Android with gnu-stl.

Fixes a number of ASan tests in that particular configuration.

llvm-svn: 238484
2015-05-28 20:37:50 +00:00
Ed Maste 3fa1b65c1c Use /usr/bin/env to find python
Python may not be /usr/bin/python on some systems. For example, on
FreeBSD it will be /usr/local/bin/python.

Reviewers: samsonov
Differential Revision: http://reviews.llvm.org/D9914

llvm-svn: 238428
2015-05-28 14:53:14 +00:00
Yury Gribov 83aaa8e05c [ASan] Disable alloca tests on ARM targets due to flakiness.
llvm-svn: 238426
2015-05-28 14:29:12 +00:00
Yury Gribov 64c701b3f7 [ASan] XFAIL VLA tests on ARM and PowerPC. Patch by Max Ostapenko!
llvm-svn: 238409
2015-05-28 10:30:46 +00:00
Yury Gribov 73570f4323 [ASan] Add new interceptors to asan_win_dll_thunk.cc to fix build errors on Windows.
Patch by Maria Guseva!

llvm-svn: 238407
2015-05-28 10:21:59 +00:00
Yury Gribov 0ca65fd83d [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, strpbrk.
Patch by Maria Guseva.

Differential Revision: http://reviews.llvm.org/D9017

llvm-svn: 238406
2015-05-28 09:24:33 +00:00
Yury Gribov 63d9764585 [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!
Differential Revision: http://reviews.llvm.org/D7098

llvm-svn: 238401
2015-05-28 07:49:05 +00:00
Evgeniy Stepanov 1f1d9f27fd [asan] Fix build dependency issues with ASan version list file.
CMake pre-3.1 has a bug where a shared library depending on a custom_target
does not really depend on it.

This commit implements a hilariously ugly workaround for this problem, see
code comments for more details.

llvm-svn: 238367
2015-05-27 22:38:01 +00:00
Diego Novillo c88d5b6acd Test case for PR 23499.
llvm-svn: 238338
2015-05-27 17:03:26 +00:00
Evgeniy Stepanov d99717226d [msan] Fix mmap test on Fedora.
llvm-svn: 238226
2015-05-26 18:02:54 +00:00
Evgeniy Stepanov 45328240dc [msan] Mprotect all inaccessible memory regions.
Fix 2 bugs in memory mapping setup:
- the invalid region at offset 0 was not protected because mmap at
  address 0 fails with EPERM on most Linux systems. We did not
  notice this because the check condition was flipped: the code was
  checking that mprotect has failed. And the test that was supposed
  to catch this was weakened by the mitigations in the mmap
  interceptor.
- when running without origins, the origin shadow range was left
  unprotected.

The new test ensures that mmap w/o MAP_FIXED always returns valid
application addresses.

llvm-svn: 238109
2015-05-24 02:47:59 +00:00
Kostya Serebryany 05425a88cd [dfsan] ignore more __sanitizer callbacks
llvm-svn: 238085
2015-05-23 01:56:39 +00:00
Saleem Abdulrasool a3b3952ccd builtins: mark functions as aapcs on Windows
Windows does not use AAPCS, but rather AAPCS-VFP, and thus the functions which
are assumed to be AAPCS will cause invalid argument setup.  Ensure that the
functions are marked as AAPCS.

llvm-svn: 238056
2015-05-22 21:47:24 +00:00
Nick Kledzik 506813892e [darwin] fix libcompiler_rt.dylib build
The dylib build of compiler-rt has been broken on darwin since the
directory restructuring to push some things down into /builtins/.

llvm-svn: 237848
2015-05-20 22:37:46 +00:00
Reid Kleckner 868a6c3023 Revert some of "Silence some CMake 3.3 dev warnings in compiler-rt"
This reverts part of r237808.

The CMP0057 warnings came from an old development build of CMake that
nobody else has. We don't need the cruft.

llvm-svn: 237819
2015-05-20 18:39:59 +00:00
Reid Kleckner aa9029691f Silence some CMake 3.3 dev warnings in compiler-rt
Fix a trivial instance of CMP0054 that came up on llvmdev.

The other warnings were CMP0057, which is about using the same file as a
MAIN_DEPENDENCY multiple times.  The old behavior hasn't been a problem
yet, so I silenced the warning and filed PR23595 to document the issue
if someone cares.

llvm-svn: 237808
2015-05-20 16:56:17 +00:00
Peter Collingbourne c6c660b3dd Factor out LTO detection to common configuration.
This will allow us to test other sanitizers with LTO.

llvm-svn: 237747
2015-05-19 23:50:13 +00:00
Peter Collingbourne 47b4e4ca01 CFI: Remove <utility> include.
It is unused, and causes a test failure on Darwin.

llvm-svn: 237746
2015-05-19 23:50:11 +00:00
Reid Kleckner 1cdd948f5b [ASan/Win] Add DLL thunk for new coverage hook
Should fix dll_host.cc test failing on bots.

llvm-svn: 237725
2015-05-19 21:02:23 +00:00
Sagar Thakur 3ee5bd9377 [sanitizer][MIPS] Add --target flag for MIPS32
Without the --target flag, clang uses the mips64 triple which selects the n64 abi. We need to add --target=mips-linux-gnu, so that clang can select the correct abi for mips32r2.

Reviewers: dsanders, kcc, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9249

llvm-svn: 237675
2015-05-19 09:07:37 +00:00
Evgeniy Stepanov 270c5257e6 [asan] Disable static-tls test on PowerPC.
llvm-svn: 237534
2015-05-17 05:24:09 +00:00
Evgeniy Stepanov 7f6290ca9a [sanitizer] Recognize static TLS in __tls_get_addr interceptor.
Current code tries to find the dynamic TLS header to the left of the
TLS block without checking that it's not a static TLS allocation.

llvm-svn: 237495
2015-05-16 00:34:15 +00:00
Kostya Serebryany 7747762df9 [tsan] deflakify one more tsan test
llvm-svn: 237387
2015-05-14 20:27:12 +00:00
Ahmed Bougacha c9fa0b8e21 [Builtins] Wire half-precision conversions through cc_kext makefiles.
Kernel side of r237329.

llvm-svn: 237330
2015-05-14 02:21:02 +00:00
Ahmed Bougacha a5d1a91163 [Builtins] Wire half-precision conversions through Darwin makefiles.
Follow-up to r237161, modeled after r236805.

Note that arm64 is omitted on purpose, as the conversions are supported
natively there.

llvm-svn: 237329
2015-05-14 01:47:32 +00:00
Ahmed Bougacha 9a43d5be2f [Builtins] Implement f2h/h2f by jumping to trunc/extend.
Follow-up to r237161; seems like we can't use aliases, but we
can do better than duplicating the bodies, especially when that
body, after inlining, isn't as small as it looks.

Better approaches welcome.  Perhaps the best thing is just to have
an #ifndef __APPLE__ over the GNUEABI names, since they're not used
there.

llvm-svn: 237323
2015-05-14 00:50:28 +00:00