Commit Graph

59 Commits

Author SHA1 Message Date
Evgeniy Stepanov 91960900f8 Build ASan runtime library with -z global on Android.
llvm-svn: 236537
2015-05-05 20:13:39 +00:00
Daniel Sanders ffa272ebbb [mips] Support building compiler-rt with gcc.
Summary:
This will allow us to enable it on the buildbot (and then enable a
sanitizer buildbot).

The problem is that gcc for Mips does not accept -m32/-m64 like clang does.
We therefore need to use the nearest equivalent -mips32r2/-mips64r2. We must
also specify -mabi=64 in the -mips64r2 case since gcc's default ABI has
traditionally been N32 whereas clang's is N64.

Reviewers: sagar

Reviewed By: sagar

Subscribers: llvm-commits, samsonov, kcc, mohit.bhakkad, Anand.Takale, sagar

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

llvm-svn: 235299
2015-04-20 12:44:01 +00:00
Sagar Thakur bcc495abc8 test commit
llvm-svn: 235176
2015-04-17 10:14:16 +00:00
Dmitry Vyukov 4bf08947a1 [sanitizer][MIPS] Fix warnings on MIPS
Fixed:
- stack frame size warning.
- msse3 flag unused warning.
- GoTsanRuntimeCheck dependency warning reported by cmake.

Change by Sagar Thakur
Reviewed in http://reviews.llvm.org/D8963

llvm-svn: 234579
2015-04-10 09:45:22 +00:00
Alexey Samsonov 09dce3b7e5 [UBSan] Embed UBSan into ASan runtime (compiler-rt part).
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
2015-04-01 22:42:36 +00:00
Bill Seurer 4c41366510 [PPC64]This activates UBSan for the power architecture.
One test case is updated to allow for differences between power and other architectures in behavior when returning from main in certain instances

http://reviews.llvm.org/D8743

llvm-svn: 233813
2015-04-01 15:33:22 +00:00
Alexey Samsonov 1c1407395f [LSan] Don't explicitly exclude LSan from Windows build - it should just produce dummy object files. NFC.
llvm-svn: 233231
2015-03-25 23:26:49 +00:00
Alexey Samsonov 655bd0200c [CMake] Effectively revert r230683.
Clang in 32-bit mode may choose to target different architecture
than host compiler.

llvm-svn: 230709
2015-02-27 00:07:04 +00:00
Alexey Samsonov a716618927 [CMake] Make sure we built one variant of i386/i686 runtime libraries.
llvm-svn: 230683
2015-02-26 21:03:41 +00:00
Alexey Samsonov 819045cdd6 [CMake] Properly detect whether we're building runtime for i386 or i686.
llvm-svn: 230569
2015-02-25 23:07:32 +00:00
Mohit K. Bhakkad a46d5a7438 [TSan][MIPS] Adding support for MIPS64
Patch by Sagar Thakur

Reviewers: dvyukov, samsonov, petarj, kcc, dsanders.

Subscribers:  mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229972
2015-02-20 06:42:41 +00:00
Mohit K. Bhakkad 36f974d76b [LSan] [MIPS] adding support of LSan for mips64/mips64el arch
Patch by Sagar Thakur

Reviewers: petarj, earthdok, kcc.

Subscribers:  samsonov, dsanders, mohit.bhakkad, Anand.Takale, llvm-commits.

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

llvm-svn: 229830
2015-02-19 07:30:39 +00:00
Renato Golin 67bf4bd316 Revert "Enable ASAN build and test on AArch64"
This reverts commit r229665. It seems that the AArch64 ASAN tests, that
pass on all our internal machines, doesn't like the public buildbot.

Turning this off until we can investigate the public bot for a better
understanding.

llvm-svn: 229739
2015-02-18 20:30:32 +00:00
Renato Golin ee130d1c2a Enable ASAN build and test on AArch64
llvm-svn: 229665
2015-02-18 11:34:41 +00:00
Alexey Samsonov 54a0e40442 [CMake] PowerPC: detect host endianness to build corresponding version of runtimes.
Prior to this change we built two identical runtimes, named "powerpc64"
and "powerpc64le", while their actual endianness matched the host
endianness.

llvm-svn: 228650
2015-02-10 01:42:44 +00:00
Renato Golin b61cd95431 Revert "Enabling testing ASAN on AArch64"
This reverts commit r227966, which turned ASAN on on AArhc64 and may be the
cause of the bots never finishing the check-all. I'll re-apply once we're
sure that bot can cope with it.

llvm-svn: 228023
2015-02-03 20:23:00 +00:00
Alexey Samsonov 9cea2c1035 [ASan] Run tests with both static and dynamic runtime on Windows by default.
llvm-svn: 228001
2015-02-03 18:40:34 +00:00
Renato Golin af1f7d759f Enabling testing ASAN on AArch64
Also, disabling BuiltinLongJmpTest, as it fails for ARM and PPC as well.

