Commit Graph

6097 Commits

Author SHA1 Message Date
Chris Bieneman 626f6a057c [CMake] Adding support for generating libclang_rt.eprintf.a
This library provides eprintf for i386 on OS X versions later than 10.4.

llvm-svn: 249913
2015-10-09 22:40:50 +00:00
Chris Bieneman 0ed9bc1995 [CMake] hand tuning the macho_embedded export lists to match the current Xcode distribution.
llvm-svn: 249912
2015-10-09 22:40:47 +00:00
Chris Bieneman b9cca18f11 [CMake] Hand tuning the exclude lists for libclang_rt.10.4.a
llvm-svn: 249888
2015-10-09 19:53:54 +00:00
Chris Bieneman 2c23a80bbf [CMake] [Darwin] [builtins] Need to special case the naming of the OS X cc_kext builtin library.
llvm-svn: 249870
2015-10-09 18:38:34 +00:00
Chris Bieneman 4ebd15726f [CMake] [darwin] [builitins] Don't build x86_64h into the 10.4 builtins library
There is no haswell support in 10.4, so we don't need a 10.4 builtin library.

llvm-svn: 249868
2015-10-09 18:32:34 +00:00
Chris Bieneman 3a1ad39702 [CMake] [Darwin] [Builtins] Fixing a typo that was keeping the OS X 10.4 builtins library from being built properly.
llvm-svn: 249844
2015-10-09 16:47:43 +00:00
Reid Kleckner 8da160173c Remove the XFAIL for the C++ EH test
It works on Windows now.

llvm-svn: 249799
2015-10-09 01:33:15 +00:00
Evgeniy Stepanov 6870dc7311 Fix msan tests build.
CMake build rules listed -I flags for two different libc++ header
locations which broke when libc++ headers started using include_next.

Also change -I to -isystem to avoid compiler warning about
include_next.

llvm-svn: 249759
2015-10-08 22:21:36 +00:00
Evgeniy Stepanov b688a47963 New MSan mapping layout (compiler-rt part).
This is an implementation of
https://github.com/google/sanitizers/issues/579

It has a number of advantages over the current mapping:
* Works for non-PIE executables.
* Does not require ASLR; as a consequence, debugging MSan programs in
  gdb no longer requires "set disable-randomization off".
* Supports linux kernels >=4.1.2.
* The code is marginally faster and smaller.

This is an ABI break. We never really promised ABI stability, but
this patch includes a courtesy escape hatch: a compile-time macro
that reverts back to the old mapping layout.

llvm-svn: 249754
2015-10-08 21:35:34 +00:00
Evgeniy Stepanov 437615639f Revert "[lsan] [aarch64] Add support for AArch64"
This reverts commit ea02fa45225c35613bfecab383fb526e24b74497 (r249337).

Reason: broken "ninja AsanUnitTests" on Android/AArch64.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/20675/steps/build%20compiler-rt%20android%2Faarch64/logs/stdio

llvm-svn: 249730
2015-10-08 20:08:30 +00:00
Alexey Samsonov d9cc7f884f Provide missing Internal{Alloc, Free} declarations for libbacktrace symbolizer.
Summary:
Since r223145 we don't include sanitizer_allocator_internal.h into
sanitizer_symbolizer.h, so we can have undefined reference to
Internal{Alloc, Free} stuff into sanitizer_symbolizer_libbacktrace.cc under
SANITIZER_CP_DEMANGLE macro.

This patch simply includes appropriate header into
sanitizer_symbolizer_libbacktrace.h to resolve the issue.

Patch by Maxim Ostapenko!

Reviewers: kcc, eugenis, samsonov

Subscribers: llvm-commits, ygribov

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

llvm-svn: 249633
2015-10-07 23:13:28 +00:00
Oliver Stannard 28d2edad5b Add ARM RTABI aliases for half-precision conversions
The ARM RTABI defines these functions as __aeabi_h2f, __aeabi_f2h and
__aeabi_d2h, so we need aliases for them.

