Commit Graph

8141 Commits

Author SHA1 Message Date
Simon Dardis 75bdd93720 [sancov] Disable failing test for MIPS.
Currently unsupported.

llvm-svn: 294033
2017-02-03 20:16:07 +00:00
Maxim Ostapenko 490c508b1d [lsan] Disable sem_init_glibc.cc testcase for LSan x86.
This test relies on sanitizer common interceptor to pick the oldest version of
sem_init function from Glibc. But LSan actually doesn't intercept sem_init, thus
the new implementation is called that causes test failure. Disable it for LSan x86,
the proper fix would require to check Glibc version at runtime and adjust
GET_SEM_VALUE(V) accordingly. 

llvm-svn: 294001
2017-02-03 11:57:26 +00:00
Maxim Ostapenko e5f2bfaea9 [sanitizer] Fix 'dyld: Symbol not found: _memmem' linkage error on Darwin 10.6
This patch tries to fixes sanitizer linkage errors on Darwin 10.6 originally reporded
in GCC's pr78663 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78663).

Differential Revision: https://reviews.llvm.org/D29287

llvm-svn: 293992
2017-02-03 06:58:14 +00:00
Marcos Pividori c1f8a82491 [sancov] Define delimiters for sanitizer coverage's binary section on Windows.
On Windows, the symbols "___stop___sancov_guards" and "___start___sancov_guards"
are not defined automatically. So, we need to take a different approach.
We define 3 sections: ".SCOV$A", ".SCOV$M" and ".SCOV$Z".

 Section ".SCOV$A" will only hold a variable ___start___sancov_guard.
 Section ".SCOV$M" will hold the main data.
 Section ".SCOV$Z" will only hold a variable ___stop___sancov_guards.

When linking, they will be merged sorted by the characters after the $, so we
can use the pointers of the variables ___[start|stop]___sancov_guard to know the
actual range of addresses of that section.

___[start|stop]___sancov_guard should be defined only once per module. On
Windows, we have 2 different cases:

+ When considering a shared runtime:
 All the modules, main executable and dlls, are linked to an auxiliary static
 library dynamic_runtime_thunk.lib. Because of that, we include the delimiters
 in `SancovDynamicRuntimeThunk`.

+ When considering a static runtime:
 The main executable in linked to the static runtime library.
 All the dlls are linked to an auxiliary static library dll_thunk.
 Because of that, we include the delimiter to both `SancovDllThunk` and
 `SANITIZER_LIBCDEP_SOURCES` (which is included in the static runtime lib).

Differential Revision: https://reviews.llvm.org/D28435

llvm-svn: 293959
2017-02-02 23:02:15 +00:00
Marcos Pividori 2b9c44e226 [sanitizer] Use interception to access to strong definitions in the executable.
In Windows, when sanitizers are implemented as a shared library (DLL), users can
redefine and export a new definition for weak functions, in the main executable,
for example:

extern "C" __declspec(dllexport)
void __sanitizer_cov_trace_pc_guard(u32* guard) {
  // Different implementation provided by the client.
}

However, other dlls, will continue using the default implementation imported
from the sanitizer dll. This is different in linux, where all the shared
libraries will consider the strong definition.

With the implementation in this diff, when the dll is initialized, it will check
if the main executable exports the definition for some weak function (for
example __sanitizer_cov_trace_pc_guard). If it finds that function, then it will
override the function in the dll with that pointer. So, all the dlls with
instrumentation that import __sanitizer_cov_trace_pc_guard__dll() from asan dll,
will be using the function provided by the main executable.

In other words, when the main executable exports a strong definition for a weak
function, we ensure all the dlls use that implementation instead of the default
weak implementation.

The behavior is similar to linux. Now, every user that want to override a weak
function, only has to define and export it. The same for Linux and Windows, and
it will work fine. So, there is no difference on the user's side.

All the sanitizers will include a file sanitizer_win_weak_interception.cc that
register sanitizer's weak functions to be intercepted in the binary section WEAK

When the sanitizer dll is initialized, it will execute weak_intercept_init()
which will consider all the CB registered in the section WEAK. So, for all the
weak functions registered, we will check if a strong definition is provided in
the main executable.

All the files sanitizer_win_weak_interception.cc are independent, so we do not
need to include a specific list of sanitizers.
Now, we include [asan|ubsan|sanitizer_coverage]_win_weak_interception.cc and
sanitizer_win_weak_interception.cc in asan dll, so when it is initialized, it
will consider all the weak functions from asan, ubsan and sanitizer coverage.

