Commit Graph

15965 Commits

Author SHA1 Message Date
Vitaly Buka 3f5f2905c4 [test] Propagate HWASAN_OPTIONS 2022-08-17 18:59:49 -07:00
Vitaly Buka 36bdec44a2 [NFC][tsan] Use AddThread(Tid tid... 2022-08-17 13:53:13 -07:00
John Ericson d784ecfea9 [compiler-rt][libunwind][runtimes] Recategorize `llvm_check_linker_flag` langs
Done according to @phosek's comments in D117537, but not done then to
separate pure refactor (that) from possible behavior change (this).

Wasn't working before, but I think that was due to an issue of mismatched variable names fixed in D110005.

Reviewed By: phosek, #libunwind, #libc_abi

Differential Revision: https://reviews.llvm.org/D117833
2022-08-17 12:35:36 -04:00
Maxim Schessler aa0e9046c1 Libfuzzer fix for Ctrl + c not working with -fork and -ignore_crashes=1
In some cases running Libfuzzer in fork mode with -ignore_crashes=1 counts ctrl+c as crash and restarts.

Thread: https://github.com/google/oss-fuzz/issues/4547

Credit: Marcel Boehme <marcel.boehme@acm.org>

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D130990
2022-08-16 16:45:39 -07:00
Shoaib Meenai 5737f6a527 [compiler-rt] Build with C++17 explicitly
We've started using C++17 constructs in compiler-rt now (e.g.
string_view in ORC), but when using the bootstrapping build, we won't
inherit the C++ standard from LLVM, and compilation may fail if we
default to an older standard. Explicitly build compiler-rt with C++17 in
a standalone build, which matches what other subprojects (e.g. Clang and
LLD) do.
2022-08-16 16:24:42 -07:00
Nico Weber f56e486fdc [gn build] Make ubsan_init_standalone_preinit.cpp syncable
...after https://reviews.llvm.org/D131916
2022-08-15 18:17:06 -04:00
Kevin Athey c22841049e [MSAN] clean up style from D131728
Depends on D131728

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131903
2022-08-15 11:46:07 -07:00
Martin Storsjö 156136502b [ORC_RT][COFF] Fix cross compilation with mingw headers
Mingw headers are all lowercase, and can be used for cross compilation
from case sensitive file systems.

The official Windows SDK headers aren't self-consistent wrt upper/lower
case, so those headers can't be used on case sensitive systems without
a layer providing case insensitivity anyway.

This matches other includes of windows.h throughout the codebase.
2022-08-14 14:23:25 +03:00
Kazu Hirata 062f157c7f Ensure newlines at the end of files (NFC) 2022-08-13 12:55:45 -07:00
Vitaly Buka 57d0e9bf96 [test][sanitizer] Disable netdb tests on Android 2022-08-13 01:07:12 -07:00
Vitaly Buka c34b0720ca [test][sanitizer] Fix REQUIRES in the test 2022-08-13 00:04:55 -07:00
Vitaly Buka cd269daf25 [test][asan] Remove -fsanitize-address-use-after-scope
It's enabled by default in D31479.
2022-08-13 00:04:55 -07:00
Sunho Kim 9189a26664 [ORC_RT][COFF] Initial platform support for COFF/x86_64.
Initial platform support for COFF/x86_64.

Completed features:
* Statically linked orc runtime.
* Full linking/initialization of static/dynamic vc runtimes and microsoft stl libraries.
* SEH exception handling.
* Full static initializers support
* dlfns
* JIT side symbol lookup/dispatch

Things to note:
* It uses vc runtime libraries found in vc toolchain installations.
* Bootstrapping state is separated because when statically linking orc runtime it needs microsoft stl functions to initialize the orc runtime, but static initializers need to be ran in order to fully initialize stl libraries.
* Process symbols can't be used blidnly on msvc platform; otherwise duplicate definition error gets generated. If process symbols are used, it's destined to get out-of-reach error at some point.
* Atexit currently not handled -- will be handled in the follow-up patches.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130479
2022-08-13 13:48:40 +09:00
Vitaly Buka 4b33ea052a [sanitizer] Add dn_comp interceptor
Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D129247
2022-08-12 16:57:49 -07:00
Kevin Athey 532564de17 [MSAN] add flag to suppress storage of stack variable names with -sanitize-memory-track-origins
Allows for even more savings in the binary image while simultaneously removing the name of the offending stack variable.