llvm-svn: 249559
2015-10-07 16:15:22 +00:00
Saleem Abdulrasool e597ace1fe builtins: fix build
__GNUC__ indicates the GNU compiler, not __GNU__.  This got through due to
building with clang rather than gcc.

llvm-svn: 249516
2015-10-07 03:30:02 +00:00
Saleem Abdulrasool 396e794459 builtins: implement instrinics for cl
cl does not support the same intrinsics as clang.  Provide implementations for
the intrinsics using MSVC builtins.

Patch by Tee Hao Wei!

llvm-svn: 249515
2015-10-07 02:58:11 +00:00
Saleem Abdulrasool b0b7c8a8dd builtins: emulate _Complex for cl
cl does not support C99 completely as of VS2015.  Emulate _Complex to allow
building with MSVC.

Patch by Tee Hao Wei!

llvm-svn: 249514
2015-10-07 02:58:07 +00:00
Saleem Abdulrasool 71c47e5a86 builtins: use MSVC intrinsics with cl
Use MSVCRT functions for floating-point builtins unavailable on MSVC.

Patch by Tee Hao Wei!

llvm-svn: 249513
2015-10-07 02:58:02 +00:00
Renato Golin 814e5caebc [LSAN] Mark death callback as unstable while we investigate the cause in AArch64
llvm-svn: 249398
2015-10-06 13:29:44 +00:00
Vasileios Kalintiris 0943a95f46 [builtins] Enable building of the builtins library for MIPS targets.
Reviewers: howard.hinnant, samsonov

Subscribers: samsonov, dsanders, llvm-commits

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

llvm-svn: 249382
2015-10-06 09:02:38 +00:00
Saleem Abdulrasool d2eb26c7f0 builtins: fix build
Unfortunately, int_utils.h needs to depend on int_lib for the common macro
definitions.  However, currently, int_utils.h is included by int_lib.h.  Reorder
the inclusion to work around this.

llvm-svn: 249376
2015-10-06 04:33:08 +00:00
Saleem Abdulrasool e6f9652a22 builtins: Use MSVC-equivalents of attributes
This allows us to build the builtins using MSVC.  NFC.

Patch by Tee Hao Wei!

llvm-svn: 249375
2015-10-06 04:33:05 +00:00
Saleem Abdulrasool 4c81f0a1be builtins: tweak constant spelling
Use 4294967296.f instead of 0x1p32f to fix MSVC.  NFC.

Patch by Tee Hao Wei!

llvm-svn: 249374
2015-10-06 04:33:02 +00:00
Saleem Abdulrasool 89a92b9fb2 builtins: tweak Windows build
Include Windows.h instead of winbase.h and windef.h

Patch by Tee Hao Wei!

llvm-svn: 249373
2015-10-06 04:32:59 +00:00
Keno Fischer e16edb554f [compiler-rt] Properly detect lack of available system libraries for arch in clang_darwin.mk
Summary: This is the Makefile analog of r247833, except that the test also had to be changed such that clang actually attempts to link the program as opposed to just building it. Because of that change, I also switched the order to checking for ld/clang architecture support, because now lack of ld support would make the clang check fail. This fixes PR24776.

Reviewers: beanz

Subscribers: llvm-commits

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

llvm-svn: 249358
2015-10-05 22:24:12 +00:00
Adhemerval Zanella 5ea8dcb8cf [lsan] [aarch64] Add support for AArch64
This patch add support for leak sanitizer for aarch64.  Similar to
MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64
currently supports 39 and 42-bit VMA).

llvm-svn: 249337
2015-10-05 19:16:09 +00:00
Daniel Sanders bb9c116165 [asan][mips] Fix ABI incompatibility crash in pthread_create() following r248325.
Like i386, Mips needs a versioned interceptor but must select GLIBC_2.2.

llvm-svn: 249307
2015-10-05 12:43:47 +00:00
Chris Bieneman f9d71a5439 [CMake] [darwin] Removing a line of debug code that I accidentally committed.
llvm-svn: 249278
2015-10-04 15:48:16 +00:00
Chris Bieneman be8b60b602 [CMake] [darwin] [builtins] Add INSTALL_DIR to darwin_lipo_libs
The darwin and macho_embedded libraries get installed to different locations, so we need to feed through an INSTALL_PATH.