After this diff, sanitizer coverage is fixed for MD on Windows. In particular
libFuzzer can provide custom implementation for all sanitizer coverage's weak
functions, and they will be considered by asan dll.

Differential Revision: https://reviews.llvm.org/D29168

llvm-svn: 293958
2017-02-02 23:02:11 +00:00
Marcos Pividori e49ec6d57c [asan] Intercept SetUnhandledExceptionFilter.
In this diff I update the code for asan on Windows, so we can intercept
SetUnhandledExceptionFilter and catch some exceptions depending on the result of
IsHandledDeadlyException() (which depends on asan flags).

This way we have the same behavior on Windows and Posix systems.
On Posix, we intercept signal and sigaction, so user's code can only register
signal handlers for signals that are not handled by asan.
After this diff, the same happens on Windows, user's code can only register
exception handlers for exceptions that are not handled by asan.

Differential Revision: https://reviews.llvm.org/D29463

llvm-svn: 293957
2017-02-02 23:02:04 +00:00
Marcos Pividori fe9288a6a0 [sanitizer] Move DescribeSignalOrException to sanitizer_common.
Differential Revision: https://reviews.llvm.org/D29459

llvm-svn: 293956
2017-02-02 23:01:59 +00:00
Marcos Pividori ee22156b78 [sanitizer] Move exception code to sanitizer_common.
Differential Revision: https://reviews.llvm.org/D29458

llvm-svn: 293955
2017-02-02 23:01:51 +00:00
Marcos Pividori 387210c6c8 [asan] Properly handle exceptions.
Differential Revision: https://reviews.llvm.org/D29457

llvm-svn: 293954
2017-02-02 23:01:46 +00:00
Marcos Pividori b88e87d4b2 [sanitizer] Add dynamic_runtime_thunk for different sanitizers.
In Windows, when the sanitizer is implemented as a shared library (DLL), we need
an auxiliary static library dynamic_runtime_thunk that will be linked to the
main executable and dlls.

In the sanitizer DLL, we are exposing weak functions with WIN_WEAK_EXPORT_DEF(),
which exports the default implementation with __dll suffix. For example: for
sanitizer coverage, the default implementation of __sanitizer_cov_trace_cmp is
exported as: __sanitizer_cov_trace_cmp__dll.

In the dynamic_runtime_thunk static library, we include weak aliases to the
imported implementation from the dll, using the macro WIN_WEAK_IMPORT_DEF().

By default, all users's programs that include calls to weak functions like
__sanitizer_cov_trace_cmp, will be redirected to the implementation in the dll,
when linking to dynamic_runtime_thunk.

After this diff, we are able to compile code with sanitizer coverage
instrumentation on Windows. When the instrumented object files are linked with
clang-rt_asan_dynamic_runtime_thunk-arch.lib all the weak symbols will be
resolved to the implementation imported from asan dll.

All the files sanitizer_dynamic_runtime_thunk.cc are independent, so we do not
need to include a specific list of sanitizers.
Now, we compile: [asan|ubsan|sanitizer_coverage]_win_dynamic_runtime_thunk.cc
and sanitizer_win_dynamic_runtime_thunk.cc to generate
asan_dynamic_runtime_thunk.lib, because we include asan, ubsan and sanitizer
coverage in the address sanitizer library.

Differential Revision: https://reviews.llvm.org/D29158

llvm-svn: 293953
2017-02-02 23:01:41 +00:00
Marcos Pividori f5d265460d [sanitizer] Intercept weak functions in dll_thunks.
In this diff, I update current implementation of the interception in dll_thunks
to consider the special case of weak functions.
First we check if the client has redefined the function in the main executable
(for example: __sanitizer_cov_trace_pc_guard). It we can't find it, then we look
for the default implementation (__sanitizer_cov_trace_pc_guard__dll). The
default implementation is always available because the static runtime is linked
to the main executable.

Differential Revision: https://reviews.llvm.org/D29155

llvm-svn: 293952
2017-02-02 23:01:34 +00:00
Marcos Pividori bfdfaa11ca [sanitizer] Split dll_thunks into different sanitizers.
When the sanitizer is implemented as a static library and is included in the
main executable, we need an auxiliary static library dll_thunk that will be
linked to the dlls that have instrumentation, so they can refer to the runtime
in the main executable. Basically, it uses interception to get a pointer the
function in the main executable and override its function with that pointer.