Depends on D131631

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131728
2022-08-12 11:59:53 -07:00
Kevin Athey ec277b67eb [MSAN] Separate id ptr from constant string for variable names used in track origins.
The goal is to reduce the size of the MSAN with track origins binary, by making
the variable name locations constant which will allow the linker to compress
them.

Follows: https://reviews.llvm.org/D131415

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131631
2022-08-12 08:47:36 -07:00
Kevin Athey 4735104f09 [MSAN] remove unused debugging statements (NFC)
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131748
2022-08-11 20:24:34 -07:00
Vitaly Buka aca1276160 [msan] Avoid unnecessary PC increment/decrement
Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D131692
2022-08-11 14:29:07 -07:00
Vitaly Buka 4248f32b9e [NFC][sanitizer] Use __builtin_extract_return_addr on all platforms
On most platforms it does nothing, so this eliminates a need for one #if.
2022-08-11 09:48:29 -07:00
Vitaly Buka e41c5aaebe [NFC][sanitizer] Add () into a few macros 2022-08-11 09:48:28 -07:00
Vitaly Buka c615411d82 [test][asan] Disable symbolization
Reduces runtime of the test.
Unrelated pre-merge checks often timeouts here.
2022-08-11 00:02:02 -07:00
Vitaly Buka af77e5e4c0 [msan] Extract SetAllocaOrigin 2022-08-10 20:53:02 -07:00
Vitaly Buka d1040c455f [msan] Another try for powerpc fix after D131205 2022-08-10 20:39:25 -07:00
Vitaly Buka 05b3374925 [msan] Try to fix powerpc after D131205 2022-08-10 19:28:30 -07:00
Phoebe Wang f061cfb317 [compiler-rt][BF16] Provide __truncdfbf2 and __truncsfbf2 only when __bf16 is available
Differential Revision: https://reviews.llvm.org/D131147
2022-08-11 09:20:08 +08:00
Vitaly Buka ad5f7895ef [test][sanitizer] Fix REQUIRES of the test
getnetent is availible from API 28
2022-08-10 16:59:40 -07:00
Vitaly Buka e87ee2f4a9 [test][sanitizer] Switch test to a different group 2022-08-10 16:59:40 -07:00
Vitaly Buka 58063c8ade [test][sanitizer] Change exit code to debug llvm-avr-linux 2022-08-10 16:29:28 -07:00
Vitaly Buka 27b1a8273d [test][sanitizer] Fix REQUIRES in few tests 2022-08-10 16:17:12 -07:00
Vitaly Buka 6b12043beb [test][sanitizer] Fix getgrouplist test 2022-08-10 15:48:44 -07:00
Kevin Athey 057cabd997 Remove function name from sanitize-memory-track-origins binary.
This work is being done to reduce the size of MSAN with track origins binary.

Builds upon: https://reviews.llvm.org/D131205

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131415
2022-08-10 15:45:40 -07:00
Kevin Athey d7a47a9bb5 Desist from passing function location to __msan_set_alloca_origin4.
This is done by calling __msan_set_alloca_origin and providing the location of the variable by using the call stack.
This is prepatory work for dropping variable names when track-origins is enabled.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131205
2022-08-10 09:02:53 -07:00
Phoebe Wang 800d5e178f Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit 0729d00135.

Buildbot https://lab.llvm.org/buildbot/#/builders/19/builds/11989 failed
with "error: ISO C requires a translation unit to contain at least one declaration [-Werror,-Wempty-translation-unit]"
2022-08-10 17:27:44 +08:00
Fangrui Song 0e08061229 tsan: update Go rules to use -std=c++17
llvm-project has switched to require C++17.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D131536
2022-08-10 00:32:40 -07:00
Phoebe Wang 0729d00135 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Disable the build on macOS due to the bot fail.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 13:27:21 +08:00
Med Ismail Bennani 5990cf3806 Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit ab4e5ed441 since it
causes a build failure on macOS:

https://green.lab.llvm.org/green/job/lldb-cmake/45984/
2022-08-09 21:45:21 -07:00
Phoebe Wang ab4e5ed441 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Fix the mising change for truncdfbf2.c

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 10:22:15 +08:00
Phoebe Wang 00c0a34f6c Revert "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
This reverts commit 0ae2a41d80.

Revert due to buildbot fail.
2022-08-10 10:05:12 +08:00
Vitaly Buka 4a87afe25f
[sanitizer] Let internal symbolizer to use posix_memalign 2022-08-09 18:44:00 -07:00
Phoebe Wang 0ae2a41d80 [compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available
#56854 shows a backwards compatibility problem when builtins of compiler-rt don't follow ABI. We need to prevent to fall into the trap again for BF16.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 09:13:44 +08:00
Evgenii Stepanov cf1d9a1fdc [sanitizer] Use C++17 to build the symbolizer. 2022-08-09 15:33:03 -07:00
Vitaly Buka ea42515dad [asan] Faster version of QuickCheckForUnpoisonedRegion
Slightly helps with performance regression after D128146.
2022-08-08 22:07:35 -07:00
Vitaly Buka 03e345b519 [asan] Avoid few branches on memcpy hot path 2022-08-08 19:20:06 -07:00
Vitaly Buka 341ee9c029 [NFC][asan] Fix Condition annotation after 30bbb73bb4 2022-08-08 19:20:06 -07:00
Fangrui Song 474145c0b2 [CMake] Build lib/gwp_asan/tests with -std=c++17
With the recent llvm-project C++17 switch (D130689), gwp_asan/tests may fail to
link with some versions of GCC (https://github.com/llvm/llvm-project/issues/56994):

> backtrace.cpp:(.text+0xca6): undefined reference to `gwp_asan::AllocationMetadata::kMaxTraceLengthToCollect'

I cannot reproduce this issue by myself, but notice that currently
lib/gwp_asan/*.cpp get -std=c++17 while lib/gwp_asan/tests/*.cpp don't
(therefore may use -std=g++14 default from Clang and older GCC). Using -std=c++17
for lib/gwp_asan/tests will ensure that backtrace.cpp uses inline variable and will assuredly avoid the
possible GCC issue.

In the long-term, we should add -std=c++17 to a central place like generate_compiler_rt_tests.

Reviewed By: dyung

Differential Revision: https://reviews.llvm.org/D131440
2022-08-08 17:51:17 -07:00
Vitaly Buka 30bbb73bb4 [NFC][asan] Add LIKELY/UNLIKELY on hot memcpy paths 2022-08-08 16:25:56 -07:00
Vitaly Buka 67c06c4731 [NFC][asan] Clang-format a file 2022-08-08 16:21:35 -07:00
Fangrui Song a12c076f60 [compiler-rt] Use -std=c++17 for standalone build
Follow-up to D130689.

Reviewed By: thieta

Differential Revision: https://reviews.llvm.org/D131382
2022-08-08 12:04:42 -07:00
Wael Yehia af8205d0eb Revert "XFAIL some PGO tests on AIX until the new linker becomes publicly available."
AIX 7.2 TL5 SP4 and AIX 7.3 TL0 SP2 have been released as of now.
The linker in these OS versions recognizes and properly supports
__start_SECNAME and __stop_SECNAME symbols which are needed for PGO.

This reverts commit 93bb2f16e8.
2022-08-08 14:04:29 +00:00
Diana Picus 8342ea6eac [scudo] Try to fix standalone build on armv7
When linking scudo standalone on armv7, it can't find symbols related to
unwinding (e.g. __aeabi_unwind_cpp_pr0). This is because it is passing
--unwindlib=none. This patch hacks around the issue by adding
COMPILER_RT_UNWINDER_LINK_LIBS to the link line.

I don't know anything about scudo, so I'm not sure what the original
intention was.

See also https://github.com/llvm/llvm-project/issues/56900

Differential Revision: https://reviews.llvm.org/D131250
2022-08-08 10:19:12 +02:00