llvm-svn: 249199
2015-10-02 22:14:25 +00:00
Evgeniy Stepanov 06e338b403 [asan] Disable pthread_create_version test on mips.
llvm-svn: 249191
2015-10-02 21:23:53 +00:00
Chris Bieneman b22351cb18 [CMake] Workaround for the lipo output directory not being created.
This should resolve an issue reported by mclow.

llvm-svn: 249158
2015-10-02 17:37:40 +00:00
Chris Bieneman f0672f1187 [CMake] [builtins] [macho_embedded] Separate out the 64-bit thumb builtins so they don't get included on 'm' architectures. NFC.
This should help make the compiler-rt build less noisy.

llvm-svn: 249084
2015-10-01 22:01:06 +00:00
Chris Bieneman f9e0fe77c7 [CMake] [builtins] [macho_embedded] Don't pass -mfloat-abi=hard flag to x86 because the compiler ignores it and complains.
llvm-svn: 249076
2015-10-01 21:21:19 +00:00
Chris Bieneman 55745688c6 [CMake] [builtins] [OS X] Adding all builtins that generate empty object files for OS X to the exclude lists.
This should help make the compiler-rt build less noisy.

llvm-svn: 249070
2015-10-01 21:04:17 +00:00
Chris Bieneman d943670a82 [CMake] [builtins] [iOS Sim] Adding all builtins that generate empty object files for the iOS simulator to the exclude lists.
This should help make the compiler-rt build less noisy.

llvm-svn: 249068
2015-10-01 21:03:00 +00:00
Chris Bieneman f14b3f10a8 [CMake] [iOS] [builtins] Adding all builtins that generate empty object files for iOS to the exclude lists.
This should help make the compiler-rt build less noisy.

llvm-svn: 249057
2015-10-01 19:26:29 +00:00
Chris Bieneman adfe26fdbd [CMake] Only build the simulator builtins if you're also building the device builtins.
This matters because simulator builtins get lipo'd together with the device builtins into a single static archive per-platform.

llvm-svn: 249056
2015-10-01 19:26:26 +00:00
Chris Bieneman 291723353a [CMake] Only add an OS to the supported OS lists if there are supported architectures for that OS.
llvm-svn: 249054
2015-10-01 18:58:59 +00:00
Evgeniy Stepanov 74697714c2 [asan] Tweak gen_dynamic_list.py to work with both Py2 and Py3.
llvm-svn: 249051
2015-10-01 18:27:28 +00:00
Evgeniy Stepanov 8adbded6a4 [asan] Tune down SizeClassAllocator tests.
This should make the Android/x86 bot (running on a Nexus Player) less
flaky.

llvm-svn: 249044
2015-10-01 17:59:08 +00:00
Vedant Kumar f7ed23f744 [compiler-rt] Fix build (again) by wrapping lines to 80 chars (NFC)
llvm-svn: 248979
2015-10-01 02:15:40 +00:00
Vedant Kumar f997bd88d7 [compiler-rt] Fix build by wrapping lines to 80 chars (NFC)
llvm-svn: 248973
2015-10-01 00:48:07 +00:00
Vedant Kumar 59ba7b8cd1 [compiler-rt] Apply modernize-use-nullptr fixes in sanitizers
- Trim spaces.
- Use nullptr in place of 0 for pointer variables.
- Use '!p' in place of 'p == 0' for null pointer checks.
- Add blank lines to separate function definitions.
- Add 'extern "C"' or 'namespace foo' comments after the appropriate
  closing brackets

This is a continuation of work from 409b7b82. The focus here is on the
various sanitizers (not sanitizer_common, as before).

Patch by Eugene Zelenko!

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

llvm-svn: 248966
2015-10-01 00:22:21 +00:00
Vedant Kumar 552c0111f1 [sanitizer_common] Apply modernize-use-nullptr, other minor fixes
- Trim spaces.
- Use nullptr in place of 0 for pointer variables.
- Use '!p' in place of 'p == 0' for null pointer checks.