Before this diff, all of the implementation for dll_thunks was included in asan.
In this diff I split it into different sanitizers, so we can use other
sanitizers regardless of whether we include asan or not.

All the sanitizers include a file sanitizer_win_dll_thunk.cc that register
functions to be intercepted in the binary section: DLLTH

When the dll including dll_thunk is initialized, it will execute
__dll_thunk_init() implemented in: sanitizer_common/sanitizer_win_dll_thunk.cc,
which will consider all the CB registered in the section DLLTH. So, all the
functions registered will be intercepted, and redirected to the implementation
in the main executable.

All the files "sanitizer_win_dll_thunk.cc" are independent, so we don't need to
include a specific list of sanitizers. Now, we compile:  asan_win_dll_thunk.cc
ubsan_win_dll_thunk.cc,  sanitizer_coverage_win_dll_thunk.cc and
sanitizer_win_dll_thunk.cc, to generate asan_dll_thunk, because we include asan,
ubsan and sanitizer coverage in the address sanitizer library.

Differential Revision: https://reviews.llvm.org/D29154

llvm-svn: 293951
2017-02-02 23:01:28 +00:00
Bill Seurer f2611acfec [powerpc] deactivate user_malloc.cc tsan test on powerpc64le
This test fails consistently on Ubuntu 16.xx powerpc64 LE systems.
The cause is being investigated and in the meantime disable it so
the buildbots can run cleanly.

llvm-svn: 293939
2017-02-02 21:32:07 +00:00
Vitaly Buka 89d054fc64 [compiler-rt] Fix incorrect use of snprintf
Summary:
snprintf returns buffer size needed for printing. If buffer was small, calling
code receives incorrectly symbolized buffer and fail.

Reviewers: eugenis

Subscribers: kubamracek, dberris, kcc

Differential Revision: https://reviews.llvm.org/D29440

llvm-svn: 293930
2017-02-02 20:10:07 +00:00
Kuba Mracek aa78ad5fea [tsan] Provide API for libraries for race detection on custom objects
This patch allows a non-instrumented library to call into TSan runtime, and tell us about "readonly" and "modifying" accesses to an arbitrary "object" and provide the caller and tag (type of object).  This allows TSan to detect violations of API threading contracts where "read-only" methods can be called simulatenously from multiple threads, while modifying methods must be exclusive.

Differential Revision: https://reviews.llvm.org/D28836

llvm-svn: 293885
2017-02-02 13:17:05 +00:00
Kuba Mracek 5c88271528 Fixup of r293882: Forgot to update sanitizer_thread_registry.test.cc
llvm-svn: 293884
2017-02-02 13:07:22 +00:00
Kuba Mracek bba1d40589 [tsan] Properly describe GCD worker threads in reports
When dealing with GCD worker threads, TSan currently prints weird things like "created by thread T-1" and "[failed to restore the stack]" in reports. This patch avoids that and instead prints "Thread T3 (...) is a GCD worker thread".

Differential Revision: https://reviews.llvm.org/D29103

llvm-svn: 293882
2017-02-02 12:54:21 +00:00
Dean Michael Berris 607617b004 [XRay] Probe for CPU features that XRay needs
Summary:
In llvm.org/PR31756 it's pointed out that sometimes rdtscp isn't
available. We fix it here by checking first whether it's availble before
installing the logging handler. In future commits we can have
alternative implementations, maybe working around some of the
constraints on some systems.

This change enables us to make that determination, but report an error
instead when the features aren't available.

Reviewers: sdardis, javed.absar, rSerge

Subscribers: pelikan, llvm-commits

Differential Revision: https://reviews.llvm.org/D29438

llvm-svn: 293870
2017-02-02 07:51:21 +00:00
Justin Bogner d6d57bb359 [asan] Support handle_sigfpe on Darwin
llvm-svn: 293746
2017-02-01 07:54:36 +00:00
Justin Bogner 05cfdb936a [sanitizer] Support SANITIZER_INTERCEPTOR_HOOKS on Darwin
This basically already worked other than weak symbols needing
definitions on darwin.

llvm-svn: 293741
2017-02-01 03:31:09 +00:00
Justin Bogner aded0f85e3 Remove XFAIL from the sanitizer guard test for darwin
This works as of "Support sanitizer guard section on darwin" in the
llvm repo.

llvm-svn: 293734
2017-02-01 02:38:42 +00:00
Marcos Pividori e72c69bb0a [sancov] Move __sancov_default_options declaration outside the namespace __sancov
After this commint, we can include sancov_flags.h and refer to
__sancov_default_options without requiring the namespace prefix.