Patch by Christophe Lyon.

llvm-svn: 227966
2015-02-03 11:26:52 +00:00
Alexey Samsonov c91ffd2c8f [TSan] Build runtime with -msse3 flag.
llvm-svn: 227850
2015-02-02 20:37:25 +00:00
Alexey Samsonov 807f1b539c [CMake] Get rid of TARGET_64_BIT_CFLAGS: explicitly list required flags for each architecture.
llvm-svn: 227496
2015-01-29 21:32:34 +00:00
Nico Weber 896984c251 Much spelling. Wow.
llvm-svn: 226638
2015-01-21 02:09:16 +00:00
Rafael Espindola 0dfd240068 Avoid building compiler-rt with LTO.
During a LTO we still need to build a compiler_rt with regular object files
in the .a.

llvm-svn: 225049
2014-12-31 18:20:52 +00:00
Renato Golin 518a7b2585 Fix obvious cut&paste error on AArch64 Compiler-RT settings
llvm-svn: 224472
2014-12-17 23:43:39 +00:00
Alexey Samsonov 969902b43b [ASan] Always build shared ASan runtime on Linux.
This commit changes the strategy for building shared ASan runtime
and the way we test it:
  - COMPILER_RT_BUILD_SHARED_ASAN CMake option is removed. We now
    always build shared ASan runtime (it is the default on Android,
    Windows and Mac, and not the default on Linux and FreeBSD).
  - Platforms, which use static runtime by default now have
    "check-asan-dynamic" testsuite. This testsuite contains instrumented
    unit tests, and ASan lit tests, and runs them with shared ASan
    runtime. This testsuite is *not* a part of "check-asan" and
    *not* a part of "check-all", as adding 1000 more test cases, which
    duplicate existing ones is costly. However, you're welcome to
    add this command to your buildbot.

llvm-svn: 224470
2014-12-17 23:14:01 +00:00
Renato Golin 398e9ccf8b Fixes wrong -march=aarch64 option in compiler-rt
llvm-svn: 224362
2014-12-16 20:31:37 +00:00
Kumar Sukhani 79c79e3e8a [UBSan][MIPS] Adding support for MIPS64
No MIPS64 architecture dependant code

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224239
2014-12-15 09:20:06 +00:00
Peter Collingbourne fd860bc41a [DFSAN][MIPS] adding support of DFSAN for MIPS64
Minor changes to enable DFSAN on MIPS64

Patch by Kumar Sukhani!

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

llvm-svn: 223517
2014-12-05 21:22:36 +00:00
Alexey Samsonov de13018874 [MSan] [MIPS] Adding support for MIPS64 (patch by Mohit Bhakkad).
Reviewed at http://reviews.llvm.org/D5906