Patch by Eugene Zelenko!

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

llvm-svn: 248964
2015-09-30 23:52:54 +00:00
Evgeniy Stepanov 25c58d124b [asan] Fix asan_symbolize.py handling of non-existing paths
llvm-svn: 248962
2015-09-30 23:17:39 +00:00
Ivan Krasin 97746d75bb CFI: add a test from base-to-derived cast from the base destructor.
Summary: This adds an interesting bad cast case, originally found in https://crbug.com/537398.

Reviewers: kcc

Subscribers: pcc

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

llvm-svn: 248958
2015-09-30 23:08:55 +00:00
Chris Bieneman b1ff6e4260 [CMake] [Darwin] Add and populate PROFILE_SUPPORTED_OS to enable building libclang_rt.profile for iOS.
llvm-svn: 248948
2015-09-30 21:23:22 +00:00
Chris Bieneman 7bfe1ee428 [CMake] [Darwin] [macho_embedded] Specify the version min explicitly.
We need to set the OS X deployment target on the macho_embedded libraries to match the outputs from the autoconf build system.

llvm-svn: 248944
2015-09-30 21:09:23 +00:00
Chris Bieneman af01508cc3 [CMake] [Darwin] [builtins] Add support for building libclang_rt.10.4.a
This builtin library is used when setting the OS X deployment target to 10.4, which we still support.

llvm-svn: 248940
2015-09-30 20:26:14 +00:00
Chris Bieneman d823302483 [CMake] [Darwin] [builtins] Change condition for skipping cc_kext to be setting based.
This is needed because we need to skip cc_kext generation for more than just the simulator builds.

llvm-svn: 248939
2015-09-30 20:25:10 +00:00
Chris Bieneman d208e41030 [CMake] [macho_embedded] We need to set some extra flags when building the macho_embedded builtins.
If we don't specify the arm target the float ABI compiler flags get ignored.

llvm-svn: 248853
2015-09-29 23:21:09 +00:00
Chris Bieneman d868fef16c [CMake] [Darwin] [builtins] Make CMake re-generate if the builtin filter lists change.
We need to make sure that if you change the builtin filter lists CMake re-generates its configurations so it includes the right builtins in the generated libraries.

llvm-svn: 248852
2015-09-29 23:21:07 +00:00
Chris Bieneman 6e18e1e39e [CMake] [Darwin] Support building the macho_embedded builtin libraries.
Summary: This ports functionality from the clang_macho_embedded.mk platform makefile over to CMake.

Reviewers: bogner, samsonov, bob.wilson

Subscribers: llvm-commits

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

llvm-svn: 248850
2015-09-29 23:13:45 +00:00
Evgeniy Stepanov 01e4c87a5a [msan] Disable allocator_mapping test on mips64 and aarch64.
llvm-svn: 248835
2015-09-29 22:24:57 +00:00
Alexey Samsonov 4133c18b1c [CFI] Make CFI tests require UBSan (for diagnostic mode).
CFI itself, on the other hand, doesn't require anything, including
sanitizer_common.

llvm-svn: 248830
2015-09-29 21:43:37 +00:00
Evgeniy Stepanov 7aba3960c7 [msan] Early allocator initialization.
Map MSan heap space early (in __msan_init) so that user code can not
accidentally (i.e. w/o MAP_FIXED) create a conflicting mapping.

llvm-svn: 248829
2015-09-29 21:28:54 +00:00
Renato Golin 9be32f6317 Add armhf as unstable runtime temporarily
llvm-svn: 248819
2015-09-29 18:35:55 +00:00
Kostya Serebryany 0c3a5767d9 [sanitizer] Fix Clang-tidy modernize-use-nullptr warnings in lib/sanitizer_common headers, unify closing inclusion guards. Patch by Eugene Zelenko
llvm-svn: 248816
2015-09-29 18:23:36 +00:00
Chris Bieneman 5def2a8a44 [CMake] [Darwin] [builtins] Apply OS and OS-arch filters to cc_kext builtin libraries.
We don't want to filter out the builtins that are present in libSystem like we do for the normal builtins because kexts can't link libSystem, but we should filter out all the builtins that are generally not supported on the OS and architecture.