Differential Revision: https://reviews.llvm.org/D29167

llvm-svn: 293731
2017-02-01 01:36:19 +00:00
Marcos Pividori 8789a5a9f6 [sanitizer] Fix interface tests when SANITIZER_CAN_USE_CXXABI is true.
We ignore `__ubsan_handle_dynamic_type_cache_miss*` symbols when
`SANITIZER_CAN_USE_CXXABI` is true. Because they are included in the
library but they are not included in the interface lists.

llvm-svn: 293711
2017-01-31 22:57:55 +00:00
Marcos Pividori 8dac0cede7 [sanitizer] Fix interface test on Darwin, failing after 293682.
The test was failing because we export the functions: "__sanitizer_mz*" but they
are not included in the general interface lists.
Also, weak undefined symbols are tagged with U by `nm -g` on Darwin.

Differential Revision: https://reviews.llvm.org/D29345

llvm-svn: 293710
2017-01-31 22:57:50 +00:00
Marcos Pividori 25527bf021 [sanitizer] Add list of symbols exported in sanitizers' interface.
Add a new auxiliary file to each sanitizer: sanitizer_interface.inc, listing all
the functions exported, with the macros: INTERFACE_FUNCTION() and
INTERFACE_WEAK_FUNCTION().
So, when we need to define or repeat a procedure for each function in the
sanitizer's interface, we can define the macros and include that header.
In particular, these files are needed for Windows, in the nexts commits.
Also, this files could replace the existing files: weak_symbols.txt for Apple.
Instead of reading weak_symbols.txt to get the list of weak symbols, we could
read the file sanitizer_interface.inc and consider all the symbols included with
the macro INTERFACE_WEAK_FUNCTION(Name).

In this commit, I only include these files to the sanitizers that work on
Windows. We could do the same for the rest of the sanitizers when needed.

I updated tests for: Linux, Darwin and Windows. If a new function is exported
but is not present in the interface list, the tests
"interface_symbols_[darwin|windows|linux].c" fail.

Also, I remove the comments: "/* OPTIONAL */" which are not required any more,
because we use the macro: INTERFACE_WEAK_FUNCTION() for weak functions.

Differential Revision: https://reviews.llvm.org/D29148

llvm-svn: 293682
2017-01-31 20:23:21 +00:00
Marcos Pividori e9e0769764 [sanitizer] Define as weak, functions that are declared as weak.
Differential Revision: https://reviews.llvm.org/D29228

llvm-svn: 293681
2017-01-31 20:23:14 +00:00
Marcos Pividori c6c38b7537 [asan] Export __sancov_* symbols symbols.
Add __sancov_* symbols to the export list.

Differential Revision: https://reviews.llvm.org/D29317

llvm-svn: 293680
2017-01-31 20:23:07 +00:00
Marcos Pividori 6342cf9dc3 [sancov] Add new sanitizer coverage functions to the internal interface.
Differential Revision: https://reviews.llvm.org/D28597

llvm-svn: 293672
2017-01-31 18:37:18 +00:00
Marcos Pividori 9de8f5910f [sanitizer] Ensure macro parameters are expanded before stringifying.
Add auxiliary macro to ensure parameters are expanded before stringifying.

Differential Revision: https://reviews.llvm.org/D29312

llvm-svn: 293671
2017-01-31 18:37:07 +00:00
Maxim Ostapenko 7d8f1deafc [lsan] Fix typo in stale_stack_leak.cc testcase
llvm-svn: 293644
2017-01-31 16:32:58 +00:00
Maxim Ostapenko dbaacc7566 [lsan] Disable stale_stack_leak.cc testcase on x86
llvm-svn: 293621
2017-01-31 12:59:04 +00:00
Maxim Ostapenko 651cfe3cfa [lsan] Renable LSan for x86 Linux
The missed clang part was committed at https://reviews.llvm.org/rL293609 thus
we can reenable LSan for x86 Linux.

Differential Revision: https://reviews.llvm.org/D28609

llvm-svn: 293610
2017-01-31 07:15:37 +00:00
Tim Shen f63f58a28f [compiler-rt] Don't change g_tls_size after initialization.
Summary:
g_tls_size is not supposed to be changed after initialization. It's not
atomic, not guarded by a lock, nor thread_local. But it's read by
multiple threads.

The reason why it's mutated is mips and powerpc64 specific. We can
implement the same funcitonality without mutating g_tls_size.

I'm not sure how to write a test for this. Please advice. Thanks!