llvm-svn: 222388
2014-11-19 21:42:33 +00:00
Alexey Samsonov 829da45631 [CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.
llvm-svn: 221925
2014-11-13 21:19:53 +00:00
Jay Foad 8e586617c4 InstrProf: support PowerPC64
Summary:
I don't know anything about profiling but it seems to work out of the
box on PowerPC64. At least "make check-profile" works.

A few tests needed tweaking because PowerPC64 IR declares main with
"define signext i32 @main" instead of just "define i32 @main".

This also fixes the asan asan_and_llvm_coverage_test test, which
compiles with -coverage so requires that a profiling version of
libclang_rt has been built.

Reviewers: dexonsmith, kcc, samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

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

llvm-svn: 221877
2014-11-13 09:24:32 +00:00
Kostya Serebryany 2dd74371b2 [asan] [mips] added support of asan for mips64/mips64el, patch by Kumar Sukhani
llvm-svn: 221800
2014-11-12 18:23:16 +00:00
Will Schmidt 626963187b When run on a ppc64le based platform, the check-sanitizer build looks for
objects with the powerpc64le name. i.e. asan-powerpc64le.a
This change allows those objects to be built.

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

llvm-svn: 221356
2014-11-05 16:35:23 +00:00
Viktor Kutuzov c8f3435f0e [Tsan] Enable thread sanitizer tests on FreeBSD
Differential Revision: http://reviews.llvm.org/D5995

llvm-svn: 220676
2014-10-27 11:28:53 +00:00
Aaron Ballman 1d1f232041 Disabling some MSVC warnings that are of questionable value. Note, these are disabled by default in LLVM as well, so there is precedence.
C4146: 'unary minus operator applied to unsigned type, result still unsigned'
C4291: ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'
C4800: ''type' : forcing value to bool 'true' or 'false' (performance warning)'
llvm-svn: 220507
2014-10-23 20:39:58 +00:00
Alexey Samsonov 6c386e229b [UBSan] [MIPS] Adding support of UBSan for mipsel arch
Summary:
Changed files:
config-ix.cmake: Added mipsel to UBSAN_SUPPORTED_ARCH

Reviewers: rsmith, kcc, dsanders, petarj, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, mohit.bhakkad, farazs, kumarsukhani

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

llvm-svn: 219822
2014-10-15 18:04:42 +00:00
Petar Jovanovic a1ac4b2f6a [asan][mips] Adding support of asan for mipsel arch
cmake/config-ix.cmake: Enabled building of asan for mipsel arch
test/asan/CMakeLists.txt: Enabled testing of asan for mipsel

Patch by Kumar Sukhani

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

llvm-svn: 219496
2014-10-10 13:46:55 +00:00
Renato Golin 34cb659103 Separating ARM/AArch64 Compiler-RT tests
Makes sure ARM bots don't run AArch64 and vice-versa, since not all
AArch64 systems can run AArch32 and no ARM hardware can run AArch64.

llvm-svn: 219304
2014-10-08 13:47:18 +00:00
Daniel Sanders 09c8f6f6a4 [Compiler-rt][MIPS][Profile] Adding support for MIPS32/64
Summary:
Changed cmake/config-ix.cmake to add support for different MIPS architectures: mips, mipsel, mips64, mips64el
In profile code there is no target  based dependencies, so just enabling mips flag does the work. 

Patch by Mohit Bhakkad

Reviewers: dsanders, void, petarj, kcc, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, farazs, kumarsukhani

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

llvm-svn: 218866
2014-10-02 12:47:55 +00:00
Evgeniy Stepanov 0f7ab59adc [sanitizer] Add i686 arch to compiler-rt.
This is needed so we can produce -i686- named libraries for
x86 Android (which is i686-linux-android).

An alternative solution would be keeping the "i386" name internally and
tweaking the OUTPUT_NAME of compiler-rt libraries.

llvm-svn: 218761
2014-10-01 12:55:06 +00:00
Evgeniy Stepanov 9e922e7d24 [sanitizer] Android build cleanup.
* Detect Android toolchain target arch and set correct runtime library name.
* Merged a lot of Android and non-Android code paths.
* Android is only supported in standalone build of compiler-rt now.
* Linking lsan-common in ASan-Android (makes lsan annotations work).
* Relying on -fsanitize=address linker flag when building tests (again,
  unification with non-Android path).
* Runtime library moved from lib/asan to lib/linux.

llvm-svn: 218605
2014-09-29 13:18:55 +00:00
Petar Jovanovic c2e0427b94 [UBSan] Adding support of MIPS32
Changed files: 
config-ix.cmake: Enabled UBSan for MIPS32
sanitizer_stacktrace.cc: Program counter for MIPS32 is four byte aligned
and a delay slot so subtracted PC by 8 for getting call site address.
cast-overflow.cpp: Added big endian support for this test case.

Patch by Sagar Thakur.

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

llvm-svn: 218519
2014-09-26 14:16:06 +00:00
Timur Iskhodzhanov 47030475a0 [ASan/Win] Disable warning C4391: incorrect return type for intrinsic function
This warning makes it a bit hard to define strlen and wcslen interceptors in an elegant yet portable way

llvm-svn: 216450
2014-08-26 12:33:00 +00:00
Timur Iskhodzhanov f2d24473fe [ASan] Use check_library_exists to determine if libc/libstdc++ are available
llvm-svn: 216264
2014-08-22 12:26:34 +00:00
Alexey Samsonov 6d2022b2e0 Fix latent bug in try_compile macro and use CMAKE_EXE_LINKER_FLAGS
when testing for supported architectures, as suggested by Andy Gibbs.

llvm-svn: 216083
2014-08-20 17:12:58 +00:00
Alexey Samsonov 266ba5586d Fix build on some architectures caused by r215247.
llvm-svn: 215380
2014-08-11 19:57:56 +00:00
Alexey Samsonov 68b9e74592 [CMake] Determine which compiler-rt libraries are supported on
a given platform in a top-level CMakeLists.txt to use it both
in lib/ and in test/ subdirectories. Move architecture/platform
checks to config-ix.

llvm-svn: 215247
2014-08-08 22:01:20 +00:00
Timur Iskhodzhanov 930ffe94aa [Sanitizer tests] Don't need to use -lstdc++ thanks to --driver-mode=g++
Reviewed at http://reviews.llvm.org/D3796

llvm-svn: 209115
2014-05-19 08:19:38 +00:00
Timur Iskhodzhanov 2e9136c2da [Sanitizer/ASan tests] Automatically detect the presence of libstdc++
llvm-svn: 208695
2014-05-13 12:57:50 +00:00
Timur Iskhodzhanov 7d07fe20a0 [ASan tests] Add Windows-specific flags to lib/asan/tests/CMakeLists.txt
Reviewed at http://reviews.llvm.org/D3720

llvm-svn: 208682
2014-05-13 10:33:42 +00:00
Alexey Samsonov 56b6ee9833 [ASan] Optional support for dynamic ASan runtime on Linux.
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!

llvm-svn: 205308
2014-04-01 13:16:30 +00:00