llvm-svn: 248756
2015-09-28 23:09:46 +00:00
Chris Bieneman 88d8534e87 [CMake] Accidentally committed code that was using a variable only populated in some earlier code. NFC.
llvm-svn: 248752
2015-09-28 22:20:25 +00:00
Chris Bieneman 1341472f92 [CMake] [Darwin] [builtins] Fix building builtins for Darwin simulator platforms.
For Darwin simulator platforms we shouldn't build the cc_kext builtins at all because they aren't applicable, and we should includ the simulator builtins as slices inside the main platform builtin library.

llvm-svn: 248751
2015-09-28 22:18:31 +00:00
Chris Bieneman 4b16003590 [CMake] [Darwin] [builtins] Exclude aeabi builtins from iOS arm32 architectures since we don't support aeabi on iOS.
llvm-svn: 248744
2015-09-28 21:15:46 +00:00
Chris Bieneman 8aba4b0589 [CMake] [Darwin] Make darwin_filter_builtin_sources support both whitelist and blacklist filtering.
llvm-svn: 248720
2015-09-28 17:38:44 +00:00
Saleem Abdulrasool 0165015f6c builtins: silence GCC warning
If the builtins are built with libgcc as the unwind provider on ARM, the exposed
_Unwind_SetIP is a macro.  This results in the following warning due to
expansion of the argument:

warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]

Add a no-op set of parenthesis around the argument that will prevent this
warning.

llvm-svn: 248686
2015-09-27 17:16:46 +00:00
Saleem Abdulrasool f88e4fabb5 build: separate flags
This somehow worked with the build on Linux, but seems to fail on the buildbots.
Split the flags apart here as otherwise the two flags are treated as one, and
cause a compilation failure.

llvm-svn: 248654
2015-09-26 04:40:45 +00:00
Saleem Abdulrasool 29e12a1128 sanitizer: fix -pedantic warnings
Silence a few "warning: extra ';'" warnings from GCC.

llvm-svn: 248653
2015-09-26 04:40:42 +00:00
Saleem Abdulrasool 96c5023e53 build: create two versions of ARM builtins
This adds a new name for ARM32 (armhf).  We now force that the default build for
ARM32 (arm) to be soft-float ABI.  This has a corresponding clang change to look
for these names based on the floating point ABI.  The functions are built
identically (the functions are marked as AAPCS, so the calling convention does
not change, as per the RTABI specification), however, the object file contains
attributes indicating the build configuration which the linker will ensure are
not mix and matched.  We now built the appropriate named archive so that we can
link properly.

llvm-svn: 248648
2015-09-26 03:26:01 +00:00
Chris Bieneman bb62ec2cd6 [CMake] [darwin] [builtins] Make darwin_lipo_libs take OUTPUT_DIR as an option. NFC.
This refactoring will allow me to reuse this function when calling lipo with outputs in different directories.

llvm-svn: 248639
2015-09-25 23:55:53 +00:00
Chris Bieneman cc8c7773c5 [CMake] [darwin] Refactor darwin_read_exclude_file to be reusable. NFC.
Rename darwin_read_exclude_file to more generic darwin_read_list_from_file, and make it take the file path instead of constructing it so it can be reused more freely.

llvm-svn: 248635
2015-09-25 23:29:03 +00:00
Chris Bieneman 905f9fce0a [CMake] [darwin] [builtins] Should install the lipo'd builtin libraries.
On darwin we don't install the single-architecture builtin libraries, but we do need to install the lipo'd ones.