Reviewers: eugenis, kcc

Subscribers: kubamracek, dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D29236

llvm-svn: 293586
2017-01-31 01:53:36 +00:00
Kostya Kortchinsky 2282ede5a8 [sanitizer] Re-enable -fno-function-sections for powerpc64le
Summary:
For a reason that hasn't been investigated for lack of powerpc knowledge and
hardware, -fno-function-sections is required for the Sanitizers to work
properly on powerpc64le. Without, the function-sections-are-bad test fails on
that architecture (and that architecture only).

This patch re-enables the flag in the powerpc64le cflags.

I have to admit I am not entirely sure if my way is the proper way to do this,
so if anyone has a better way, I'll be happy to oblige.

Reviewers: kcc, eugenis

Reviewed By: eugenis

Subscribers: nemanjai, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29285

llvm-svn: 293558
2017-01-30 22:31:49 +00:00
Dimitry Andric f2ac1d1df2 Recommit: Stop intercepting some malloc-related functions on FreeBSD and
macOS

Summary:
In https://bugs.freebsd.org/215125 I was notified that some configure
scripts attempt to test for the Linux-specific `mallinfo` and `mallopt`
functions by compiling and linking small programs which references the
functions, and observing whether that results in errors.

FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions, so
normally these tests would fail, but when sanitizers are enabled, they
incorrectly succeed, because the sanitizers define interceptors for
these functions.  This also applies to some other malloc-related
functions, such as `memalign`, `pvalloc` and `cfree`.

Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`,
`pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers.

Also delete the non-functional `cfree` wrapper for Windows, to fix the
test cases on that platform.

Reviewers: emaste, kcc, rnk

Subscribers: timurrrr, eugenis, hans, joerg, llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D27654

llvm-svn: 293536
2017-01-30 19:06:13 +00:00
Weiming Zhao a000b467d3 [Bultin][ARM] Make aeabi_uldivmod and aeabi_ldivmod be Thumb1 compatible
Summary:
in aeabi_ldivmod and uldivmod, using r6 instead of r12 as the temp reg due to limitation of Thumb1 ISA.
Now, all EABI sources are Thumb1 compatible.

Also added test cases by reusing the test cases from divmodsi4_test.c, udivmodsi4_test and udivmoddi4_test.c

Reviewers: rengolin, compnerd

Reviewed By: rengolin

Subscribers: javed.absar, aemerson, mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D29226

llvm-svn: 293527
2017-01-30 18:48:05 +00:00
Marcos Pividori 7ac943c463 [interception] Check for export table's size before referring to its elements.
This fix a bug, when calling InternalGetProcAddress() for an executable that
doesn't export any symbol. So the table is empty.
If we don't check for this condition, the program fails with Error 0xc0000142.

Also, I add a regression test for Windows.

Differential Revision: https://reviews.llvm.org/D28502

llvm-svn: 293521
2017-01-30 18:23:37 +00:00
Serge Rogatch 7ccb24f8cb [XRay][ARM32][AArch64] Fix unstable FDR tests on weak-ordering CPUs
Summary: Change from `compare_exchange_weak()` to `compare_exchange_strong()` where appropriate, because on ARM ( http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/3190 , http://lab.llvm.org:8011/builders/clang-cmake-armv7-a15-full/builds/3191 ) and AArch64 ( http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/3900 ) it fails even in single-threaded scenarios.

Reviewers: dberris, rengolin

Reviewed By: rengolin

Subscribers: aemerson, llvm-commits, iid_iunknown

Differential Revision: https://reviews.llvm.org/D29286

llvm-svn: 293505
2017-01-30 17:10:49 +00:00
Marcos Pividori bf0261d518 [asan] Fix tests for exported interfaces.
Add "OPTIONAL" comment to declaration of weak function in the internal
interface. This fix the tests `interface_symbols_linux.c` and
`interface_symbols_darwin.c` which were failing after r293423.

llvm-svn: 293442
2017-01-29 20:19:08 +00:00
Marcos Pividori 62a188d623 [asan] Add missing declaration in the internal interface
Differential Revision: https://reviews.llvm.org/D29230

llvm-svn: 293423
2017-01-29 06:14:55 +00:00
Marcos Pividori 35e60eeb6e [windows] Properly use dllimport / dllexport.
Update the headers, so we can change the dllexports to dllimport when
defining SANITIZER_IMPORT_INTERFACE.

Differential Revision: https://reviews.llvm.org/D29052

llvm-svn: 293422
2017-01-29 06:11:32 +00:00
Marcos Pividori 8650f5d1a1 General definition for weak functions
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
2017-01-29 05:44:59 +00:00
Evgeniy Stepanov 8bf0633288 Revert "Stop intercepting some malloc-related functions on FreeBSD and macOS"
This reverts r293337, which breaks tests on Windows:

malloc-no-intercept-499eb7.o : error LNK2019: unresolved external symbol _mallinfo referenced in function _main

llvm-svn: 293346
2017-01-27 23:53:20 +00:00
Dimitry Andric 47e0ef3148 Stop intercepting some malloc-related functions on FreeBSD and macOS
Summary:
In https://bugs.freebsd.org/215125 I was notified that some configure
scripts attempt to test for the Linux-specific `mallinfo` and `mallopt`
functions by compiling and linking small programs which references the
functions, and observing whether that results in errors.

FreeBSD and macOS do not have the `mallinfo` and `mallopt` functions, so
normally these tests would fail, but when sanitizers are enabled, they
incorrectly succeed, because the sanitizers define interceptors for
these functions.  This also applies to some other malloc-related
functions, such as `memalign`, `pvalloc` and `cfree`.

Fix this by not intercepting `mallinfo`, `mallopt`, `memalign`,
`pvalloc` and `cfree` for FreeBSD and macOS, in all sanitizers.

Reviewers: emaste, kcc

Subscribers: hans, joerg, llvm-commits, kubamracek

Differential Revision: https://reviews.llvm.org/D27654

llvm-svn: 293337
2017-01-27 22:19:11 +00:00
Weiming Zhao 68e20da3f9 [Builtin][ARM] Add Thumb1 support for aeabi_c{f,d}cmp.S and dcmp.S
Reviewers: compnerd, rengolin

Reviewed By: rengolin

Subscribers: aemerson, llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D28985

llvm-svn: 293247
2017-01-27 01:21:00 +00:00
Kostya Kortchinsky fb275a48b8 [sanitizer] Remove -fno-function-sections from SANITIZER_COMMON_CFLAGS
Summary:
-fno-function-sections was added as a default Sanitizer common cflag with
https://reviews.llvm.org/rL200683, the reasoning behind was that things would
break if linked with --gc-sections.

This appears to not be necessary anymore, as tests pass without, including
function-sections-are-bad.cc. There is a large benefit to having
function-sections when dealing with static libraries in terms of size and
dependencies that go away with --gc-sections.

Reviewers: kcc, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D29132

llvm-svn: 293220
2017-01-26 22:50:22 +00:00
Kuba Mracek 6393aa3a62 [tsan] Fix os_id of main thread
Currently, os_id of the main thread contains the PID instead of a thread ID. Let's fix this.

Differential Revision: https://reviews.llvm.org/D29106

llvm-svn: 293201
2017-01-26 19:20:30 +00:00
Oleg Ranevskyy 41abca4355 [Compiler-rt] Broken compiler-rt CMake configuring on Windows
Summary:
Hi Michal,

Would you be able to review this simple fix, please?

Since r291504 compiler-rt uses `llvm-config --cmakedir` to get the path to the LLVM CMake modules.
On Windows this option returns Windows style path with backslashes. CMake treats backslashes as beginning of an escaped character and thus fails to append the path to `CMAKE_MODULE_PATH`.

Reviewers: compnerd, mgorny

Reviewed By: mgorny

Subscribers: compnerd, llvm-commits, dberris

Differential Revision: https://reviews.llvm.org/D28908

llvm-svn: 293195
2017-01-26 18:16:02 +00:00
Serge Rogatch c4540b371d [XRay][Arm32] Reduce the portion of the stub and implement more staging for tail calls - in compiler-rt
Summary:
This patch provides more staging for tail calls in XRay Arm32 . When the logging part of XRay is ready for tail calls, its support in the core part of XRay Arm32 may be as easy as changing the number passed to the handler from 1 to 2.
Coupled patch:
- https://reviews.llvm.org/D28673

Reviewers: dberris, rengolin

Reviewed By: dberris, rengolin

Subscribers: llvm-commits, iid_iunknown, aemerson

Differential Revision: https://reviews.llvm.org/D28674

llvm-svn: 293186
2017-01-26 16:18:13 +00:00
Saleem Abdulrasool 309b3bfa6a builtins: remove an errant ':'
Thanks to Dave Lee for pointing this out!

llvm-svn: 293120
2017-01-26 00:37:55 +00:00