llvm-svn: 248630
2015-09-25 22:39:19 +00:00
Chris Bieneman 75c7c9ce8b [CMake] [darwin] [builtins] Should be reading the OS variable that is passed in, not the bleed through from the function above. NFC.
llvm-svn: 248629
2015-09-25 22:31:17 +00:00
Chris Bieneman 7146f7bcf9 [CMake] [darwin] [cc_kext] In addition to builtin sources the cc_kext builtins include some functions from clang_rt.profile.
llvm-svn: 248548
2015-09-24 22:29:58 +00:00
Chris Bieneman 590a48d4de [CMake] [darwin] [builtins] Refactoring darwin_find_excluded_builtins_list to parse arguments instead of only handling positional arguments.
OS and ARCH must be specified, but minimum version may not. Excluding the minimum version will only apply the filters for builtins not supported by the OS and OS-Arch pair.

llvm-svn: 248543
2015-09-24 21:51:09 +00:00
Chris Bieneman 5fbaeb9e5c [CMake] [darwin] [builtins] Refactoring code to filter builtin lists out into a function. NFC.
llvm-svn: 248542
2015-09-24 21:40:06 +00:00
Chris Bieneman 4acaa8fd9d [autoconf] Fixing a bug I introduced r248441
llvm-svn: 248529
2015-09-24 19:35:36 +00:00
Chris Bieneman 9b788a452b [CMake] [darwin] [builtins] Match clang_darwin.mk's compiler flags when building builtin libraries
On Darwin we have a very restrictive set of flags used when building the builtins. This change makes CMake match autoconf.

llvm-svn: 248523
2015-09-24 18:26:34 +00:00
Dmitry Vyukov 2fe0efcc69 tsan: add test for issue #602
llvm-svn: 248522
2015-09-24 17:38:56 +00:00
Chris Bieneman d983ae0a0e [CMake] pass -Wno-pedantic to cc_kext builtins build
We don't pass -pedantic to the builtin builds in the makefiles, so we shouldn't do it here. This is a temporary fix for the broken bot:

http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA_build/7526/warnings8Result/new/

A more correct solution is in the works.

llvm-svn: 248515
2015-09-24 16:47:26 +00:00
Vasileios Kalintiris 22db068008 Be consistent in the way we define 32/64-bit arches in ALL_*_SUPPORTED_ARCH variables. NFC.
Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 248514
2015-09-24 16:45:58 +00:00
Chris Bieneman 01ebf004ff [CMake] [Darwin] Bug 21562 - Add a CMake equivalent for make/platform/clang_darwin.mk in compiler_rt
Summary: First pass at adding cc_kext_* builtin libraries. I need to cleanup and refactor the builtin filtering so that I can use it to filter the builtin symbols list, but this is the first step in the right direction.

Reviewers: bob.wilson, bogner, samsonov

Subscribers: llvm-commits

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

llvm-svn: 248443
2015-09-23 23:05:32 +00:00
Chris Bieneman eb71c99684 [darwin] [builtins] Stop generating cc_kext_ios5 and move iOS architectures out of cc_kext into cc_kext_ios
Summary:
Xcode 7 doesn't support targeting iOS5 and earlier. Instead of just dropping cc_kext_ios5, I've repurposed it to cc_kext_ios, and I'm pulling the iOS architectures out of cc_kext. Putting OS X and iOS slices inside the same archive was just odd.

There is a cooresponding clang change coming too.

Reviewers: bogner, bob.wilson

Subscribers: llvm-commits

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

llvm-svn: 248441
2015-09-23 22:52:26 +00:00
Chris Bieneman 2a6c13274c [CMake] [builtins] Only include the atomic builtins if(APPLE).
There are lingering issues building the atomic builtins with various versions of gcc. To unblock people we can only include them on Apple platforms where they are more tested.

llvm-svn: 248386
2015-09-23 15:28:44 +00:00
Chris Bieneman 9c46be2d2f Code cleanup based on post-commit review from Aaron Ballman.
llvm-svn: 248385
2015-09-23 15:28:35 +00:00
Chris Bieneman 0d427986f5 [CMake] [Darwin] Bug 21562 - Add a CMake equivalent for make/platform/clang_darwin.mk in compiler_rt
Summary:
Building the builtins on Darwin platforms is a bit complicated. This is a first-pass implementation of the functionality from clang_darwin.mk into CMake.

When building the builtins on Darwin we have layers of blacklists that we apply based on platform, architecture, and minimum supported OS version.

Reviewers: bogner, filcab, bob.wilson, samsonov

Subscribers: llvm-commits

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

llvm-svn: 248383
2015-09-23 15:18:17 +00:00
Chris Bieneman be61720c4e [builtins] Fixing broken bot building on linux with -Werror
Returning a void expression is bad.

llvm-svn: 248346
2015-09-22 23:35:24 +00:00
Evgeniy Stepanov a7ecbe5685 [asan] Add missing -pthread in tests.
llvm-svn: 248332
2015-09-22 22:24:46 +00:00
Chris Bieneman 0a9466c11e [builtins] One more stab at fixing the bots.
llvm-svn: 248330
2015-09-22 22:19:21 +00:00
Chris Bieneman 7908b12967 [builtins] Fixing atomic builtins to be compiled out if stdatomic.h isn't available.
This should fix the bots broken by r248322.

Reviewed by bogner over my shoulder.

llvm-svn: 248328
2015-09-22 21:50:43 +00:00
Evgeniy Stepanov 9147de0ddf [asan] Versioned interceptor for pthread_create.
This fixes a crash in pthread_create on linux/i386 due to abi
incompatibility between intercepted and non-intercepted functions.

See the test case for more details.

llvm-svn: 248325
2015-09-22 21:34:44 +00:00
Chris Bieneman 54445f92a9 [CMake] Add atomic builtins to GENERIC_SOURCES list.
Reviewers: bogner, samsonov

Subscribers: llvm-commits

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

llvm-svn: 248322
2015-09-22 21:18:19 +00:00
Renato Golin 7716df5b7d Disable final MSAN test in AArch64 to get the bots green
llvm-svn: 248014
2015-09-18 18:02:55 +00:00
Renato Golin 4610486e88 Disable one MSAN test in AArch64 until we have a proper fix
llvm-svn: 248008
2015-09-18 17:22:48 +00:00
Adhemerval Zanella dab7043d89 [compiler-rt] [sanitizer] Clean buildbot failures for aarch64
Currently aarch64 lacks instrumentation support for variadic arguments
for MSan.  This patch sets the UBSan tests that uses it as to require
stable-runtime and sets aarch64/ubsan as an unstable one.

llvm-svn: 247996
2015-09-18 15:48:32 +00:00
Evgeniy Stepanov 6e663a1e32 Revert "ubsan: Implement memory permission validation for vtables."
This reverts r247484 and two follow-up commits.
Breaks ppc and x86_64 sanitizer bots.

llvm-svn: 247921
2015-09-17 19:15:54 +00:00
Reid Kleckner 3e9d733e68 [Windows] xfail a test that uses C++ EH
llvm-svn: 247845
2015-09-16 20:32:22 +00:00
Evgeniy Stepanov 10c9ea51a0 Fix compilation warning in compiler-rt.
error: width of bit-field 'allocated' (8 bits) exceeds the width of
its type; value will be truncated to 1 bit [-Werror,-Wbitfield-width]

llvm-svn: 247840
2015-09-16 19:54:36 +00:00
Chris Bieneman 672311b368 [CMake] Make the sample program in darwin_test_archs have a symbol it needs to link.
This resolves an issue building compiler-rt using Xcode 7 that was reported on llvm-dev:

http://lists.llvm.org/pipermail/llvm-dev/2015-September/090245.html

llvm-svn: 247833
2015-09-16 18:29:52 +00:00
Adhemerval Zanella 19074450ee [MSan] Enable MSAN for aarch64
This patch enabled msan for aarch64 with 39-bit VMA and 42-bit VMA.
As defined by lib/msan/msan.h the memory layout used is for 39-bit is:

   00 0000 0000 - 40 0000 0000:  invalid
   40 0000 0000 - 43 0000 0000:  shadow
   43 0000 0000 - 46 0000 0000:  origin
   46 0000 0000 - 55 0000 0000:  invalid
   55 0000 0000 - 56 0000 0000:  app (low)
   56 0000 0000 - 70 0000 0000:  invalid
   70 0000 0000 - 80 0000 0000:  app (high)

And for 42-bit VMA:

   000 0000 0000 - 100 0000 0000:  invalid
   100 0000 0000 - 11b 0000 0000:  shadow
   11b 0000 0000 - 120 0000 0000:  invalid
   120 0000 0000 - 13b 0000 0000:  origin
   13b 0000 0000 - 2aa 0000 0000:  invalid
   2aa 0000 0000 - 2ab 0000 0000:  app (low)
   2ab 0000 0000 - 3f0 0000 0000:  invalid
   3f0 0000 0000 - 400 0000 0000:  app (high)

Most of tests are passing with exception of:

   * Linux/mallinfo.cc
   * chained_origin_limits.cc
   * dlerror.cc
   * param_tls_limit.cc
   * signal_stress_test.cc
   * nonnull-arg.cpp

The 'Linux/mallinfo.cc' is due the fact AArch64 returns the sret in 'x8'
instead of default first argument 'x1'.  So a function prototype that
aims  to mimic (by using first argument as the return of function) won't
work. For GCC one can make a register alias (register var asm ("r8")), but
for clang it detects is an unused variable and generate wrong code.

The 'chained_origin_limits' is probably due a wrong code generation,
since it fails only when origin memory is used
(-fsanitize-memory-track-origins=2) and only in the returned code
(return buf[50]).

The 'signal_streess_test' and 'nonnull-arg' are due currently missing variadic
argument handling in memory sanitizer code instrumentation on LLVM side.

Both 'dlerror' and 'param_tls_test' are unknown failures that require
further investigation.

All the failures are XFAIL for aarch64 for now.

llvm-svn: 247809
2015-09-16 15:12:25 +00:00
Naomi Musgrave 36597fa128 Explicit reference to bug highlighted by
test/msan/dtor-trivial.cpp. Runtime testing for poisoning
vtable pointer in dtor.

Summary: Runtime testing for vtable ptr poisoning in dtor.

Reviewers: eugenis, kcc

Subscribers: llvm-commits

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

Clean test case & comments.

Update tests for vptr poisoning order.

Simplify test to rely upon globals.

Assertions verify that vtable still accessible from dtors.

Testing linear inheritance and multiple inheritance for vtable poisoning.

Macros for testing expected failing functions.

Rename macros.

Removed xfail, modified FileCheck commands, to expect test to crash.

llvm-svn: 247763
2015-09-16 00:41:28 +00:00
Alexey Samsonov f23dee5408 [ASan] Add test for .preinit_array/.init_array/.fini_array sections.
llvm-svn: 247737
2015-09-15 23:06:17 +00:00
Adhemerval Zanella 172cc32ef3 [sanitizer] Move CheckVMASize after flag initialization
llvm-svn: 247684
2015-09-15 13:22:54 +00:00
Alexey Samsonov 1b76da6a6c Support inline functions symbolization in Addr2Line symbolizer.
Patch by Maxim Ostapenko!

Summary:
Right now, Addr2Line symbolizer in asan_symbolize.py doesn't support inline functions symbolization. This might be a useful feature for using ASan on embedded systems.

Test results:

$ cat test.c

static inline void FooBarBaz() {
  __sanitizer_print_stack_trace();
}

int main() {
  FooBarBaz();
  return 0;
}

$ clang  test.c -fsanitize=address -g -O2 -o test.x && ./test.x &> /tmp/test.log
$ ./projects/compiler-rt/lib/asan/scripts/asan_symbolize.py  -l /tmp/test.log
    #0 0x42095e in __sanitizer_print_stack_trace _asan_rtl_
    #1 0x4cec07 in FooBarBaz /home/max/build/llvm/asan/test.c:4
    #2 0x4cec07 in main /home/max/build/llvm/asan/test.c:8
    #3 0x7f89f0891ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

Reviewers: glider, samsonov

Subscribers: jevinskie, llvm-commits, ygribov

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

llvm-svn: 247642
2015-09-14 23:56:42 +00:00